Django admin static files errors All In One

Django admin static files errors All In One

404 errors

http://127.0.0.1:8000/admin/

image

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

image

image

https://docs.djangoproject.com/en/1.10/ref/contrib/staticfiles/#static-file-development-view

demos

$ python manage.py runserver

# admin
# 123456
# [email protected]

image

http://127.0.0.1:8000/admin/login/?next=/admin/

Web frameworks
Django

Programming languages
Python

JavaScript libraries

XRegExp
jQuery

image

(🐞 反爬蟲測試!打擊盜版⚠️)如果你看到這個信息, 說明這是一篇剽竊的文章,請訪問 https://www.cnblogs.com/xgqfrms/ 查看原創文章!

refs

https://stackoverflow.com/questions/42457770/django-admin-static-files-404



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 發佈文章使用:只允許註冊用戶纔可以訪問!

原創文章,版權所有©️xgqfrms, 禁止轉載 🈲️,侵權必究⚠️!


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章