This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DEBUG = True | |
| TEMPLATE_DEBUG = DEBUG | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | |
| 'NAME': '', # Or path to database file if using sqlite3. | |
| 'USER': '', # Not used with sqlite3. | |
| 'PASSWORD': '', # Not used with sqlite3. | |
| 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class StockItemAttribute(models.Model): | |
| name = models.CharField(max_length=80) | |
| slug = models.SlugField(unique=True) | |
| help_text = models.TextField(null=True, blank=True) | |
| def __unicode__(self): | |
| return _(self.name) | |
| class StockItemAttributeValue(models.Model): | |
| stock_item = models.ForeignKey('StockItem', related_name='attribute_values') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en" class="no-js"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <title>{% block html_title %}{% endblock %}</title> | |
| <meta name="description" content=""> | |
| <meta name="author" content=""> | |
| </head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # run compile-jammit to jump out of the compile jsts in our proj structure | |
| compile-jammit () { | |
| export ACTIVE_DJANGO_PROJECT=$PWD | |
| echo "Entering ui directory" | |
| cd ../ui | |
| echo "Compiling JSTs" | |
| jammit | |
| echo "Returning you back to django project" |
- Right-click on iA Writer.app in your Applications folder, select "Show Package Contents"
- Open up Resources/English.lproj/htmlTemplate.html in your favorite text editor
- Add a link to a CSS file in your home directory (and anything else you might want). I put mine in ~/Library/Application Support/iA Writer/themes/policus/css/styles.css and decided to load a couple of web fonts from Google. See hacked-htmlTemplate.html later this gist.
- Save, exit
- Create the CSS file, override default Writer styles
Now when you export to HTML from inside of Writer, your HTML file will be styled according to your your overrides. Want to share your pretty docs? Print to PDF.
Next steps: Link to a locally-hosted jQuery and write a little JS app for switching themes in browser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // settings | |
| $std-n-cols: 12 | |
| $std-col-width: 54 | |
| $std-gutter-width: 30 | |
| // calculated constants | |
| $std-page-width: ($std-n-cols * $std-col-width) + (($std-n-cols - 1) * $std-gutter-width) | |
| @function column-width($n-cols, $col-width:$std-col-width, $gutter-width:$std-col-gutter) | |
| $column-widths: $n-cols * $col-width |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name active.lo; | |
| access_log logs/active_lo_80.log; | |
| client_max_body_size 200M; | |
| location /static { | |
| root /usr/local/www/active.lo; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # Script to symlink static and media directories active.lo, served by nginx | |
| export NGINX_STATIC_DIR=/usr/local/www/active.lo/static | |
| export NGINX_MEDIA_DIR=/usr/local/www/active.lo/media | |
| if [ -d "$PWD/static" ] | |
| then | |
| if [ -h $NGINX_STATIC_DIR ] | |
| then | |
| rm $NGINX_STATIC_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [program:<project_name>] | |
| command=/home/deploy/.virtualenvs/<project_name>/bin/gunicorn_django -c deploy/gunicorn.conf.py | |
| directory=/home/deploy/<project_name>/<project_name> | |
| user=www-data | |
| autostart=true | |
| autorestart=true | |
| stdout_logfile=/var/log/supervisor/<project_name>.log |