官术网_书友最值得收藏!

Activating your application

In order for Django to keep track of our application and be able to create database tables for its models, we have to activate it. To do this, edit the settings.py file and add blog.apps.BlogConfig to the INSTALLED_APPS setting. It should look like this:

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog.apps.BlogConfig',
]

The BlogConfig class is your application configuration. Now Django knows that our application is active for this project and will be able to load its models.

主站蜘蛛池模板: 永定县| 明星| 蓬安县| 湖南省| 晋宁县| 铁岭市| 青河县| 霍邱县| 临颍县| 福清市| 勐海县| 东阿县| 惠州市| 尚义县| 翁牛特旗| 安阳市| 鹤山市| 墨江| 蕉岭县| 荣成市| 隆尧县| 襄樊市| 新源县| 成安县| 噶尔县| 亳州市| 扎囊县| 罗甸县| 永吉县| 栾城县| 乐亭县| 金门县| 长治市| 佛教| 行唐县| 漯河市| 台中县| 松滋市| 永寿县| 西藏| 博湖县|