python - Django error : django.core.exceptions.ImproperlyConfigured: - Stack Overflow

I get the following error all the time since two days now and i am stacked at this level.This the error

I get the following error all the time since two days now and i am stacked at this level.This the error:

django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'pages.urls' from 'C:\\Users\\adech\\mon_site\\monsite\\pages\\urls.py'>' does not appear to have any patterns in it. If you see the 'urlpatterns' variable with valid patterns in the file then the issue is probably caused by a circular import.

I am a beginner with django and i read the django documentation following all the instructions but always the same problem.

Un extrait du code dans urls de mon site:

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

urlpatterns = [
      path('admin/', admin.site.urls),
      path('', include('pages.urls')),
      path('services/', include('services.urls')),
      path('portfolio/', include('portfolio.urls')),
      path('contact/', include('contact.urls')),
      ]

un extrait du code dans settings :

    INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'pages',      # Application pour la gestion des pages (Accueil, À propos)
    'services',   # Application pour les services
    'portfolio',  # Application pour les projets et le portfolio
    'contact',    # Application pour le formulaire de contact
]

le code dans mon app page.urls

from django.urls import path
from . import views

urlpatterns = [
path('', views.home, name='home'),  
]

Le code dans views de mon app pages:

from django.shortcuts import render

def home(request):
    return render(request, 'pages/home.html')

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743778167a4505616.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信