【发布时间】:2019-02-12 19:31:27
【问题描述】:
我默认安装了 Mezzanine CMS,我会尝试使用 gunicorn 服务
-- 使用python manage.py runserver,仅在DEBUG = True
日志说:
... (DEBUG=False)
[07/Sep/2018 12:23:56] "GET /static/css/bootstrap.css HTTP/1.1" 301 0
[07/Sep/2018 12:23:57] "GET /static/css/bootstrap.css/ HTTP/1.1" 404 6165
...
-- 使用gunicorn helloworld.wsgi --bind 127.0.0.1:8000,找不到静态!
日志说:
$ gunicorn helloworld.wsgi --bind 127.0.0.1:8000
[2018-09-07 14:03:56 +0200] [15999] [INFO] Starting gunicorn 19.9.0
[2018-09-07 14:03:56 +0200] [15999] [INFO] Listening at: http://127.0.0.1:8000 (15999)
[2018-09-07 14:03:56 +0200] [15999] [INFO] Using worker: sync
[2018-09-07 14:03:56 +0200] [16017] [INFO] Booting worker with pid: 16017
Not Found: /static/css/bootstrap.css/
Not Found: /static/css/mezzanine.css/
Not Found: /static/css/bootstrap-theme.css/
Not Found: /static/mezzanine/js/jquery-1.8.3.min.js/
Not Found: /static/js/bootstrap.js/
Not Found: /static/js/bootstrap-extras.js/
请查看想要的 url:gunicorn 或 mezzanine(或其他?)在 url 末尾添加 / 字符。
我也做了这个命令python manage.py collectstatic没有效果:(
STATIC_ROOT 是正确的,我申请了https://docs.djangoproject.com/en/1.10/howto/static-files/#serving-static-files-during-development
您有提示或解决方案吗?恐怕我没有正确搜索!
谢谢 陌陌
【问题讨论】:
标签: django python-3.x gunicorn django-staticfiles mezzanine