小编sha*_*lin的帖子

来自django 1.9中django.views.generic.simple import direct_to_template的等价物是什么

我想创建我的主页,index.html它位于名为as的模板目录中templates/castle_tm/index.html,但是url显示

"没有名为简单的模块".

基于通用的视图在django> 1.4中已弃用.现在,我如何将主页重定向到index.html

urls.py

from django.conf.urls import url, patterns, include
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from castle import views
from django.views.generic.simple import direct_to_template
admin.autodiscover()
url(r'^api/casinova$', direct_to_template,{"template":"castle_tm/index.html"}),
Run Code Online (Sandbox Code Playgroud)

python django

7
推荐指数
2
解决办法
4251
查看次数

标签 统计

django ×1

python ×1