I'm running 3.5 in virtenv. Everything works fine - and then I try to run a script. Here's the error:
Traceback (most recent call last):
File "check_wins.py", line 2, in <module>
from teamsports.models import Teams, Schedule
File "/home/mrsaltz/thepub/teamsports/models.py", line 5, in <module>
from versatileimagefield.fields import VersatileImageField
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/versatileimagefield/fields.py", line 10, in <module>
from .files import VersatileImageFieldFile, VersatileImageFileDescriptor
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/versatileimagefield/files.py", line 11, in <module>
from .mixins import VersatileImageMixIn
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/versatileimagefield/mixins.py", line 9, in <module>
from .datastructures import FilterLibrary
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/versatileimagefield/datastructures/__init__.py", line 3, in <module>
from .sizedimage import SizedImage
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/versatileimagefield/datastructures/sizedimage.py", line 6, in <module>
from ..settings import (
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/versatileimagefield/settings.py", line 68, in <module>
None
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/mrsaltz/.virtualenvs/thepub/lib/python3.5/site-packages/django/conf/__init__.py", line 39, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting VERSATILEIMAGEFIELD_SETTINGS, but settings are not configured. You must eithe
r define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Versatileimagefield works great on my site. And I can run all of these commands within a shell (python manage.py shell).
Any idea why this is happening?