【发布时间】:2021-06-20 07:10:07
【问题描述】:
通过使用来自digitalcloud tutorial 的不带 nginx 的 gunicorn 我的服务器正在运行,并且在控制台上是
not found: /static/style.css
settings.py
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
我已经试过了
-
收集静态
-
在 urls.py 文件中做
urlpatterns += staticfiles_urlpatterns() -
makemigrations + 迁移
【问题讨论】:
-
如果 DEBUG=False Django 不提供静态文件。
标签: django gunicorn django-staticfiles