Django admin static files errors All In One
404 errors
http://127.0.0.1:8000/admin/
solution
# SECURITY WARNING: don't run with debug turned on in production!
# DEBUG = True
# 404 error ✅ http://127.0.0.1:8000/
# ❌ CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False.
DEBUG = False
# ALLOWED_HOSTS = []
ALLOWED_HOSTS = [
'127.0.0.1',
]
DEBUG ✅
DEBUG = True
https://docs.djangoproject.com/en/1.10/ref/contrib/staticfiles/#static-file-development-view
demos
$ python manage.py runserver
# admin
# 123456
# admin@django.com
http://127.0.0.1:8000/admin/login/?next=/admin/
(🐞 反爬蟲測試!打擊盜版⚠️)如果你看到這個資訊, 說明這是一篇剽竊的文章,請訪問 https://www.cnblogs.com/xgqfrms/ 檢視原創文章!
refs
https://stackoverflow.com/questions/42457770/django-admin-static-files-404
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 釋出文章使用:只允許註冊使用者才可以訪問!
原創文章,版權所有©️xgqfrms, 禁止轉載 🈲️,侵權必究⚠️!