title: Why do I get circular import error when importing view?
body: <p>Could someone please help me. I get the following error when loading my project: </p>
  
  <blockquote>
    <p>raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
    django.core.exceptions.ImproperlyConfigured: The included URLconf
    'siteV1.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.</p>
  </blockquote>
  
  <p>This is my urls.py </p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path
  
  from django.conf import settings
  from django.conf.urls.static import static
  
  from drink.views import HomepageView, CreateDrinkView, CreateNormalDrinkView, CreateMixedDrinkView
  
  from machine.views import SettingsView
  
  from account.views import LoginView
  
  urlpatterns = [
      path('', HomepageView.as_view()),
      path('create-drink', CreateDrinkView.as_view()),
      path('create-drink/save-normal', CreateNormalDrinkView.as_view()),
      path('create-drink/save-mixed', CreateMixedDrinkView.as_view()),
      path('settings/', SettingsView.as_view()),
      path('accounts/login/', LoginView.as_view()),
      path('admin/', admin.site.urls),
  ]
  
  if settings.DEBUG == True:
      urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
      urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
  else:
      pass
      #enter code here for media and static handeling during production
  </code></pre>
  
  <p>The problem seems to be related to the import of the LoginView. If I delete this import and path the program runs without any errors. My accounts.views contains the following code:</p>
  
  <pre><code>from django.contrib.auth import authenticate, login
  from django.shortcuts import render, redirect
  from django.views.generic import TemplateView
  
  
  # Create your views here.
  class LoginView(TemplateView):
      template_name = 'login.html'
  
      def get(self, request):
          return render(request, self.template_name, {})
  
      def post(self, request):
          username = request.POST['username']
          password = request.POST['password']
          user = authenticate(request, username=username, password=password)
  
          if user is not None:
              login(request, user)
              # Redirect to a success page.
              return redirect('')
          else:
              # Return an 'invalid login' error message.
              return render(request, self.template_name {'error': 'Gebruikersnaam of wachtwoord onjuist!'})
  </code></pre>
  
  <p>The account.models is empty at the moment. I tried running pycycle to check for circular imports. Pycycle returned that there were no circular imports found. Your help is much appreciated!</p>