Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango: cannot import name
    text
    copied!<p>I've just encountered a very annoying problem while deploying new updates to my website. I have two seperate websites whereas one of them is a development version. Now when I want to apply my changes to the production it won't work because of error message:</p> <blockquote> <p>File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py", line 99, in get_response<br> request.path_info)</p> <p>File "/usr/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 249, in resolve for pattern in self.url_patterns:</p> <p>File "/usr/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 278, in _get_url_patterns<br> patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)</p> <p>File "/usr/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 273, in _get_urlconf_module<br> self._urlconf_module = import_module(self.urlconf_name)</p> <p>File "/usr/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module<br> <strong>import</strong>(name)</p> <p>File "/srv/websites/spelutveckla_se/urls.py", line 21, in <br> (r'^account/login/$', LoginView.as_view()),</p> <p>NameError: name 'LoginView' is not defined</p> </blockquote> <p>It doesn't matter if I remove that app, view, class or module because it will complain about an other module instead. LoginView IS defined in an import statement. The files are just a fresh copy of the development files (except for settings.py) that is running on an another subdomain without any problem. I've checked the settings.py several times and made sure the correct settings are set (differs by a couple of directory paths). I've also checked that the apache2 www-data user has permission to access the files. i've also restarted apache a couple of times and re-copied the files over and over but nothing works.</p> <p>I'm desperate and have no clue of what the problem might be...?</p> <p>Here's what my urls.py looks like at the top:</p> <pre><code>from django.conf.urls.defaults import * from django.conf import settings from django.views.generic import DetailView, ListView, TemplateView from django.contrib import admin from project.models import Project from project.views import Detail, EditView as EditProject, CreateProjectView, EditProjectLinksView, EditProjectFeedsView, EditProjectTagsView, EditMultimediaView, PostForumTopic, AudioFormset from frontpage.views import FrontpageView from userprofile.views import UserRegistrationView, UserRegistrationActivationView, LogoutView, UserProfileView, LoginView, EditProfileView, CreateUserProfileView from registration.views import activate as UserActivatedView </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload