On Fri, Apr 13, 2012 at 5:15 PM, Aymeric Augustin <
aymeric.augus...@polytechnique.org> wrote:

> On 12 avr. 2012, at 23:16, Aymeric Augustin wrote:
>
[...]

> So a documentation fix might not be sufficient to eradicate the problem.
> Could we add this in a pre-install hook in setup.py?
>
> try:
>    import django
> except ImportError:
>    pass
> else:
>   print "It appears that Django %s is already installed." %
> django.get_version()
>   print "If you want to upgrade Django, please remove the existing
> installation first."
>   sys.exit(1)
>

This "import django" will work even when django is not installed, because
usually "python setup.py " is ran from checkout of django, that contains
the valid folder (python package) named "django". So, this "import django"
will import relative to current directory and will work.

[],
-- 
Luciano Pacheco
blog.lucmult.com.br

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to