Skip to content

Instantly share code, notes, and snippets.

@morenoh149
Created June 20, 2018 19:46
Show Gist options
  • Save morenoh149/39be1ace1f99b9571fd2b6b96098075d to your computer and use it in GitHub Desktop.
Save morenoh149/39be1ace1f99b9571fd2b6b96098075d to your computer and use it in GitHub Desktop.
django admin unreachable
GET http://localhost:8000/admin
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/admin
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^ ^$ [name='index']
^admin/
^static\/(?P<path>.*)$
The current path, admin, didn't match any of these.
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
url(r'^', include('polls.urls')),
url(r'^admin/', admin.site.urls)
]
# Only serve static files from Django during development
# Use Google Cloud Storage or an alternative CDN for production
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment