1

I am working on my first Django website and am having a problem. Whenever I attempt to go on the admin page www.example.com/admin I encounter a 404 page. When I attempt to go on the admin site on my computer using python manage.py runserver it works. What info do you guys need to help me to fix my problem?

url.py

from django.conf.urls import patterns, include, url`
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.http import HttpResponseRedirect
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    ....

```

Josh Scholl
  • 143
  • 15
Zacharoo
  • 113
  • 1
  • 10

2 Answers2

0

You must include the Django admin in your INSTALLED_APPS in the settings file (it's probably already there, but commented out).

You will also need to configure the URLs for the admin site, which should be in your site-wide urls.py, again, probably commented out but there.

If you have already done both of these things, please share your urls.py from the project itself.

Joseph
  • 12,678
  • 19
  • 76
  • 115
-1

python manage.py runserver enables your application to run locally. You need to deploy your application using WSGI and Apache to access your page from other remove machines.

Refer to the configuration details https://docs.djangoproject.com/en/1.2/howto/deployment/modwsgi/

pass-by-ref
  • 1,288
  • 2
  • 12
  • 20
  • Asker mentioned he or she is able to access other URLs on his or her project without issue, it is limited to Django admin that is un-reachable. Hence, this issue is not related to the developer runserver. Additionally, your answer is incorrect in that runserver is not limited to local access, it only defaults to a local address, and so long as you provide it a public address, it is reachable remotely. – Joseph Oct 12 '13 at 18:05