Reputation: 79
I've been trying to get Django working completely but I'm having issues with my admin page. It is only a blank view; no login, no title, no error... After setting up, I have run:
python manage.py makemigrations
python manage.py migrate
Here is settings.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'books.apps.BooksConfig',
]
Here is urls.py:
from django.conf.urls import url, include
from django.contrib import admin
admin.autodiscover()
from books.views import hello, my_homepage_view, current_datetime, hours_ahead
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^hello/$', hello),
# url(r'^$', my_homepage_view),
url(r'^time/$', current_datetime),
url(r'^time/plus/(\d{1,2})/$', hours_ahead)
]
Like I said, there is not a 404 or any type of error page when localhost:8000/admin/ is accessed, it is just a blank, white page.
Any help would be appreciated!
Upvotes: 2
Views: 2930
Reputation: 326
So dumb, it's been a long night. I found my solution here. What worked for me was adding the trailing slash after the endpoint.
localhost:8000/admin/
instead of localhost:8000/admin
Upvotes: 0
Reputation: 79
The answer was commented by a few people in the comments above.
My problem was solved by running:
python manage.py collectstatic
Thank you all for your help!
Upvotes: 1