Django App Improperly Configured - The app module has multiple filesystem locations

眉间皱痕 提交于 2019-12-03 23:50:50

The problem was that I deleted a __init__.py file. Apparently, django uses them to know which folders are apps, so they are kind of important.

The error is in your ledger app. Is this a custom app?

From the Django source code, the error comes from _path_from_module(app_module)

    # Filesystem path to the application directory eg.
    # u'/usr/lib/python2.7/dist-packages/django/contrib/admin'. Unicode on
    # Python 2 and a str on Python 3.
    if not hasattr(self, 'path'):
        self.path = self._path_from_module(app_module)

As a quick fix, if this is your app, you can configure it with an AppConfig subclass that has a valid path attribute, which will stop the bug from executing. I'm looking into it further now.

If ledger is not your app, and you've updated it through pip or some other means, this explains why checking out an older version does not fix the problem. Try getting an older version of that app from its repository (if applicable) and submit a bug report.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!