- install python 2.7.* or python 3.*
- go to djangoproject.org and download the latest version, setup, and install or use python pip to install it (also on django's download page)
- install docutils, pygments, and recaptcha-client (pip install pygments && pip install docutils && pip install recaptcha-client)
- install your favorite database software (I use PostgreSQL)
- setup the settings.py file for your specific installation
- Create the file ~/.django_secret and generate a new django secret (you can use this site for a new secret)
- Create the file ~/.django_db and setup your db settings. the following are available:
- user=<username> passwd=<password> host=<hostname of database server - optional> port=<port of database server - optional>
- Run
./manage.py syncdb
to initialize the database with the needed tables
- sudo apt-get install python python-pygments python-docutils python-recaptcha-client
- go to djangoproject.org and download the latest version, setup, and install or use python pip to install it (also on django's download page)
- follow steps 4 to 8 above
Choose your favorite web server and research how to install and run django under it. If you use fastcgi you will need python's flup library (sudo apt-get install python-flup on debian systems)
If you are using Django admin and nginx (like I am), you will need to use the following config as well as find your admin static pages in the python dist-packages directory somewhere on your server.
You can find the exact file path for this with the following command:
python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__[0]+\"/contrib/admin/static/admin/\")"
replace the location /static/admin
alias with the output from the command above.
server { listen 80; root /var/www/; location /static/admin { # Replace the below alias with the output from the command above alias /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin/; } location /static { alias /var/www/StackSmash/StackSmash/static/; } location / { include fastcgi_params; fastcgi_split_path_info ^()(.*)$; fastcgi_pass 127.0.0.1:3000; } }