django初识

django1.9.8 安装MySQLdb

	命令:
	pip install mysql-python / pip3.6 install mysqlclient

生成默认数据表

	makemigrations
	migrate

配置默认视图文件夹

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')] , #设置视图文件夹
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
        ],
    },
},]

设置样式表根路径

	STATIC_URL = '/static/'
	STATICFILES_DIRS = [
	    os.path.join(BASE_DIR,'static')
	]

标题项目配置流程

	![在这里插入图片描述](https://img-blog.csdnimg.cn/20190111155359656.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzIzMDY5MDM5,size_16,color_FFFFFF,t_70)

你可能感兴趣的:(django)