Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Django Skeleton

What is a Django skeleton

It's a basic structure which can serve as a base for your Django projects.


  • Django 1.3
  • Linux OS

The included directories

  • project - the source code
    • contains all the Django custom applications and settings
    • "project/apps" hosts the custom applications
    • "project/settings" includes the settings for various environments.
    • "project/settings/" is the file created by the "" tool, the rest of the settings file will import/extend this one.
    • the code from "" will import all the models when one executes "python shell" and "ipython" is available
    • "" must receive the "--settings" argument (please see the usage below)
  • static - the Django's STATIC_ROOT directory
  • media - the Django's MEDIA_ROOT directory
  • env - virtualenv or buildout environment files
  • help - files related to the project, tutorials, photoshop files, etc
  • setup - files necessary to setup the project inside various environments
  • logs - the logs

Optional directories

  • database - this is the parent location of your sqlite database, if case

Principles of this file layout

  • all project files are placed under the same parent
  • keep the project's files in a logical and easy to find structure
  • isolate the environment files so they don't mix with the project
  • easy to decide which directories are to be kept on GIT

Goodies included

  • YUI reset and fonts CSS is being used
  • a basic CSS file built with
  • the base template is using a grid layout based on YUI Grids

Setup the project with virtualenv and pip

  • $ cd /project_name
  • $ git clone .
  • $ virtualenv env --no-site-packages
  • $ source ./env/bin/activate
  • $ mkdir -p database
  • $ pip install -r ./setup/requirements/production.txt
  • $ pip install -r ./setup/requirements/development.txt

Setup the database

  • $ cd /project_name/
  • $ source ./env/bin/activate
  • $ python ./project/ syncdb --settings=settings.development --noinput
  • $ python ./project/ createsuperuser --settings=settings.development --username=admin
  • $ Password: admin

Start the lightweight development server included with Django

  • $ cd /project_name/
  • $ source ./env/bin/activate
  • $ python ./project/ runserver --settings=settings.development --nostatic
  • or the hard way:
  • $ export PYTHONPATH="./project:${PYTHONPATH}"; export PYTHONPATH="./project/apps:${PYTHONPATH}"; export DJANGO_SETTINGS_MODULE=settings.development; runserver --nostatic


You have probably noticed the long line needed to run the commands though the "". One solution is to create a bash function in .bash_aliases:

dj() { python ./project/ $@ --settings=settings.development; }


$ dj runserver --nostatic


A basic scaffold for Django projects






No releases published


No packages published