Why would django fail with server 500 only when Debug=False AND db is set to production database on Heroku?

前端 未结 6 904
情歌与酒
情歌与酒 2020-12-11 18:28

When we run $ python manage.py runserver --settings=project.settings.local there are 4 different possible combinations:

  1. Debug=True && DB=l
6条回答
  •  借酒劲吻你
    2020-12-11 19:19

    Configuring the server e-mail and seeing the stack trace as mentioned by Two-Bit Alchemist was the key. We added these lines to our settings:

    EMAIL_HOST = 'smtp.gmail.com'
    EMAIL_HOST_USER = '***'
    EMAIL_HOST_PASSWORD = '***'
    EMAIL_PORT = 587
    EMAIL_USE_TLS = True
    SERVER_EMAIL = EMAIL_HOST_USER
    

    And received an e-mail with this error in the stack trace:

    ValueError: The file 'stylesheets/application.css' could not be found with .
    

    We'd had problems with static files before but though we'd fixed them. The css file it's complaining about not being able to find doesn't exist anymore and isn't referenced anywhere so I'm not sure why this error is even coming up, but we fixed it by adding an empty application.css file.

提交回复
热议问题