该问题是由循环导入引起的姜戈

问题描述

同事们好!我在 Django 项目中工作。我的网址有问题

在该项目中,我在该应用程序中只有一个应用程序,我创建了我的 urls 文件,以便稍后将其导入整个项目的 urls 中,但是当服务器运行时,它给了我以下错误:

The included URLconf 'online_store.urls' 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.

我的 urls.py 项目

from django.contrib import admin

from django.urls import path,include

urlspatterns = [
    path('admin/',admin.site.urls),path('',include('online_store_app.urls')),]

还有我的 urls.py 应用

#   Dajngo
from django.urls import path
from online_store_app import views

urlspatterns = [

        #   urls site 
    path('home',views.home,name = 'home'),path('services',views.services,name = 'services'),path('store',views.store,name = 'store'),path('blog',views.blog,name = 'blog'),path('contact',views.contact,name = 'contact'),]

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)