Skip to content

Instantly share code, notes, and snippets.

@arnab
Last active December 19, 2015 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnab/5997688 to your computer and use it in GitHub Desktop.
Save arnab/5997688 to your computer and use it in GitHub Desktop.
Start up steps for django project

virtualenv and django:

PROJECT_NAME=<project_name>
mkvirtualenv $PROJECT_NAME
workon $PROJECT_NAME
pip install django
  • Verify you are using django from the virtual-env: which django-admin.py

create the project

django-admin.py startproject $PROJECT_NAME
cd $PROJECT_NAME
git init

cat > .gitignore
*.pyc
*.log
CTRL+D

git add .
git commit -m 'initial django created repo'
  • If you are using oh-my-zsh's virtualenvwrapper plugin the virtualenv will be activated automatically when you cd into this directory now on.

start creating the app

python manage.py runserver
git add .
git commit -m 'runserver created defaults'

DB setup (postgres example):

CREATE USER <username> WITH CREATEDB NOCREATEUSER ENCRYPTED PASSWORD '<pwd>';
CREATE DATABASE django_tutorial;
  • Then fill in the db/user/pass in settings.py
pip install -r requirements.txt
python manage.py syncdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment