Django: No module named 'app'

前端 未结 2 2067
感情败类
感情败类 2021-01-02 14:20

Django barfs with

ImportError at /store/
No module named store

But right there is the debug message there is the setting

IN         


        
相关标签:
2条回答
  • 2021-01-02 14:36

    If it were not for version control, I would have never found this. As it was, it took me almost an hour to track it down.

    The mistake was in store/urls.py:

    urlpatterns = patterns('store.views',
        url(r'^$', 'main'),
        url(r'^new_delivery_user/$', 'new_delivery_user'),
        ...
        url(r'^event_signal/$', 'store.views.event_signal'), # problem
    )
    

    I had moved the last URL from the project url.py to this app-specific one, which used the shorthand 'store.views' for prepending each of the views.

    It should have appeared:

        url(r'^event_signal/$', 'event_signal'),
    
    0 讨论(0)
  • 2021-01-02 14:54

    thanks to Paul Draper, after I changed the

    re_path('api/(?P<version>(v1|v2))/', include('music.urls'))
    

    into :

        re_path('api/(?P<version>(v1|v2))/', include('musicservices.music.urls'))
    

    the problem resolved.

    0 讨论(0)
提交回复
热议问题