简体   繁体   中英

Django superuser admin

I can't load the admin login screen.

have opened a Web browser and went to “/admin/” on local domain http://127.0.0.1:8000/admin/ was supposed to open admin login window.

First, check if your Django server is running.You can do that, by typing python manage.py runserver in the terminal and then visiting http://127.0.0.1:8000/admin/ in your browser.

Second, check if the Django admin is enabled. Open settings.py in your project folder and check if INSTALLED_APPS list has the django.contrib.admin element.

Third, check if you have an admin.py file in your app directory. The code should looks something like this:

from django.contrib import admin

from .models import MyModel

admin.site.register(MyModel)

Fourth, Check for your login credentials in your Django settings. Go to your project's settings.py file and you have to have this code:

LOGIN_URL = '/admin/login/'

LOGIN_REDIRECT_URL = '/admin/'

And the last option is to try clearing your browser cache and cookies and restarting the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM