This template is my own personal (evolving) preference. You may do wahtever you wish with it (see the license) without mentioning that I even exist.
included django modules (see requirements.txt):
- south
- werkzeurg
- django-compressor
- django-appconf
- django-devserver
- guppy
- sqlparse
- wsgiref
- six
-
Install python 2.7X. NB: install
python-devel
if you're using a package manager such as apt-get. The following command should print a path (if this command raises an exception, make sure that you have thepython-devel
version installed): -
python -c 'from distutils.sysconfig import get_makefile_filename as m; print m()'
-
Install gcc (OSX users: installing the OSX developer tools is probably the easiest way to do this). The following command should not throw an error:
gcc -v
-
Install pip; here are pip's installation instructions. The following command should not throw an error:
pip -V
-
install virtualenv
pip install virtualenv
(you may need to instead runsudo pip install virtualenv
) -
create a top-level (container) project directory in a desired location, e.g.
mkdir -p ~/MyProjects/<project container name>
-
go to the top-level directory
cd ~/MyProjects/<project container name>
-
initialize a virtual environment in this directory
virtualenv --no-site-packages .
-
activate your virtual environment
source bin/activate
-
install django
pip install django>=1.6
-
rerun your virtual env script
source bin/activate
-
from within the container directory run # TODO why isn't this chaning the dir names?
django-admin.py startproject --template=https://github.com/cjrd/django-template/archive/master.zip <project name>
-
go into the project directory
cd <project name>
-
install the dependencies
pip install -r requirements.txt
-
copy the local settings file
cd <project name>/<project name>; cp settings_local_template.py settings_local.py; cd ..
-
add the project directory to your virtualenv PYTHONPATH
echo "PYTHONPATH=.:$PWD:$PYTHONPATH" >> ../../bin/activate
-
reset your environment
source ../../bin/activate
-
sync the databse
python manage.py syncdb
-
run the server
python manage.py runserver
-
navigate to test page http://127.0.0.1:8000