profile for joel goldstick at Stack Overflow, Q&A for professional and enthusiast programmers

Starting a Django Project

Categories: Djangopythondeployment

Published on April 3, 2016

Last Modified on April 5, 2016

  1. Install virtualenv and virtualenvwrapper
  2. create a directory for the project. This will be a subdirectory of venvs that was created when you installed virtualenvwrapper. 2 Make a virtual environment with mkproject
  3. Enter the environment with workon
  4. Install django using pip -- install django. Since you are in the virtual environment, you don't need sudo. Django will be installed in your account filetree -- not the root restricted folders.
  5. run django-admin startproject
  6. create environment variables for sensitive information like username, password, secret key. Put this in the bin/activate file for the virtual environment. In the .virtualenvs//local/bin/postactivate put code to export names you wish not to keep in your See below

  7. add to the directory where is

  8. import get_env_variables to and use it to populate sensitive variables
  9. install git
  10. set up .gitignore
  11. put project in git repository
  12. push it to github
  13. go to work

your postactivate file:

# This hook is sourced after this virtualenv is activated.

The secret key can be obtained here