I am working Django rest framework api project, where I had multiple apps in the project. I got a circular import error when I am adding the app URLs to the main URLs. I Tried everything checked spellings, checked app structure but no use. Its been really frustrating with issue..please help to solve the problem. The app is working fine when I take off newly added line `path("covid/", include("Covid.urls")),`
I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0
Here is project
**urls.py**
from django.contrib import admin
from django.conf.urls import url
from django.urls import path, include
from rest_framework_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='TmmrwInc API Documentation')
urlpatterns = [
path('admin/', admin.site.urls),
# path('', include('django.contrib.auth.urls')),
# path('rest_auth/', include('rest_auth.urls')),
path('api/password_reset/',
include('django_rest_passwordreset.urls', namespace='password_reset')),
# url(r'^invitations/', include('invitations.urls', namespace='invitations')),
path('', include('rest_invitations.urls')),
path("", include("UserAuth.urls")),
path("doctors/", include("Administration.urls")),
path("appointments/", include("Appointments.urls")),
path("messaging/", include("messaging.urls")),
path("meet/", include("meet.urls")),
path("api_documentation/", schema_view),
path("covid/", include("Covid.urls")),
]
This is app **urls.py** file
from django.urls import path
from . import views
app_name = 'Covid'
urlpatterns = [
path('event/', views.EventBookingView.as_view()),
]
**settings.py** installed apps
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.sites",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"UserAuth",
"rest_framework",
"corsheaders",
'rest_framework.authtoken',
'rest_auth',
'Appointments',
'messaging',
'Administration',
'channels',
'invitations',
'rest_invitations',
'django_rest_passwordreset',
'django_celery_beat',
'meet',
'rest_framework_swagger',
'Covid',
]
This is a project structure
[Project Structure][1]