How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi?

前端 未结 15 1988
渐次进展
渐次进展 2020-12-04 11:15

I can\'t get wsgi to import my settings file for my project \'mofin\'.

The list of errors from the apache error log are as follows

mod_wsgi (pid=4001         


        
15条回答
  •  醉酒成梦
    2020-12-04 11:37

    In my case, I had a circular import that was causing this error. From settings.py I was importing one function in another module, and from that module I was importing a settings variable. To fix it, instead of directly importing from settings, I did this:

    from django.conf import settings
    

提交回复
热议问题