xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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
# admin@django.com

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, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2024-04-25 15:37  xgqfrms  阅读(8)  评论(0编辑  收藏  举报