I'm trying to deploy a Django website to Amazon Web Services using python 3. Now, django-storages is not compatible with python3, so I installed django-storages-redux, which is compatible. But, when I'm trying to:
python3 manage.py runserver
I'm getting this:
Traceback (most recent call last):
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/jokes/views.py", line 6, in home_page
response = render(request, 'home.html')
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/shortcuts.py", line 67, in render
template_name, context, request=request, using=using)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/loader.py", line 99, in render_to_string
return template.render(context, request)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/backends/django.py", line 74, in render
return self.template.render(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/base.py", line 209, in render
return self._render(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/base.py", line 201, in _render
return self.nodelist.render(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/base.py", line 903, in render
bit = self.render_node(node, context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/debug.py", line 79, in render_node
return node.render(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/loader_tags.py", line 135, in render
return compiled_parent._render(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/base.py", line 201, in _render
return self.nodelist.render(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/base.py", line 903, in render
bit = self.render_node(node, context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/template/debug.py", line 79, in render_node
return node.render(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/templatetags/static.py", line 105, in render
url = self.url(context)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/contrib/staticfiles/templatetags/staticfiles.py", line 16, in url
return static(path)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/contrib/staticfiles/templatetags/staticfiles.py", line 9, in static
return staticfiles_storage.url(path)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/utils/functional.py", line 226, in inner
self._setup()
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/contrib/staticfiles/storage.py", line 394, in _setup
self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/core/files/storage.py", line 329, in get_storage_class
return import_string(import_path or settings.DEFAULT_FILE_STORAGE)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/utils/module_loading.py", line 26, in import_string
module = import_module(module_path)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1448, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/storages/backends/s3boto.py", line 24, in <module>
from storages.utils import setting
ImportError: cannot import name 'setting'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
return self.application(environ, start_response)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
response = self.get_response(request)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/core/handlers/base.py", line 218, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/core/handlers/base.py", line 261, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/views/debug.py", line 97, in technical_500_response
html = reporter.get_traceback_html()
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/views/debug.py", line 383, in get_traceback_html
c = Context(self.get_traceback_data(), use_l10n=False)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/views/debug.py", line 328, in get_traceback_data
frames = self.get_traceback_frames()
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/views/debug.py", line 501, in get_traceback_frames
'vars': self.filter.get_traceback_frame_variables(self.request, tb.tb_frame),
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/views/debug.py", line 234, in get_traceback_frame_variables
cleansed[name] = self.cleanse_special_types(request, value)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/views/debug.py", line 189, in cleanse_special_types
if isinstance(value, HttpRequest):
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/utils/functional.py", line 226, in inner
self._setup()
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/contrib/staticfiles/storage.py", line 394, in _setup
self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/core/files/storage.py", line 329, in get_storage_class
return import_string(import_path or settings.DEFAULT_FILE_STORAGE)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/django/utils/module_loading.py", line 26, in import_string
module = import_module(module_path)
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1448, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/home/antoni4040/Documents/django-trunk/django/bin/thermostatis/env/lib/python3.4/site-packages/storages/backends/s3boto.py", line 24, in <module>
from storages.utils import setting
ImportError: cannot import name 'setting'
Strange, what is that setting file that it tries to import? Has anyone succeeded deploying like this?
I actually solved my problem in a different way... I added this to my requirements.txt file:
-e git+https://github.com/coagulant/django-storages-py3.git@73920742505b0c86b2fbc30274ff8b111e9b6f48#egg=django_storages-origin-py3
and now it's working! With a different library, but still...