标签:
建立项目
django-admin.py startproject mysite
运行项目
python manage.py runserver
python manage.py startapp addr_book
修改settings.py
# settings.py # INSTALLED_APPS = ( ‘django.contrib.auth‘, ‘django.contrib.contenttypes‘, ‘django.contrib.sessions‘, ‘django.contrib.sites‘, ‘addr_book‘, )
修改urls.py,注意$
from django.conf.urls.defaults import * urlpatterns = patterns(‘‘, (r‘^hello/$‘, addr_book.views.hello), )
设置模板地址,settings.py
TEMPLATE_DIRS = ( ‘./addr_book/‘, )
检查语法与逻辑错误
python manage.py validate
初始化数据库
python manage.py syncdb
标签:
原文地址:http://www.cnblogs.com/addf/p/4985377.html