Django Shell No module named settings

后端 未结 12 1374
温柔的废话
温柔的废话 2020-12-02 20:26

I\'ve deployed Django to Apache via mod_wsgi. Django is running fine when hosted from Apache. However, I\'m trying to do some maintenance via manage.py

12条回答
  •  Happy的楠姐
    2020-12-02 21:21

    Though Simon Whitaker's answer (that a same-name dir is confusing things) is certainly on point, rather than suggesting you change your entire extant dir structure, might I suggest:

    Instead of using the "malfunctioning" / ambiguous...

    import settings
    

    ...use the more specific...

    from django.conf import settings
    

提交回复
热议问题