This is a turbia project template, for use with the startproject management command. Create a new skeleton project like this:
Create a
$PROJECT
variable, so we can copy and paste the following commands:$ export PROJECT=PROJECTNAME
Create skeleton project:
$ cd ~/projects $ django-admin.py startproject -e bat,default,local,staging,production,ini,py,rst -n Makefile \ --template https://github.com/thirstydigital/turbia-project-template/archive/master.zip $PROJECT
Update the
README.rst
file. Remove theHow to Use
section and update theOverview
section:$ cd $PROJECT $ vi README.rst
Make
manage.py
executable:$ chmod 755 manage.py
Create a private repository on BitBucket. Use their website, or SourceTree.
Initialize the project as Git repository and push an initial commit:
$ git init $ git add -A $ git commit -m 'Initial commit.' $ git remote add origin git@bitbucket.org:thirstydigital/$PROJECT.git $ git push
Description of project.
You will need Git, Python 2.6.5+ or 3.2+, pip
, virtualenv
and
virtualenvwrapper
to install this project and its dependencies.
Clone project in your projects
folder:
$ cd ~/projects $ git clone git@bitbucket.org:thirstydigital/{{ project_name }}.git
Create virtualenv
and install dependencies:
$ cd {{ project_name }} $ mkvirtualenv --distribute --no-site-packages -a "$PWD" -r requirements.txt {{ project_name }}
If you are going to use PostgreSQL, install psycopg2
:
$ pip install psycopg2
If you are going to use the interactive shell, install ipython
:
$ pip install ipython
If you are going to use the python debugger, install ipdb
:
$ pip install ipdb
Configure settings for the local environment:
$ cp {{ project_name }}/settings.py.default {{ project_name }}/settings.py $ vi {{ project_name }}/settings.py
Sync database and populate with initial data:
$ ./manage.py syncdb --migrate $ ./manage.py turbia_initial_data
Update static files and flush cached static pages:
$ ./manage.py collectstatic $ ./manage.py pages_flush
Activate virtualenv
and change to project directory:
$ workon {{ project_name }}
Run development server:
$ ./manage.py runserver
Run interactive shell:
$ ./manage.py shell
Deactivate virtualenv
:
$ deactivate