I am currently trying to get started with Django. But the book am using is using Django version <1.9 while the current version is >2.0
The problem am facing right now is this code:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'', include('learning_logs.urls', namespace = learning_logs'))
]
I have looked around and this is what I have written
from django.contrib import admin
from django.urls import include, path
app_name = 'learning_logs'
urlpatterns = [
path('admin/', admin.site.urls),
path('learning_logs/', include('learning_logs.urls', namespace = 'learning_logs')),
]
but when I run the server I get the error:
raise ImproperlyConfigured( 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.
Any help with this. Thanks in advance