‘Specifying a namespace in include() without providing an app_name ‘


‘Specifying a namespace in include() without providing an app_name ’

It can be seen from the include() function that this function has two parameters, an Arg and a namespace. I also have two parameters in the code, but I am prompted in the exception that app_name is not provided, and I need to pass in a binary tuple. From the sixth line of code urlconf_module, app_name = ARG, it can be seen that arg is that tuple, and it is assigned to app_name, so I We modify the code here as follows:

#Course institution URL configuration
    #url(r'^org/', include('organization.urls',namespace="org")),
    url(r'^org/', include(('organization.urls',"org"),namespace="org")),
    #Course related URL configuration
    #url(r'^coursess/', include('coursess.urls',namespace="coursess")),
    url(r'^coursess/', include(('coursess.urls','coursess'),namespace="coursess")),
    #User information related URL configuration
    url(r'^users/', include(('users.urls','users'),namespace="users")),

Explanation: the annotated version is Django 1.9. Django 2.1 can be solved by using the non annotated part

The following and the above non annotation parts are the correct way to write in Django 2.1:

url(r'^org/', include(('organization.urls',"org"),namespace="org")),