[Python] Got The included URLconf does not appear to have any patterns in it

Discussão em 'Python' iniciado por Stack, Março 13, 2025.

  1. Stack

    Stack Membro Participativo

    I have looked at other answers to this question, but I still can't figure out what's wrong.

    Generally, there are two urls.py - one in my account folder, and another one in my bookmarks folder which are in the root folder - bookmarks.

    When I try to create a superuser, I get this:

    django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'account.urls' from '/Users/aleksanderjess/Documents/PacktPub/Django/bookmarks/account/urls.py'>' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.


    I have absolutely no clue why. The imports look legit and all.

    Here are two urls.py

    account/urls.py:

    from django.contrib.auth import views
    from . import views

    urls = [
    path('login/', views.user_login, name='login'),
    ]


    and then there's the one in bookmarks, which looks like this:

    from django.contrib import admin
    from django.urls import path, include
    from django.conf import settings
    from django.conf.urls.static import static

    urlpatterns = [
    path('admin/', admin.site.urls),
    path('account/', include('account.urls')),
    ]

    Continue reading...

Compartilhe esta Página