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

前端 未结 15 1993
渐次进展
渐次进展 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:49

    Possible problem:

    you forgot the __init__.py file, which must be in your project and in all directories which you consider a python module for import.

    Other thing you could try is to add the path directly into the manage.py file, like :

    import sys
    
    ...
    ...
    
    sys.path.insert(0, '/home/django/mofin/trunk')
    

    I hope it helps

提交回复
热议问题