jonasundderwolf / django-image-cropping

Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Other
553 stars 131 forks source link

DJANGO_SETTINGS_MODULE is undefined #12

Closed Gwildor closed 12 years ago

Gwildor commented 12 years ago

I can't manage to get django-image-cropping to run. After installation and configuration of my settings.py file, I'm getting the following error:

ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

jonasvp commented 12 years ago

This is probably because of a syntax or other problem in your settings.py. Try running "python" and then "import settings" to see what errors it throws.

What version of easy_thumbnails are you running? (Check the output of "pip freeze"). Version 1.0 changed some settings, you might want to try the old version: https://github.com/jonasundderwolf/django-image-cropping/commit/dce62a5a54d8a200854b288c6c746eb333842230

Gwildor commented 12 years ago

First of all, thanks for your fast reaction (too bad I didn't see it just as fast).

Importing settings returns no errors. I forgot to mention this but I'm working on a project which was working fine until I attempted to use django-image-cropping, and actually worked fine again when I commented everything related to it in my settings file, so I really really doubt there is something wrong on that end.

As for my easy_thumbnails version, I'm using version 1.0.3. Can you tell me which version of it might be worth attempting?

jonasvp commented 12 years ago

No, 1.0.3 is fine. When exactly does the error occur? And what did you add to the settings.py?

Gwildor commented 12 years ago

It occurs immediately when I try to run Django form the shell. I added everything from the readme from points 2 and 3 (although I had the import as the second line, not immediately above the THUMBNAIL_PROCESSORS = ...), both from the readme in the master branch as the readme in the django-1.4-compatibility branch (so I tried both the "thumbnail_settings" version and the "defaults" version).

My Django version is 1.4.1, does that bring compatibility issues?

jonasvp commented 12 years ago

No, Django 1.4.1 is fine. Sorry, can't really think of anything more to check. Main thing would be to try and find out what error is causing ./manage.py to bail. Maybe step through the settings with pdb.set_trace().

It's interesting that importing the settings directly doesn't throw any errors but I can't think of anything that would cause this behavior. Is there any public code I could see? Maybe a diff of the settings after adding the image-cropping-related constants?

Gwildor commented 12 years ago

That's too bad, but thanks for your help.

Sorry, there isn't any code which can be publicly available.

jonasvp commented 12 years ago

Well, good luck! Would love for you to check back when you found the problem, maybe others have the same issue.