Pull requests

#6 Declined
Repository
volpino
Branch
default
Repository
schinckel
Branch
default

Fixed installation in Django 1.5

Author
  1. volpino
Reviewers
Description

Imports in __init__.py are breaking installation using pip with django 1.5.

The error was caused by

from django.db import models

in fields.py

At the beginning I removed the imports as they are not really needed but that would break old code, so I changed the except ImportError to except Exception. I don't know if it's actually possible to import the right django exception (ImproperlyConfigured) but I think I cannot assume django is installed.

  • Learn about pull requests

Comments (4)

  1. Matthew Schinckel repo owner

    I'll probably need to have a look at this at some stage. I do have one possible solution, but I'm not sure if it will work or not.

    We could try to import django: if that fails with an ImportError, then continue. If it succeeds, import ImproperlyConfigured (as django must be installed).