[Answer]-Do not know how to implement this MVC pattern

1👍

Add the myapp prefix to the url regex:

url(r'^myapp/mymodule/',include('myapp.modules.mymodule.urls'))

Also note that urlpatters should be created by the patterns() function:

from django.conf.urls import patterns

urlpatterns = patterns('',
    ...
)

UPDATE: Sorry, I didn’t notice that first urls.py is from the app. I confused it with the project urls.py. So as I understand now you should have three urls.py:

project/urls.py

urlpatterns = patterns('',
    url(r'^myapp/',include('myapp.urls')),
)

myapp/urls.py

urlpatterns = patterns('',
    url(r'^mymodule/',include('myapp.modules.mymodule.urls')),
)

myapp/modules/mymodule/urls.py

urlpatterns = patterns('',
    url(r'dosomething/', handlers.dosomething),
)

Leave a comment