runserver
コマンドラインから、またはgunicorn
コマンドラインから直接実行すると、Web サイトは正常に動作します。ただし、 Heroku のドキュメントで指定されているように Foreman を使用して gunicorn を実行しようとすると:
web: gunicorn myapp.wsgi
その後、私の Web サイトの静的ファイルに突然アクセスできなくなりました。に行こうとしている
http://0.0.0.0:5000/static/js/jquery-1.9.1.min.js
このエラーメッセージのみが表示されます:
Using the URLconf defined in myapp.urls, Django tried these URL patterns, in this order:
^$ [name='homepage']
...
The current URL, static/js/jquery-1.9.1.min.js, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
私が言ったように、gunicorn または runserver を直接呼び出す場合、または を使用runserver
する場合でも、静的ファイルには確実にアクセスできるforeman start
ので、静的ファイルの設定とはあまり関係がないと思いますか?
また、 foreman で gunicorn を実行してDEBUG = False
も、500 エラー以外は何も返されません。Sentry にも何も記録されていないため、何が問題なのかわかりません。また、gunicorn や runserver を単独で使用したり、runserver を foreman と併用したりしても問題なく動作します。
この問題を解決するために私ができることはありますか?