This document assumes you already have an up and running instance of django_compressor, and that you understand how to use it in your templates. The goal is to explain what the main template tag, {% compress %}, does behind the scenes, to help you debug performance problems for instance.
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
| logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
| logfile_backups=10 ; number of backed up logfiles | |
| loglevel=info ; info, debug, warn, trace | |
| pidfile=/var/run/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |
| #!/usr/bin/env python | |
| from __future__ import with_statement # needed for python 2.5 | |
| from fabric.api import * | |
| from fabric.contrib.console import confirm | |
| # ================================================================ | |
| # NOTE: | |
| # using this fabfile expects that you have the python utility | |
| # fabric installed locally, ssh access to reamea.com, and your | |
| # ssh public key associated with the account 'mboza@reamea.com' |
| Save the supervisord.initscript script as /etc/init.d/supervisord | |
| Run /usr/sbin/update-rc.d -f supervisord defaults |
| "Memcached cache backend" | |
| from django.core.cache.backends import memcached | |
| from django.utils.encoding import smart_unicode, smart_str | |
| MIN_COMPRESS_LEN = 150000 | |
| class CacheClass(memcached.CacheClass): | |
| def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN): | |
| if isinstance(value, unicode): |
| The goal of Summer of Code is to get your project written, reviewed, and | |
| ultimately merged back into Django's trunk. We want your project to | |
| succeed, and we approved it because we think you've got a good chance of | |
| pulling it off. | |
| However, this is easier said than done. You'll need to work hard, | |
| communicate effectively with the community, and pass a rigorous peer | |
| review. Your mentor -- and Django's committer team in general -- will give | |
| you as much support as possible, but ultimately the onus is on your | |
| shoulders to get this done. |
| #### PS1 customization #### | |
| NONE="\[\033[0m\]" # unsets color to term fg color | |
| # regular colors | |
| K="\[\033[0;30m\]" # black | |
| R="\[\033[0;31m\]" # red | |
| G="\[\033[0;32m\]" # green | |
| Y="\[\033[0;33m\]" # yellow | |
| B="\[\033[0;34m\]" # blue | |
| M="\[\033[0;35m\]" # magenta |
| # apkg/__init__.py | |
| # Empty. Nothing to see here. |
| """ | |
| module mydjangolib.bigint_patch | |
| A fix for the rather well-known ticket #399 in the django project. | |
| Create and link to auto-incrementing primary keys of type bigint without | |
| having to reload the model instance after saving it to get the ID set in | |
| the instance. | |
| Logs: |
-
The code will get better. Linus' Law: "given enough eyeballs, all bugs are shallow": we'll be able to get community contributions and bug reports, and thus the code will grow better faster than we can grow it ourselves. Also, Joy's Law - "No matter who you are, most of the smartest people work for someone else": we'll get better code from people who don't work for us than from people who do.
-
We'll write better code. Wall's 3rd great virtual of a programmer, Hubris: we'll write better code people we don't want other people to say bad things about us. We'll do better with the world watching than with just us.
-
Increased ability to hire. We're a 19k circ newspaper in a town most people have never heard of. Open source will help put us on the map, make us a place people actually might be interested in working.
-
When we do hire, we'll be able to hire pe