标签:发送 server path 目录 start sed auth star span
1,创建django项目
django-admin startproject 项目名称,
2,进入项目目录
cd 项目名称
3,启动socket服务端,等待用户发送请求
python manage.py runserver ip:por
csrf注释
配置template路径
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‘), ]
配置数据库
DATABASES = { ‘default‘: { ‘ENGINE‘: ‘django.db.backends.mysql‘, ‘NAME‘: ‘sms‘, ‘USER‘:‘root‘, ‘PASSWORD‘:‘2016191047‘, ‘HOST‘:‘127.0.0.1‘, ‘PORT‘:3306 } }
标签:发送 server path 目录 start sed auth star span
原文地址:https://www.cnblogs.com/liuhongshuai/p/9571713.html