Я пытался завершить учебное пособие по быстрому старту drf из https://www.django -rest-framework.org / tutorial / quickstart /
, используя
Python 3.6.1
django-rest-framework 3.9.4
Django 2.2.1
, но когда я запускаю
python manage.py runserver
, я получаю сообщение об ошибке
File "E:\Dropbox\python\drf2\venv\lib\site-packages\django\urls\resolvers.py", line 588, in url_patterns
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf 'tutorial.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.urls import include, path
from rest_framework import routers
from tutorial.quickstart import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
path('', include(router.urls)),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]