#41 Declined
Repository
alper alper
Branch
default
Repository
ubernostrum ubernostrum
Branch
default

Removed dependency on django during installation.

Author
  1. alper avataralper
Reviewers
Description

Using django code in setup.py breaks when django isn't installed yet (which can happen in a batch). Running installation twice to fix this may not always be an option.

Comments (8)

  1. antaresjhw

    It appears that this pull request will fix the problem I am getting when trying to deploy a django app with this package on AWS Elastic Beanstalk - I currently get "ImportError: No module named django.utils.version" when my requirements.txt file is being processed during deployment.

  2. James Bennett repo owner

    I'd be less interested in fixing the symptom and more interested in fixing the problem; what code is calling registration.get_version() during the install process? I ask because the current version was done at PyCon in response to a similar problem, and the current version was alleged to have fixed it.

  3. Emanuel Steen

    It's in setup.py during the call to setup where version is passed as a named arguement: version=get_version().replace(' ', '-')

    It is a bit inconvenient when you setup a new fresh virtualenv since you have to "source" and activate the virtualenv before you can install django-registration which is a bit more complicated in scripts.

    In addition, in the current implementation "get_version" is imported from "django.utils.version" which only is available in Django 1.5 and django-registration claims to be Django 1.4 compatible too.

  4. Marek Kuziel

    I found this patch via http://stackoverflow.com/questions/16087735/buildout-and-django-registration-from-repository-for-django-1-5

    I have a similar setup: buildout 2.1.0 + django 1.5.1 + mr.developer 1.25 and django-registration r440 (tip)

    Buildout failed for me similar way as described at stackoverflow.

    Re "I ask because the current version was done at PyCon in response to a similar problem, and the current version was alleged to have fixed it."

    IMO, the current version fixes it only and only if you assume that you run Django 1.5.X (see note from Emanuel above: "the current implementation "get_version" is imported from "django.utils.version" which only is available in Django 1.5") and that Django is installed before django-registration.

    When you run buildout + mr.dveloper, mr. developer will do its job first (ie. before buildout gets to Django part) and therefore the following line will always fail:

    from django.utils.version import get_version as django_get_version
    

    The patch is pretty much what django.utils.version.get_version does ie. bring the code from get_version directly to init and the problem will disappear for everyone.

    I can confirm the patch resolved the problem for me.

    Hope this helps.

    Marek

  5. Adam Charnock

    We are having the same issue on a new project. Is they any news on a fix?

    I can see this pull request has been declined, is there a better place for me to discuss this?

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.