找不到Django管理页面 [英] Django admin page not found
问题描述
基本上,我一直在学习本教程,但是在使管理页面正常工作时我陷入了困境。
我得到的错误是:在此服务器上找不到请求的URL / admin /。
因此,我浏览了很多论坛,并讨论了很多stackoverflow问题,但是由于我是一个完全菜鸟,所以我不了解其中一半,而另一半的解决方案也无法解决我的问题。
这是我的settings.py的样子:
basically I've been following the tutorial but I am stuck when it comes to getting the admin page to work. The error I get is: The requested URL /admin/ was not found on this server. So I looked at lots of forums and quite a few stackoverflow question but since I am a complete noob i don't understand half of them and the other half's solution don't solve my problem. This is what my settings.py looks like:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'polls'
)
这是我的urls.py的样子:
This is what my urls.py looks like:
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'BoE.views.home', name='home'),
# url(r'^BoE/', include('BoE.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
任何帮助将不胜感激。
Any help will be much appreciated. Thanks in advance!
推荐答案
当您访问http:// 127 0 0时,您是否获得了欢迎使用Django页面? 1:8000? (带点)
Did you get the "Welcome to Django" page when you when to http:// 127 0 0 1:8000? (with dots)
您要转到http:// 127 0 0 1:8000 / admin /吗?
Are you going to http:// 127 0 0 1:8000/admin/ ?
教程第一部分中的所有内容都起作用了吗?您在数据库中看到项目了吗?
Did everything from tutorial part one work? Did you see the items in the database?
在以下注释中,我们认为问题不在于Django,因为他的代码与我完全相同曾经(和我的工作)。他必须去wiki.bitnami.org/Components/Django并按照那里的说明进行操作
In the below comments, we figured that the problem was not with Django, as he had the exact same code that I had (and mine worked). He had to go to wiki.bitnami.org/Components/Django and follow the instructions there
这篇关于找不到Django管理页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!