标签:files 目录 admin settings future def pyc 文件 技术分享
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‘,
],
},
},
]
DATABASES = {
‘default‘: {
‘ENGINE‘: ‘django.db.backends.mysql‘,
‘NAME‘: "testdjango",
‘USER‘: "root",
"PASSWORD": "XXXXXX",
"HOST": "127.0.0.1"
}
}
STATIC_URL = ‘/static/‘
STATICFILES_DIRS = [
os.path.join(BASE_DIR,"static")
]
因为我生成过一次了,这次就不再生成
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
# Create your views here.
def getform(request):
return render(request,‘message_form.html‘)
from django.conf.urls import url
from django.contrib import admin
from message.views import getform
urlpatterns = [
url(r‘^admin/‘, admin.site.urls),
url(r‘^form/$‘,getform)
]
提示成功
可以显示html内容了
标签:files 目录 admin settings future def pyc 文件 技术分享
原文地址:https://www.cnblogs.com/Mysterious/p/10166555.html