0

I am facing some problems with my Django installation. I am using Ubuntu as my OS.

Eclipse was installed through the Sofware center. Pydev through the plug-in Option in Eclipse. Django was installed as described in the Tutorial. Now I am facing this problem:

from django.core.management.validation import max_length

throws a Unresolved import: max_length.

I found information about adding Django Paths to the PythonPaths. But the mentioned solutions did not solve my problem. Heres what Eclipse found with autoconfig:

![1]: http://i42.tinypic.com/2namvpl.png "Part1"

![2]: http://i40.tinypic.com/favksz.png "Part2"

Can someone please explain which paths have to be set up? I am lost.

Thank you.

1 Answer 1

2

I'm going to go out on a limb and say that you're real problem is you shouldn't be using this import in the first place.

I've seen similar things happen to me in Aptana Studio (basically same as Eclipse). When adding a CharField to a model, you start typing "max_length" and it pops up a code-completion menu. But when you go ahead and have it complete "max_length" for you, it actually adds that import, which is a nonsense import. It results in an ImportError and it's not necessary.

If this sounds familiar, then just remove that import and go about your day.

Sign up to request clarification or add additional context in comments.

3 Comments

You could have a look at django's source to verify that actually no max_length that could be imported: code.djangoproject.com/browser/django/trunk/django/core/…
You are right. Eclipse added this statement itself. But why? I don't understand why it adds an import which does not work.
Haha. You got me on that one. I've wondered the same thing myself. I chalk it up to IDEs are complicated beasts, and I'll accept imperfection when it's opensource/free.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.