DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '/home/jove/mydb.md', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } }
1 2 3 4
r'C:\py\mydb.md'
1 2 3
python2 manage.py startapp myblog
构建数据库
修改myblog/modesl.py加入如下内容,
1 2 3 4 5 6 7 8 9 10 11 12 13 14
from django.db import models from django.contrib import admin
from myblog.views import archive urlpatterns = patterns('', url(r'^$', archive), #......
```django自带开发服务器,方便了很多,只需要运行
```bash python2 manage.py runserver
0 errors found Django version 1.4.2, using settings ‘mysite.settings’ Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C.