Django总是给404 [英] Django always gives 404
本文介绍了Django总是给404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的Django项目总是给我一个404,无论我试图访问什么页面。作为Django noob,我不知道如何解决这个问题。任何建议?
My Django project always gives me a 404, no matter what page I'm trying to visit. Being a Django noob, I have no idea how to troubleshoot this. Any suggestions?
编辑:这是我的 urls.py
:
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^mcifdjango/', include('mcifdjango.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# (r'^admin/', include(admin.site.urls)),
)
推荐答案
从urls映射到urls.py中的视图。有关详细信息:
You have to include a mapping from urls to views in your urls.py. For more information:
http://docs.djangoproject.com/en/dev/topics/http/urls/
这篇关于Django总是给404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文