- [Show pagesource]
- [Old revisions]
- [[unknown link type]]
- []
This is an old revision of the document!
Table of Contents
Installation
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):$ pip install south django-registration stripe (projectname):$ django-admin.py startproject djlogin
Just a bunch of code i will probably not remeber
python manage.py runserver
python manage.py syncdb
python manage.py startapp users
Best editor for django/python development
South
- great tool for migrating & altering DB
To start using south…
- Make sure your django tables match your current database tables exactly - if you planned to add or remove columns, comment those out.
- Run python manage.py schemamigration myapp –initial name_of_migration
- Run python manage.py migrate myapp –fake
- Make changes to your django model
- Run python manage.py schemamigration myapp –auto
- Run python manage.py migrate myapp
Vim python autocomplete
- in debian following packages needed to be installed: vim-athena vim-nox
- also pathogen addon has to be installed: https://github.com/tpope/vim-pathogen
Python source code encodings
If UTF-8 source file encoding is needed …
# -*- coding: UTF-8 -*-
…put this on the beginning of the source file.
python/django.1418208174.txt.gz · Last modified: 2014/12/10 11:42 by vondra