Vanilla Django Project Files
Python JavaScript CSS
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



  1. Install python 2.7, setuptools and virtualenvwrapper

    $ sudo apt-get install python2.7 python-dev python-setuptools virtualenvwrapper
  2. Install postgreSQL

    $ sudo apt-get install postgresql-server-dev-9.1
  3. Create database user

    $ sudo su - postgres                 # Switch to user postgres
    $ createuser -s -E -P <my_db_user>   # Create database user named 'my_db_user' (superuser, encrypted password, password prompt)
  4. Allow user to connect and restart postgresql

    • Edit /etc/postgresql/9.1/main/pg_hba.conf

    • Add the following line (so your user is allowed to connect from localhost) to /etc/postgresql/9.1/main/pg_hba.conf IMPORTANT: Do not blindly copy these lines at the end of the file. Rather copy it into the appropriate section saying: # Put your actual configuration here

          local my_db_user my_db_user password

      … or on your development machine

          local   all         all         trust
          host    all         all          trust

      Restart postgres: /etc/init.d/postgresql restart and logout user 'postgres': logout

  5. Install PIL dependencies

    $ sudo apt-get install libjpeg8 libjpeg8-dev libfreetype6 libfreetype6-dev zlib1g-dev

    Ubuntu has it's libraries where PIL does not find it, so you will have to make some link to them so PIL can be installed:

    $ sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib
    $ sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib
    $ sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib

    (see also

Fork from skeleton project

  1. Make, enter and activate a virtualenv:

    $ mkvirtualenv <my_project> -p python2.7
    New python executable in <my_project>/bin/python
    Installing setuptools............done.
    $ workon <my_project>
  2. Clone this repo into a sub-directory of the new virtualenv:

    $ git clone 'git://' <project_folder>
    $ cd <project_folder>/
    $ git mv <my_project> <custom_project_name>
    # Remove .empty files, used to make Hg track otherwise-empty dirs.
    $ find . -name '.empty' -exec rm {} \;
    # edit or clear .gitignore
    $ vi .gitignore
    $ echo > .gitignore
  3. Remove the pointer to the GitHub project:

    $ git config --unset remote.origin.url

    Later you’ll probably want to re-add this configuration with a pointer to your upstream repo. You can do that with the following command:

    $ git config remote.origin.url ''
  4. Install base requirements

    $ easy_install pip
    $ pip install -r requirements.txt
  5. Ensure current (working) version numbers are documented

    $ pip freeze > requirements.txt

    As you edit your requirements.txt file, you can run that install command again; pip install will realise which packages you’ve added and will ignore those already installed.

  6. Delete this subsection of the file

  7. Commit changes to new repository

    $ git commit -a


  1. Make, enter and activate a virtualenv:

    $ mkvirtualenv <my_project> -p python2.7
    New python executable in <my_project>/bin/python
    Installing setuptools............done.
    $ workon <my_project>
  2. Install requirements (pre-requirement: python-setuptools)

    $ easy_install pip
    $ pip install -r requirements.txt
  3. Copy to

  4. Go through the following files, editing as necessary:

      • Update SECRET_KEY (call ./ generate_secret_key)
  5. Create initial postgres-database

    $ createdb --owner <my_db_user> <my_database>

Initializing the local development environment

  1. Sync the database with the apps model

    $ fab reset


    $ ./ syncdb
  2. Run the test-suite

    $ ./ test
  3. Start the devserver

    $ ./ runserver