設置DATABASE的ENGINE and NAME, 在這我用sqlite
such as:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'mysite.sqlite', # 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. } }
Step 2: 同步資料庫
python manage.py syncdb
syncdb會根據setting.py裡INSTALLED_APPS的內容來建立需要的資料庫
你可以透過SQLite Manager來查看建立了哪些資料表
http://code.google.com/p/sqlite-manager/