python - error in parameters

Asked

Viewed 51 times

0

I did the initial procedure I saw in a forum, give name to the app, but did not solve, returns that I passed 3 parameters and is waiting for two.

from django.urls.conf import include
from django.contrib import admin
from django.urls import path

urlpatterns = [

    path('admin/', include(admin.site.urls)),   
    path('', include('learning_logs.urls', namespace='learning')), 
]
""" Define padrões de URL para learning_logs. """
from django.conf.urls import url

from . import views

app_name="learning"

urlpatterns = [
    # Home page.
    url(r'^', views.index, name='index'),

]

Error message:

'provide the namespace argument to include() Instead. ' % Len(Arg) Django.core.exceptions.Improperlyconfigured: Passing a 3-tuple to include() is n ot supported. Pass a 2-tuple containing the list of Patterns and app_name, and p rovide the namespace argument to include() Instead.

  • it would be interesting if you [Edit] your question and add the version of Django you are using.

  • you are probably missing the name of the app, check the name of the app in the file app.py in your app folder

  • really was app_name = 'app-name', was missing set namespace.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.