This is an old revision of the document!


as root:

  easy_install pip
  pip install virtualenv

As normal user:

$  virtualenv projectname
$  cd projectname
$  source bin/activate
(projectname):$ pip freeze
(projectname):$ pip install django==1.6.7
(projectname):$ django-admin.py startproject djlogin

Just a bunch of code i will probably not remeber

  python manage.py runserver
  pip install south django-registration stripe
  python manage.py syncdb
  python manage.py startapp users

South

  • great tool for migrating & altering DB

To start using south…

  1. Make sure your django tables match your current database tables exactly - if you planned to add or remove columns, comment those out.
  2. Run python manage.py schemamigration myapp –initial
  3. Run python manage.py migrate myapp –fake
  4. Make changes to your django model
  5. Run python manage.py schemamigration myapp –auto
  6. Run python manage.py migrate myapp

Best editor for django/python development

Vim python autocomplete

Python source code encodings

It is recommended to use UTF-8 file encoding.

# -*- coding: UTF-8 -*-

Place it on the beginning of the source file.

 
python/django.1418034192.txt.gz · Last modified: 2014/12/08 11:23 by tomsa