Tinned Django is a custom project template used at Future Colors. Meant to be used with python 2.7.
Note
This is NOT a general purpose template. It's focused on our workflow and shared for curious people out there.
Enforce best practices for new projects based on Django.
- New style folder structure (1.4+)
- Class-based settings for different environments with sane defaults
- Separate LocalSettings for every developer
- Useful batteries are included (see requirements.txt)
- Comprehensive .gitignore
Install Django 1.4+ so that django-admin.py
is available.
Open tinned can with Django:
$ django-admin.py startproject <yourprojectname> --template https://github.com/futurecolors/tinned-django/zipball/master --extension py,gitignore $ mv tinned_django/<yourprojectname> <yourprojectname> $ rm -r tinned_django
These are defaults for all kinds of environments, specified by DJANGO_CONFIGURATION
They're defined in {{ project_name}}.settings
module.
BaseSettings: | Defaults for all other environments, safe and sound |
---|---|
BaseLive: | Local development |
Live: | Real-time updates, includes local settings per developer |
Testing: | Running tests in CI/locally |
Dev: | Nightly/daily/hourly builds for QA and other folks |
Rc: | Pre-production, for per-release deploys |
Production: | No comments |
Local settings, for each developer that are in effect in Live
environment
are defined in {{ project_name}}.live_settings
module.
Each mixin should be regular CBS mixin, named after developer USER env variable
with first letter captialized. Example: USER=prophet -> class Prophet(object): pass
These settings are checked into repository for easy developement.
$ pip install -r requirements.txt $ nosetests