gunicorn.errors.HaltServer: django

前端 未结 6 825
盖世英雄少女心
盖世英雄少女心 2020-12-05 01:18

I have a django app and trying to set it up with gunicorn first and later with supervisor and nginx.

The app is running with the normal django command perfectly like

6条回答
  •  北海茫月
    2020-12-05 02:00

    I also had a similar error in Ubuntu 16.04, Django 1.11, using systemd.

    My problem was that I had split my settings out into separate files; ie: instead of having all settings in project/settings.py, I have a few settings files like project/settings/dev.py.

    I had to update DJANGO_SETTINGS_MODULE in the project/wsgi.py file from:

    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")  
    

    to

    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.dev")
    

    then gunicorn worked.

提交回复
热议问题