Reputation: 267
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 newbie so I don't understand half of them and the other half's solution doesn'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'
)
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)),
)
Upvotes: 8
Views: 12515
Reputation: 17024
Did you get the "Welcome to Django" page when you when to http:// 127 0 0 1:8000? (with dots)
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?
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
Upvotes: 6
Reputation: 239250
I'm going to go ahead and take a stab, because this is the only thing I can think of that could still be the issue.
If you run just python manage.py runserver
the dev server binds to 127.0.0.1:8000. However, unless you're running in a browser that is literally on the machine, or otherwise accessing it through the machine directly (X Window, VNC, tunnel, etc), you can't access this remotely.
If you want to access the dev server at the actual IP address, you need to tell it to bind to the primary interface:
python manage.py runserver 0.0.0.0:8000
Then, you'll be able to access your the site in your local browser with http://<ip>:8000/admin/
Upvotes: 1