AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'

佐手、 提交于 2019-12-01 15:36:45

Otherwise on the Internet I found this:

The issue is caused by an import ordering problem, in your example code you call urlresolvers.reverse which will load example/urls.py, which will trigger an admin.autodiscover() call, which will load social/apps/django_app/default/admin.py, which will try to load your custom user model which will fail to load your user model.

I hit the problem when I called a function directly from views.py, and this function resulted in use of resolve, which probably lead to an import problem since calling a function directly from views.py is bad style. However, the comment above helped med debug the issue.

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