gpt4 book ai didi

python - Appfog Django 管理 css 丢失

转载 作者:太空宇宙 更新时间:2023-11-04 10:51:25 26 4
gpt4 key购买 nike

我正在使用 http://appfog.com我有 DEBUG = True 和 ADMIN_MEDIA_PREFIX = '/static/admin/'管理员的 css 丢失。

最佳答案

Django 仅在 DEBUG=True 并且它正在运行开发服务器时提供静态文件。

Documentation :

This view is automatically enabled and will serve your static files at STATIC_URL when you use the built-in runserver management command [...] To enable this view if you are using some other server for local development, you'll add a couple of lines to your URLconf. The first line goes at the top of the file, and the last line at the bottom.

例子:

from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# ... the rest of your URLconf goes here ...
urlpatterns += staticfiles_urlpatterns()

希望对你有帮助

关于python - Appfog Django 管理 css 丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13600005/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com