[Answered ]-Django incorrect import

2đź‘Ť

âś…

Unless you’ve fiddled with the django source, there really should be any problems with the Sites._meta.installed variable. _meta.installed is assigned from within the metaclass of all models (using contribute_to_class()) so it would affect ALL models if the code were broken.

A quick search for relevant tickets does not reveal such a problem for that version (or any other version) of django.

Are you by any chances running django via pydev? If so, perhaps this post is relevant: How do I fix PyDev "Undefined variable from import" errors?

That’s of course a wild speculation on my part. If you can post a Trackback of your error, we might be able to get a better insight into your problem.


Response to comments:

“I get the error in the IDE (apatana Studio 3)”

Aptana uses PyDev and so will exhibit the same problem. Here’s a possible fix taken from this blog post:

  1. Open up Aptana Studio
  2. Open Window > Preferences > PyDev > Editor > Code Analysis
  3. Select the “Undefined” tab
  4. Add DoesNotExist at the end of the “Consider the following names as globals” list
  5. Apply and restart
👤Shawn Chin

Leave a comment