Skip to content

Instantly share code, notes, and snippets.

@arnab arnab/django_kickstart.md
Last active Dec 19, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.