0

I am new to the django framework. I currently started learning from an online video tutorial and I came across some errors. I have an app called groups which has two separate view files namely company and family. Due to that I have my groups/url file as this:

    from django.urls import path, include, re_path


    from . views import company
    from . views import family

    app_name = 'groups'

    company_patterns = [
        path('create/', company.Create.as_view(), name='create'),
        re_path(r'^edit/(?P<slug>\w+)/$', company.Update.as_view(), name='update'),
        path('<str:slug>/', company.Details.as_view(), name='detail'),
    ]

    family_patterns = [
        path('create/', family.Create.as_view(), name='create'),
        path('edit/<str:slug>/', family.Update.as_view(), name='update'),
        path('<str:slug>/', family.Details.as_view(), name='detail'),
]

    urlpatterns = [
        path('companies/', include(company_patterns, namespace='companies')),
        path('families/', include(family_patterns, namespace='families')),
    ]

But anytime I run the application from my dashboard template. I get this error:

'Specifying a namespace in include() without providing an app_name ' django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.

Please, can anyone assist me with further explanation and solution? thank you

1 Answer 1

1

define app_name in another urls.py file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.