How to do reverse URL search in Django namespaced reusable application

后端 未结 3 1322
不思量自难忘°
不思量自难忘° 2021-01-31 17:37

Consider that I include namespaced reusable application:

urlpatterns = patterns(\'\',
    # ella urls
    url(\'^ella/\', include(\'ella.core.urls\', namespace=\         


        
3条回答
  •  悲&欢浪女
    2021-01-31 18:20

    URL Namespaces can be specified in two ways.

    Firstly, you can provide the application and instance namespace as arguments to include() when you construct your URL patterns. For example,:

    (r'^help/', include('apps.help.urls', namespace='foo', app_name='bar')),

    This is right from http://docs.djangoproject.com/en/dev/topics/http/urls/#defining-url-namespaces.

    Try changing include('ella.core.urls', namespace="ella") to include('ella.core.urls', namespace="ella", app_name="ella"). I'm not 100% this will work, but its worth a shot.

提交回复
热议问题