Django: No module named 'app'

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.


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'),