Closed h3rehman closed 6 years ago
So I uninstalled it from the above user and re-installed it as root that user warning went away however now I am getting the below exception. Do I have to set the environment variables now?
(myprojectenv) root@django-HHHPropertyManagement:/home/legacy/django_projects# pip install pillow django-imagekit
Requirement already satisfied: pillow in ./myprojectenv/lib/python3.5/site-packages (5.2.0)
Collecting django-imagekit
Downloading https://files.pythonhosted.org/packages/e5/2a/a5c62376e897c23d1ce21be86c18e68096cb8c83df7d010d24ca81139e9e/django_imagekit-4.0.2-py2.py3-none-any.whl (47kB)
100% |████████████████████████████████| 51kB 14.4MB/s
Requirement already satisfied: django-appconf>=0.5 in ./myprojectenv/lib/python3.5/site-packages (from django-imagekit) (1.0.2)
Requirement already satisfied: six in ./myprojectenv/lib/python3.5/site-packages (from django-imagekit) (1.11.0)
Requirement already satisfied: pilkit>=0.2.0 in ./myprojectenv/lib/python3.5/site-packages (from django-imagekit) (2.0)
Installing collected packages: django-imagekit
Successfully installed django-imagekit-4.0.2
(myprojectenv) root@django-HHHPropertyManagement:/home/legacy/django_projects# python
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import imagekit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/legacy/django_projects/myprojectenv/lib/python3.5/site-packages/imagekit/__init__.py", line 2, in <module>
from . import conf
File "/home/legacy/django_projects/myprojectenv/lib/python3.5/site-packages/imagekit/conf.py", line 6, in <module>
class ImageKitConf(AppConf):
File "/home/legacy/django_projects/myprojectenv/lib/python3.5/site-packages/appconf/base.py", line 74, in __new__
new_class._configure()
File "/home/legacy/django_projects/myprojectenv/lib/python3.5/site-packages/appconf/base.py", line 100, in _configure
value = getattr(obj._meta.holder, prefixed_name, default_value)
File "/home/legacy/django_projects/myprojectenv/lib/python3.5/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/home/legacy/django_projects/myprojectenv/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting IMAGEKIT_CACHE_BACKEND, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
I edited your Issue and comment to correctly show the output from the terminal to be easy to read. It's better to use Markdown when you want to show portions of code.
Now to the real issue.
legacy
. If virtual environment is in that user you should never use sudo pip
or executing pip
as root
user. You totally messed up the permissions in the home folder of the legacy
user. I'm suggesting you to fix ownership in all directories inside /home/legacy/
by executing sudo chown -R legacy.legacy /home/legacy/
django-imagekit
but you are not using it right. This is Django addon and can't work outside of Django environment. As the error says django.core.exceptions.ImproperlyConfigured
it want's some settings to be set from Django, but Django is not configured yet.This is not a problem with Imagekit but problem with your environment. I'm closing this issue.