This is a project template for Django 1.4+, which introduces the new project templates feature.
- Twitter bootstrap static files
- customized project layout
- sample base.html
- a default "home page" view
- commonly used 3rd party apps (South, debug toolbar etc)
Download/checkout django-bootstrap-template to your local filesystem. Then create a new project:
django-admin.py myproject --template=/path/to/django-bootstrap-template/template
Set up your database and settings (PostgreSQL is assumed as default, modify accordingly) and you should be good to go.
This template uses the default Django 1.4 template as a starting point. It also has some "opinionated" changes to that layout, as well as some ready-made views etc to minimize start-up time.
Settings are in a package, with specific development, production, and staging settings, all inheriting from settings.base. To use a specific settings module, for example:
python manage.py --settings=myproject.settings.staging
The "development" settings are assumed by default in manage.py, change this as needed. Add more settings modules as your environment requires.
A snag when creating a new Django project is to decide between an all in one "super-app" vs "many little apps". Having everything in one app is an anti-pattern when it gets to a certain size; on the other hand, when you have lots of apps with discrete functionality (as it should be) it's hard to determine what the "entry-point" app should be.
Instead what I've done is create a "super-app" which contains sub-applications, in an apps directory.
The "super-app", or main app, is the main package of your project. You should place all common code here, for example utility modules, generic templates and tags, base models/views/forms etc, as well as "top-level" views such as your splash page, about page etc. Anything requiring concrete models should live in a sub-application, under the apps package.
Obviously, your reusable apps - as opposed to project-specific apps - should ideally live outside this project layout.