I'm trying to deploy a Django application, however, during deployment, I'm getting the following error:
[Mon Feb 12 20:56:17.256427 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] mod_wsgi (pid=6870): Exception occurred processing WSGI script '/home/websites/www-davixxa/src/davixxa_website/production.wsgi'.
[Mon Feb 12 20:56:17.256883 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] Traceback (most recent call last):
[Mon Feb 12 20:56:17.257362 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/PIL/Image.py", line 58, in <module>
[Mon Feb 12 20:56:17.257483 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 134, in get_response
[Mon Feb 12 20:56:17.257492 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] from . import _imaging as core
[Mon Feb 12 20:56:17.257519 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] resolver_match = resolver.resolve(request.path_info)
[Mon Feb 12 20:56:17.257624 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] ImportError: cannot import name '_imaging'
[Mon Feb 12 20:56:17.257760 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512]
[Mon Feb 12 20:56:17.257864 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/urlresolvers.py", line 374, in resolve
[Mon Feb 12 20:56:17.257872 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] During handling of the above exception, another exception occurred:
[Mon Feb 12 20:56:17.257896 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] for pattern in self.url_patterns:
[Mon Feb 12 20:56:17.257905 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512]
[Mon Feb 12 20:56:17.258021 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] Traceback (most recent call last):
[Mon Feb 12 20:56:17.258113 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/utils/functional.py", line 33, in __get__
[Mon Feb 12 20:56:17.258224 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] res = instance.__dict__[self.name] = self.func(instance)
[Mon Feb 12 20:56:17.258537 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/urlresolvers.py", line 417, in url_patterns
[Mon Feb 12 20:56:17.258855 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
[Mon Feb 12 20:56:17.259248 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 177, in __call__
[Mon Feb 12 20:56:17.259357 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/utils/functional.py", line 33, in __get__
[Mon Feb 12 20:56:17.259365 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] response = self.get_response(request)
[Mon Feb 12 20:56:17.259390 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] res = instance.__dict__[self.name] = self.func(instance)
[Mon Feb 12 20:56:17.259644 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 230, in get_response
[Mon Feb 12 20:56:17.259745 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/urlresolvers.py", line 410, in urlconf_module
[Mon Feb 12 20:56:17.259756 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Mon Feb 12 20:56:17.259778 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] return import_module(self.urlconf_name)
[Mon Feb 12 20:56:17.260018 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 292, in handle_uncaught_exception
[Mon Feb 12 20:56:17.260108 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Mon Feb 12 20:56:17.260118 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] if resolver.urlconf_module is None:
[Mon Feb 12 20:56:17.260140 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Feb 12 20:56:17.260285 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Mon Feb 12 20:56:17.260376 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/utils/functional.py", line 33, in __get__
[Mon Feb 12 20:56:17.260463 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Mon Feb 12 20:56:17.260474 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] res = instance.__dict__[self.name] = self.func(instance)
[Mon Feb 12 20:56:17.260567 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
[Mon Feb 12 20:56:17.260702 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
[Mon Feb 12 20:56:17.260793 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/urlresolvers.py", line 410, in urlconf_module
[Mon Feb 12 20:56:17.260881 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1129, in _exec
[Mon Feb 12 20:56:17.260889 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] return import_module(self.urlconf_name)
[Mon Feb 12 20:56:17.260983 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1471, in exec_module
[Mon Feb 12 20:56:17.261126 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Mon Feb 12 20:56:17.261219 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Mon Feb 12 20:56:17.261284 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Feb 12 20:56:17.261373 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/src/davixxa_website/urls.py", line 24, in <module>
[Mon Feb 12 20:56:17.261465 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Mon Feb 12 20:56:17.261473 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] url(r'^markdownx/', include('markdownx.urls')),
[Mon Feb 12 20:56:17.261570 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Mon Feb 12 20:56:17.261717 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
[Mon Feb 12 20:56:17.261811 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/conf/urls/__init__.py", line 52, in include
[Mon Feb 12 20:56:17.261902 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
[Mon Feb 12 20:56:17.261910 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] urlconf_module = import_module(urlconf_module)
[Mon Feb 12 20:56:17.262005 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 1129, in _exec
[Mon Feb 12 20:56:17.262135 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 1471, in exec_module
[Mon Feb 12 20:56:17.262223 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Mon Feb 12 20:56:17.262310 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Mon Feb 12 20:56:17.262318 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Feb 12 20:56:17.262464 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Mon Feb 12 20:56:17.262553 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/src/davixxa_website/urls.py", line 24, in <module>
[Mon Feb 12 20:56:17.262639 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Mon Feb 12 20:56:17.262648 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] url(r'^markdownx/', include('markdownx.urls')),
[Mon Feb 12 20:56:17.262740 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
[Mon Feb 12 20:56:17.262872 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
[Mon Feb 12 20:56:17.262960 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/conf/urls/__init__.py", line 52, in include
[Mon Feb 12 20:56:17.263047 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1129, in _exec
[Mon Feb 12 20:56:17.263056 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] urlconf_module = import_module(urlconf_module)
[Mon Feb 12 20:56:17.263148 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1471, in exec_module
[Mon Feb 12 20:56:17.263281 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Mon Feb 12 20:56:17.263367 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Mon Feb 12 20:56:17.263430 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Feb 12 20:56:17.263521 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/urls.py", line 9, in <module>
[Mon Feb 12 20:56:17.263668 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from .views import (
[Mon Feb 12 20:56:17.263659 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Mon Feb 12 20:56:17.263833 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Mon Feb 12 20:56:17.263927 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/views.py", line 5, in <module>
[Mon Feb 12 20:56:17.264018 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
[Mon Feb 12 20:56:17.264026 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from .forms import ImageForm
[Mon Feb 12 20:56:17.264122 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
[Mon Feb 12 20:56:17.264258 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 1129, in _exec
[Mon Feb 12 20:56:17.264348 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/forms.py", line 13, in <module>
[Mon Feb 12 20:56:17.264436 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 1471, in exec_module
[Mon Feb 12 20:56:17.264445 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from .utils import scale_and_crop, xml_has_javascript
[Mon Feb 12 20:56:17.264537 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Mon Feb 12 20:56:17.264720 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/utils.py", line 3, in <module>
[Mon Feb 12 20:56:17.264805 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/urls.py", line 9, in <module>
[Mon Feb 12 20:56:17.264812 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from PIL import Image
[Mon Feb 12 20:56:17.264834 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] from .views import (
[Mon Feb 12 20:56:17.265016 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/PIL/Image.py", line 58, in <module>
[Mon Feb 12 20:56:17.265100 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/views.py", line 5, in <module>
[Mon Feb 12 20:56:17.265108 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from . import _imaging as core
[Mon Feb 12 20:56:17.265132 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] from .forms import ImageForm
[Mon Feb 12 20:56:17.265229 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] ImportError: cannot import name '_imaging'
[Mon Feb 12 20:56:17.265350 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179]
[Mon Feb 12 20:56:17.265445 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/forms.py", line 13, in <module>
[Mon Feb 12 20:56:17.265453 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] During handling of the above exception, another exception occurred:
[Mon Feb 12 20:56:17.265477 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] from .utils import scale_and_crop, xml_has_javascript
[Mon Feb 12 20:56:17.265518 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179]
[Mon Feb 12 20:56:17.265640 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] Traceback (most recent call last):
[Mon Feb 12 20:56:17.265734 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/utils.py", line 3, in <module>
[Mon Feb 12 20:56:17.265819 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] from PIL import Image
[Mon Feb 12 20:56:17.265910 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 177, in __call__
[Mon Feb 12 20:56:17.265976 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] response = self.get_response(request)
[Mon Feb 12 20:56:17.266065 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/PIL/Image.py", line 58, in <module>
[Mon Feb 12 20:56:17.266125 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] from . import _imaging as core
[Mon Feb 12 20:56:17.266212 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 230, in get_response
[Mon Feb 12 20:56:17.266307 2018] [wsgi:error] [pid 6870:tid 126523728705280] [remote 178.155.217.10:512] ImportError: cannot import name '_imaging'
[Mon Feb 12 20:56:17.266315 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Mon Feb 12 20:56:17.267815 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 292, in handle_uncaught_exception
[Mon Feb 12 20:56:17.267894 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] if resolver.urlconf_module is None:
[Mon Feb 12 20:56:17.268181 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/utils/functional.py", line 33, in __get__
[Mon Feb 12 20:56:17.268237 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] res = instance.__dict__[self.name] = self.func(instance)
[Mon Feb 12 20:56:17.268500 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/core/urlresolvers.py", line 410, in urlconf_module
[Mon Feb 12 20:56:17.268548 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] return import_module(self.urlconf_name)
[Mon Feb 12 20:56:17.268701 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Mon Feb 12 20:56:17.268732 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Feb 12 20:56:17.268828 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Mon Feb 12 20:56:17.268917 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Mon Feb 12 20:56:17.269004 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
[Mon Feb 12 20:56:17.269132 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
[Mon Feb 12 20:56:17.269224 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1129, in _exec
[Mon Feb 12 20:56:17.269313 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1471, in exec_module
[Mon Feb 12 20:56:17.269403 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Mon Feb 12 20:56:17.269546 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/src/davixxa_website/urls.py", line 24, in <module>
[Mon Feb 12 20:56:17.269575 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] url(r'^markdownx/', include('markdownx.urls')),
[Mon Feb 12 20:56:17.269708 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/django/conf/urls/__init__.py", line 52, in include
[Mon Feb 12 20:56:17.269737 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] urlconf_module = import_module(urlconf_module)
[Mon Feb 12 20:56:17.269862 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Mon Feb 12 20:56:17.269889 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Feb 12 20:56:17.269980 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Mon Feb 12 20:56:17.270067 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Mon Feb 12 20:56:17.270154 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
[Mon Feb 12 20:56:17.270241 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
[Mon Feb 12 20:56:17.270327 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1129, in _exec
[Mon Feb 12 20:56:17.270413 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 1471, in exec_module
[Mon Feb 12 20:56:17.270500 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Mon Feb 12 20:56:17.270637 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/urls.py", line 9, in <module>
[Mon Feb 12 20:56:17.270665 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from .views import (
[Mon Feb 12 20:56:17.270794 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/views.py", line 5, in <module>
[Mon Feb 12 20:56:17.270822 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from .forms import ImageForm
[Mon Feb 12 20:56:17.270950 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/forms.py", line 13, in <module>
[Mon Feb 12 20:56:17.271006 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from .utils import scale_and_crop, xml_has_javascript
[Mon Feb 12 20:56:17.271147 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/markdownx/utils.py", line 3, in <module>
[Mon Feb 12 20:56:17.271185 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from PIL import Image
[Mon Feb 12 20:56:17.271345 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] File "/home/websites/www-davixxa/venv/lib/python3.5/site-packages/PIL/Image.py", line 58, in <module>
[Mon Feb 12 20:56:17.271376 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] from . import _imaging as core
[Mon Feb 12 20:56:17.271479 2018] [wsgi:error] [pid 6870:tid 126523603367680] [remote 178.155.217.10:1179] ImportError: cannot import name '_imaging'
Any help would be greatly appreciated.
Edit: As elaborated on in the comments below, currently, it seems like mod_wsgi isn't compiled for 3.5, but 3.4 instead. I've also gone ahead and expanded my error.
Related
I am trying to start my first django app with Apache2 (2.4.18).
Unfortunately, I got a bit stuck. This is the error code i get in my log file:
[Wed Mar 11 06:31:32.668937 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] mod_wsgi (pid=14849): Target WSGI script '/home/nigsdtm/srv/portal/mysite/wsgi.py' cannot be loaded as Python module.
[Wed Mar 11 06:31:32.669026 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] mod_wsgi (pid=14849): Exception occurred processing WSGI script '/home/nigsdtm/srv/portal/mysite/wsgi.py'.
[Wed Mar 11 06:31:32.669734 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] Traceback (most recent call last):
[Wed Mar 11 06:31:32.669779 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/home/nigsdtm/srv/portal/mysite/wsgi.py", line 16, in <module>
[Wed Mar 11 06:31:32.669783 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] application = get_wsgi_application()
[Wed Mar 11 06:31:32.669789 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Wed Mar 11 06:31:32.669792 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] django.setup(set_prefix=False)
[Wed Mar 11 06:31:32.669809 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 24, in setup
[Wed Mar 11 06:31:32.669812 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] apps.populate(settings.INSTALLED_APPS)
[Wed Mar 11 06:31:32.669817 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/usr/local/lib/python3.5/dist-packages/django/apps/registry.py", line 112, in populate
[Wed Mar 11 06:31:32.669820 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] app_config.import_models()
[Wed Mar 11 06:31:32.669824 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/usr/local/lib/python3.5/dist-packages/django/apps/config.py", line 198, in import_models
[Wed Mar 11 06:31:32.669827 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] self.models_module = import_module(models_module_name)
[Wed Mar 11 06:31:32.669832 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
[Wed Mar 11 06:31:32.669834 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] return _bootstrap._gcd_import(name[level:], package, level)
[Wed Mar 11 06:31:32.669839 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "<frozen importlib._bootstrap>", line 986, in _gcd_import
[Wed Mar 11 06:31:32.669843 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "<frozen importlib._bootstrap>", line 969, in _find_and_load
[Wed Mar 11 06:31:32.669848 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
[Wed Mar 11 06:31:32.669852 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
[Wed Mar 11 06:31:32.669857 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "<frozen importlib._bootstrap_external>", line 665, in exec_module
[Wed Mar 11 06:31:32.669861 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
[Wed Mar 11 06:31:32.669866 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/usr/local/lib/python3.5/dist-packages/polls/models.py", line 14, in <module>
[Wed Mar 11 06:31:32.669869 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] class Choice(models.Model):
[Wed Mar 11 06:31:32.669873 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] File "/usr/local/lib/python3.5/dist-packages/polls/models.py", line 15, in Choice
[Wed Mar 11 06:31:32.669886 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] question = models.ForeignKey(Question)
[Wed Mar 11 06:31:32.669900 2020] [wsgi:error] [pid 14849:tid 140433834096384] [remote 10.150.29.220:33874] TypeError: __init__() missing 1 required positional argument: 'on_delete'
[Wed Mar 11 06:31:47.868251 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] mod_wsgi (pid=15027): Target WSGI script '/home/nigsdtm/srv/portal/mysite/wsgi.py' cannot be loaded as Python module.
[Wed Mar 11 06:31:47.868326 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] mod_wsgi (pid=15027): Exception occurred processing WSGI script '/home/nigsdtm/srv/portal/mysite/wsgi.py'.
[Wed Mar 11 06:31:47.869029 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] Traceback (most recent call last):
[Wed Mar 11 06:31:47.869078 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/home/nigsdtm/srv/portal/mysite/wsgi.py", line 16, in <module>
[Wed Mar 11 06:31:47.869082 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] application = get_wsgi_application()
[Wed Mar 11 06:31:47.869087 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Wed Mar 11 06:31:47.869090 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] django.setup(set_prefix=False)
[Wed Mar 11 06:31:47.869098 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 24, in setup
[Wed Mar 11 06:31:47.869101 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] apps.populate(settings.INSTALLED_APPS)
[Wed Mar 11 06:31:47.869105 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/usr/local/lib/python3.5/dist-packages/django/apps/registry.py", line 112, in populate
[Wed Mar 11 06:31:47.869108 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] app_config.import_models()
[Wed Mar 11 06:31:47.869112 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/usr/local/lib/python3.5/dist-packages/django/apps/config.py", line 198, in import_models
[Wed Mar 11 06:31:47.869115 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] self.models_module = import_module(models_module_name)
[Wed Mar 11 06:31:47.869119 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
[Wed Mar 11 06:31:47.869122 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] return _bootstrap._gcd_import(name[level:], package, level)
[Wed Mar 11 06:31:47.869127 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "<frozen importlib._bootstrap>", line 986, in _gcd_import
[Wed Mar 11 06:31:47.869132 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "<frozen importlib._bootstrap>", line 969, in _find_and_load
[Wed Mar 11 06:31:47.869136 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
[Wed Mar 11 06:31:47.869141 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
[Wed Mar 11 06:31:47.869146 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "<frozen importlib._bootstrap_external>", line 665, in exec_module
[Wed Mar 11 06:31:47.869158 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
[Wed Mar 11 06:31:47.869163 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/usr/local/lib/python3.5/dist-packages/polls/models.py", line 14, in <module>
[Wed Mar 11 06:31:47.869166 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] class Choice(models.Model):
[Wed Mar 11 06:31:47.869170 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] File "/usr/local/lib/python3.5/dist-packages/polls/models.py", line 15, in Choice
[Wed Mar 11 06:31:47.869172 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] question = models.ForeignKey(Question)
[Wed Mar 11 06:31:47.869186 2020] [wsgi:error] [pid 15027:tid 140380136130304] [remote 10.150.29.220:57041] TypeError: __init__() missing 1 required positional argument: 'on_delete'
[Wed Mar 11 06:31:48.530646 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] mod_wsgi (pid=15027): Target WSGI script '/home/nigsdtm/srv/portal/mysite/wsgi.py' cannot be loaded as Python module.
[Wed Mar 11 06:31:48.530748 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] mod_wsgi (pid=15027): Exception occurred processing WSGI script '/home/nigsdtm/srv/portal/mysite/wsgi.py'.
[Wed Mar 11 06:31:48.530861 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] Traceback (most recent call last):
[Wed Mar 11 06:31:48.530888 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] File "/home/nigsdtm/srv/portal/mysite/wsgi.py", line 16, in <module>
[Wed Mar 11 06:31:48.530891 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] application = get_wsgi_application()
[Wed Mar 11 06:31:48.530897 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Wed Mar 11 06:31:48.530897 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Wed Mar 11 06:31:48.530899 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] django.setup(set_prefix=False)
[Wed Mar 11 06:31:48.530904 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 24, in setup
[Wed Mar 11 06:31:48.530907 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] apps.populate(settings.INSTALLED_APPS)
[Wed Mar 11 06:31:48.530911 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] File "/usr/local/lib/python3.5/dist-packages/django/apps/registry.py", line 81, in populate
[Wed Mar 11 06:31:48.530914 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] raise RuntimeError("populate() isn't reentrant")
[Wed Mar 11 06:31:48.530927 2020] [wsgi:error] [pid 15027:tid 140380018607872] [remote 10.150.29.220:42180] RuntimeError: populate() isn't reentrant
This is my apache2 config file:
Listen 80
<VirtualHost *:80>
ServerAdmin alexandru.bran#nokia.com
ServerName app.gdceur.eecloud.dynamic.nsn-net.net
DocumentRoot /home/nigsdtm/srv
Alias /static /home/nigsdtm/srv/portal/mysite/static
<Directory "/home/nigsdtm/srv/portal/mysite/static">
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/portal_error.log
CustomLog ${APACHE_LOG_DIR}/portal_access.log combined
WSGIDaemonProcess mysite python-home=/home/nigsdtm/srv/portal/ python-path=/home/nigsdtm/srv/portal/venv
WSGIProcessGroup mysite
WSGIScriptAlias / /home/nigsdtm/srv/portal/mysite/wsgi.py
<Directory /home/nigsdtm/srv/portal/mysite>
<Files wsgi.py>
Allow from all
</Files>
</Directory>
</VirtualHost>
This is my wsgi file:
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
application = get_wsgi_application()
Project folder name (where manage.py is) is called 'portal'
Folder containing wsgi: 'mysite'
App works if I run server from python environment.
I am running Django 2.1.15 with Python 3.5.2
Could you please give me a hint?
Thanks,
Alexandru
I see this line of error:
TypeError: __init__() missing 1 required positional argument: 'on_delete'
This one I recognized as a missing on_delete statement in a ForeignKey attribute.
According to Django2 changelog:
The on_delete argument for ForeignKey and OneToOneField is now required in models and migrations. Consider squashing migrations so that you have fewer of them to update.
You might have developed your application on Django1 and trying to deploy it with Django2.
You should check that you installed the same dependencies on your production server than on your development machine.
I'm tryign to get a Django application with Python 3.7 working with CentOS 7 and Apache (Mod WSGI). I have a project with a virtual environment set up. How do I turn off SqlLite? I'm not and don't intend to ever use it. I tried running
(dentalenv) [root#server Python-3.7.2]# sudo yum install libsqlite3-dev
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.us-midwest-1.nexcess.net
* epel: mirror.steadfastnet.com
* extras: mirror.us-midwest-1.nexcess.net
* updates: mirror.us-midwest-1.nexcess.net
No package libsqlite3-dev available.
Error: Nothing to do
to install it and then restarting my Apache server. I even rebuilt Python, but I still get the below error, "ModuleNotFoundError: No module named '_sqlite3'"
[Wed Feb 20 04:03:06.627020 2019] [wsgi:error] [pid 11885] Traceback (most recent call last):
[Wed Feb 20 04:03:06.627285 2019] [wsgi:error] [pid 11885] File "/var/www/html/dental/wsgi.py", line 25, in <module>
[Wed Feb 20 04:03:06.627323 2019] [wsgi:error] [pid 11885] application = get_wsgi_application()
[Wed Feb 20 04:03:06.627353 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Wed Feb 20 04:03:06.627378 2019] [wsgi:error] [pid 11885] django.setup(set_prefix=False)
[Wed Feb 20 04:03:06.627405 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
[Wed Feb 20 04:03:06.627429 2019] [wsgi:error] [pid 11885] apps.populate(settings.INSTALLED_APPS)
[Wed Feb 20 04:03:06.627467 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/apps/registry.py", line 112, in populate
[Wed Feb 20 04:03:06.627493 2019] [wsgi:error] [pid 11885] app_config.import_models()
[Wed Feb 20 04:03:06.627520 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/apps/config.py", line 198, in import_models
[Wed Feb 20 04:03:06.627544 2019] [wsgi:error] [pid 11885] self.models_module = import_module(models_module_name)
[Wed Feb 20 04:03:06.627571 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/importlib/__init__.py", line 127, in import_module
[Wed Feb 20 04:03:06.627608 2019] [wsgi:error] [pid 11885] return _bootstrap._gcd_import(name[level:], package, level)
[Wed Feb 20 04:03:06.627636 2019] [wsgi:error] [pid 11885] File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
[Wed Feb 20 04:03:06.627666 2019] [wsgi:error] [pid 11885] File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[Wed Feb 20 04:03:06.627695 2019] [wsgi:error] [pid 11885] File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[Wed Feb 20 04:03:06.627724 2019] [wsgi:error] [pid 11885] File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
[Wed Feb 20 04:03:06.627754 2019] [wsgi:error] [pid 11885] File "<frozen importlib._bootstrap_external>", line 728, in exec_module
[Wed Feb 20 04:03:06.627783 2019] [wsgi:error] [pid 11885] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Wed Feb 20 04:03:06.627812 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/contrib/auth/models.py", line 2, in <module>
[Wed Feb 20 04:03:06.627835 2019] [wsgi:error] [pid 11885] from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
[Wed Feb 20 04:03:06.627861 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 47, in <module>
[Wed Feb 20 04:03:06.627884 2019] [wsgi:error] [pid 11885] class AbstractBaseUser(models.Model):
[Wed Feb 20 04:03:06.627910 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/db/models/base.py", line 101, in __new__
[Wed Feb 20 04:03:06.627933 2019] [wsgi:error] [pid 11885] new_class.add_to_class('_meta', Options(meta, app_label))
[Wed Feb 20 04:03:06.627958 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/db/models/base.py", line 305, in add_to_class
[Wed Feb 20 04:03:06.627981 2019] [wsgi:error] [pid 11885] value.contribute_to_class(cls, name)
[Wed Feb 20 04:03:06.628008 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/db/models/options.py", line 203, in contribute_to_class
[Wed Feb 20 04:03:06.628031 2019] [wsgi:error] [pid 11885] self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
[Wed Feb 20 04:03:06.628058 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/db/__init__.py", line 33, in __getattr__
[Wed Feb 20 04:03:06.628081 2019] [wsgi:error] [pid 11885] return getattr(connections[DEFAULT_DB_ALIAS], item)
[Wed Feb 20 04:03:06.628107 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/db/utils.py", line 202, in __getitem__
[Wed Feb 20 04:03:06.628132 2019] [wsgi:error] [pid 11885] backend = load_backend(db['ENGINE'])
[Wed Feb 20 04:03:06.628159 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/db/utils.py", line 110, in load_backend
[Wed Feb 20 04:03:06.628193 2019] [wsgi:error] [pid 11885] return import_module('%s.base' % backend_name)
[Wed Feb 20 04:03:06.628222 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/importlib/__init__.py", line 127, in import_module
[Wed Feb 20 04:03:06.628243 2019] [wsgi:error] [pid 11885] return _bootstrap._gcd_import(name[level:], package, level)
[Wed Feb 20 04:03:06.628264 2019] [wsgi:error] [pid 11885] File "/var/www/html/dentalenv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 10, in <module>
[Wed Feb 20 04:03:06.628283 2019] [wsgi:error] [pid 11885] from sqlite3 import dbapi2 as Database
[Wed Feb 20 04:03:06.628304 2019] [wsgi:error] [pid 11885] File "/usr/local/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
[Wed Feb 20 04:03:06.628323 2019] [wsgi:error] [pid 11885] from sqlite3.dbapi2 import *
[Wed Feb 20 04:03:06.628344 2019] [wsgi:error] [pid 11885] File "/usr/local/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
[Wed Feb 20 04:03:06.628369 2019] [wsgi:error] [pid 11885] from _sqlite3 import *
[Wed Feb 20 04:03:06.628408 2019] [wsgi:error] [pid 11885] ModuleNotFoundError: No module named '_sqlite3'
[Wed Feb 20 04:03:09.130480 2019] [wsgi:error] [pid 11885] [remote 207.181.224.155:58106] mod_wsgi (pid=11885): Target WSGI script '/var/www/html/dental/wsgi.py' does not contain WSGI application 'application'.
I have setup a Django project with Apache2 and mod_wsgi on Ubuntu 16.04 instance of AWS. Now I am getting urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetErr or(104, 'Connection reset by peer')) error when I try to access mysite.
I have tried almost everything suggested on stackoverflow and other link. but get no luck.
[Mon Jan 28 21:02:52.263398 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] Traceback (most recent call last):
[Mon Jan 28 21:02:52.263457 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
[Mon Jan 28 21:02:52.263537 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] chunked=chunked)
[Mon Jan 28 21:02:52.263613 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
[Mon Jan 28 21:02:52.263655 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] six.raise_from(e, None)
[Mon Jan 28 21:02:52.263707 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "<string>", line 2, in raise_from
[Mon Jan 28 21:02:52.263760 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 380, in _make_request
[Mon Jan 28 21:02:52.263799 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] httplib_response = conn.getresponse()
[Mon Jan 28 21:02:52.263851 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
[Mon Jan 28 21:02:52.263903 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response.begin()
[Mon Jan 28 21:02:52.263943 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 297, in begin
[Mon Jan 28 21:02:52.263995 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] version, status, reason = self._read_status()
[Mon Jan 28 21:02:52.264032 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
[Mon Jan 28 21:02:52.264086 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[Mon Jan 28 21:02:52.264129 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/socket.py", line 586, in readinto
[Mon Jan 28 21:02:52.264165 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self._sock.recv_into(b)
[Mon Jan 28 21:02:52.264200 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] ConnectionResetError: [Errno 104] Connection reset by peer
[Mon Jan 28 21:02:52.264234 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898]
[Mon Jan 28 21:02:52.264268 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] During handling of the above exception, another exception occurred:
[Mon Jan 28 21:02:52.302940 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898]
[Mon Jan 28 21:02:52.302961 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] Traceback (most recent call last):
[Mon Jan 28 21:02:52.302991 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/core/handlers/except ion.py", line 34, in inner
[Mon Jan 28 21:02:52.302994 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = get_response(request)
[Mon Jan 28 21:02:52.302996 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/core/handlers/base.p y", line 126, in _get_response
[Mon Jan 28 21:02:52.302999 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = self.process_exception_by_middleware(e, request)
[Mon Jan 28 21:02:52.303001 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/core/handlers/base.p y", line 124, in _get_response
[Mon Jan 28 21:02:52.303004 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Mon Jan 28 21:02:52.303006 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/views/decorators/csr f.py", line 54, in wrapped_view
[Mon Jan 28 21:02:52.303009 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return view_func(*args, **kwargs)
[Mon Jan 28 21:02:52.303011 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/home/jshree/Dscrapper/soqqlesocial/data_scrapper/views.py", line 63 , in request_page
[Mon Jan 28 21:02:52.303014 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] twitter.scrap_tweets(rDate, rDatePre, uName, lName)
[Mon Jan 28 21:02:52.303017 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/home/jshree/Dscrapper/soqqlesocial/twitter.py", line 48, in scrap_t weets
[Mon Jan 28 21:02:52.303019 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] drw = webdriver.Chrome(executable_path='/usr/bin/chromedriver', options= options)
[Mon Jan 28 21:02:52.303021 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/chrome/w ebdriver.py", line 81, in __init__
[Mon Jan 28 21:02:52.303024 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] desired_capabilities=desired_capabilities)
[Mon Jan 28 21:02:52.303026 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/w ebdriver.py", line 157, in __init__
[Mon Jan 28 21:02:52.303029 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] self.start_session(capabilities, browser_profile)
[Mon Jan 28 21:02:52.303031 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/w ebdriver.py", line 252, in start_session
[Mon Jan 28 21:02:52.303034 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = self.execute(Command.NEW_SESSION, parameters)
[Mon Jan 28 21:02:52.303036 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/w ebdriver.py", line 319, in execute
[Mon Jan 28 21:02:52.303038 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = self.command_executor.execute(driver_command, params)
[Mon Jan 28 21:02:52.303041 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/r emote_connection.py", line 374, in execute
[Mon Jan 28 21:02:52.303043 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self._request(command_info[0], url, body=data)
[Mon Jan 28 21:02:52.303048 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/r emote_connection.py", line 397, in _request
[Mon Jan 28 21:02:52.303051 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] resp = self._conn.request(method, url, body=body, headers=headers)
[Mon Jan 28 21:02:52.303053 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/request.py", line 7 2, in request
[Mon Jan 28 21:02:52.303056 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] **urlopen_kw)
[Mon Jan 28 21:02:52.303058 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/request.py", line 1 50, in request_encode_body
[Mon Jan 28 21:02:52.303060 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self.urlopen(method, url, **extra_kw)
[Mon Jan 28 21:02:52.303063 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/poolmanager.py", li ne 323, in urlopen
[Mon Jan 28 21:02:52.303065 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = conn.urlopen(method, u.request_uri, **kw)
[Mon Jan 28 21:02:52.303067 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
[Mon Jan 28 21:02:52.303070 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] _stacktrace=sys.exc_info()[2])
[Mon Jan 28 21:02:52.303072 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/util/retry.py", lin e 367, in increment
[Mon Jan 28 21:02:52.303075 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] raise six.reraise(type(error), error, _stacktrace)
[Mon Jan 28 21:02:52.303077 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/packages/six.py", l ine 685, in reraise
[Mon Jan 28 21:02:52.303079 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] raise value.with_traceback(tb)
[Mon Jan 28 21:02:52.303082 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
[Mon Jan 28 21:02:52.303084 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] chunked=chunked)
[Mon Jan 28 21:02:52.303086 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
[Mon Jan 28 21:02:52.303089 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] six.raise_from(e, None)
[Mon Jan 28 21:02:52.303091 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "<string>", line 2, in raise_from
[Mon Jan 28 21:02:52.303093 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 380, in _make_request
[Mon Jan 28 21:02:52.303096 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] httplib_response = conn.getresponse()
[Mon Jan 28 21:02:52.303098 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
[Mon Jan 28 21:02:52.303100 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response.begin()
[Mon Jan 28 21:02:52.303105 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 297, in begin
[Mon Jan 28 21:02:52.303107 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] version, status, reason = self._read_status()
[Mon Jan 28 21:02:52.303110 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
[Mon Jan 28 21:02:52.303112 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[Mon Jan 28 21:02:52.303114 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/socket.py", line 586, in readinto
[Mon Jan 28 21:02:52.303117 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self._sock.recv_into(b)
[Mon Jan 28 21:02:52.303124 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetErr or(104, 'Connection reset by peer'))
update
I have used request-timeout flag in apache conf file by which I have got rid of this error but still getting 504 Gateway Time-out error page after a some time of wait. Any idea to get rid of this or handle it.
hey I'm trying to deploy my first django app on aws beanstalk
but I'm getting an :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root#localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
I'm following this tutorial:
https://realpython.com/deploying-a-django-app-to-aws-elastic-beanstalk/
I use python 3.6 and django 1.11
I just create a blank django project
part of log
-------------------------------------
/var/log/httpd/error_log
-------------------------------------
[Mon May 21 18:37:58.898238 2018] [:error] [pid 3353] [remote 172.31.30.216:17272] ModuleNotFoundError: No module named 'alpha_app.settings'
[Mon May 21 18:38:13.914282 2018] [:error] [pid 3353] [remote 172.31.30.216:120] mod_wsgi (pid=3353): Target WSGI script '/opt/python/current/app/alpha_app/alpha_app/wsgi.py' cannot be loaded as Python module.
[Mon May 21 18:38:13.914343 2018] [:error] [pid 3353] [remote 172.31.30.216:120] mod_wsgi (pid=3353): Exception occurred processing WSGI script '/opt/python/current/app/alpha_app/alpha_app/wsgi.py'.
[Mon May 21 18:38:13.914484 2018] [:error] [pid 3353] [remote 172.31.30.216:120] Traceback (most recent call last):
[Mon May 21 18:38:13.914527 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "/opt/python/current/app/alpha_app/alpha_app/wsgi.py", line 16, in <module>
[Mon May 21 18:38:13.914531 2018] [:error] [pid 3353] [remote 172.31.30.216:120] application = get_wsgi_application()
[Mon May 21 18:38:13.914547 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Mon May 21 18:38:13.914550 2018] [:error] [pid 3353] [remote 172.31.30.216:120] django.setup(set_prefix=False)
[Mon May 21 18:38:13.914556 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 22, in setup
[Mon May 21 18:38:13.914559 2018] [:error] [pid 3353] [remote 172.31.30.216:120] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Mon May 21 18:38:13.914563 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
[Mon May 21 18:38:13.914566 2018] [:error] [pid 3353] [remote 172.31.30.216:120] self._setup(name)
[Mon May 21 18:38:13.914571 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 41, in _setup
[Mon May 21 18:38:13.914574 2018] [:error] [pid 3353] [remote 172.31.30.216:120] self._wrapped = Settings(settings_module)
[Mon May 21 18:38:13.914578 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 110, in __init__
[Mon May 21 18:38:13.914581 2018] [:error] [pid 3353] [remote 172.31.30.216:120] mod = importlib.import_module(self.SETTINGS_MODULE)
[Mon May 21 18:38:13.914585 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Mon May 21 18:38:13.914588 2018] [:error] [pid 3353] [remote 172.31.30.216:120] return _bootstrap._gcd_import(name[level:], package, level)
[Mon May 21 18:38:13.914593 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Mon May 21 18:38:13.914598 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Mon May 21 18:38:13.914602 2018] [:error] [pid 3353] [remote 172.31.30.216:120] File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[Mon May 21 18:38:13.914617 2018] [:error] [pid 3353] [remote 172.31.30.216:120] ModuleNotFoundError: No module named 'alpha_app.settings'
I think this error comes from the wsgi.py file
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "alpha_app.settings")
but i have no clue how to fix it
I have found the solution to my own problem.
I forgot to make an extra folder named .ebextensions
and kept everything in the folder .elasticbeanstalk
Apparently I can not read.
I just hope my mistake can save someone hours.
I try to deploy Django application under Django 1.8 and Apache mod_wsgi (python 3.4.3, ubuntu 14.04)
I have solved the previous error with import ( Django WSGI deployment. cannot import name 'SimpleCookie' ) but then I meet another one:
Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named '_sqlite3'
Here bigger piece of the error log:
[Wed Jun 10 18:33:44.021939 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 1448, in exec_module
[Wed Jun 10 18:33:44.021960 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Wed Jun 10 18:33:44.022198 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/contrib/auth/models.py", line 41, in <module>
[Wed Jun 10 18:33:44.022207 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] class Permission(models.Model):
[Wed Jun 10 18:33:44.022760 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/db/models/base.py", line 139, in __new__
[Wed Jun 10 18:33:44.022770 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] new_class.add_to_class('_meta', Options(meta, **kwargs))
[Wed Jun 10 18:33:44.022807 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/db/models/base.py", line 324, in add_to_class
[Wed Jun 10 18:33:44.022814 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] value.contribute_to_class(cls, name)
[Wed Jun 10 18:33:44.023151 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/db/models/options.py", line 250, in contribute_to_class
[Wed Jun 10 18:33:44.023161 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
[Wed Jun 10 18:33:44.023296 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/db/__init__.py", line 36, in __getattr__
[Wed Jun 10 18:33:44.023304 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] return getattr(connections[DEFAULT_DB_ALIAS], item)
[Wed Jun 10 18:33:44.023514 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/db/utils.py", line 240, in __getitem__
[Wed Jun 10 18:33:44.023558 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] backend = load_backend(db['ENGINE'])
[Wed Jun 10 18:33:44.023603 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/db/utils.py", line 111, in load_backend
[Wed Jun 10 18:33:44.023610 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] return import_module('%s.base' % backend_name)
[Wed Jun 10 18:33:44.023642 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Wed Jun 10 18:33:44.023649 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] return _bootstrap._gcd_import(name[level:], package, level)
[Wed Jun 10 18:33:44.023669 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
[Wed Jun 10 18:33:44.023690 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
[Wed Jun 10 18:33:44.023711 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
[Wed Jun 10 18:33:44.023732 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
[Wed Jun 10 18:33:44.023752 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 1129, in _exec
[Wed Jun 10 18:33:44.023773 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 1448, in exec_module
[Wed Jun 10 18:33:44.023793 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
[Wed Jun 10 18:33:44.023826 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] File "/var/www/.virtualenvs/cp/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", line 36, in <module>
[Wed Jun 10 18:33:44.023833 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)
[Wed Jun 10 18:33:44.023862 2015] [:error] [pid 19282:tid 140071189554944] [client 192.168.1.1:16780] django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named '_sqlite3'
When running development server no errors appear. There is no errors as well when running in python interpreter in virtualenv cp
>>>import sqlite3
My wsgi.py file is:
import os, sys, site
sys.path.insert(0,'/var/www/.virtualenvs/cp/lib/python3.4/site-packages')
sys.path.insert(0,'/var/www/django_projects/cp')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
exec(open("/var/www/.virtualenvs/cp/bin/activate_this.py").read())
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Here is Apache's virtualhost's conf for the site:
<VirtualHost *:80>
ServerName cp.mysite.com
WSGIDaemonProcess cp user=www-data group=www-data threads=5
WSGIApplicationGroup cp
WSGIScriptAlias / /var/www/django_projects/cp/mysite/wsgi.py
<Directory /var/www/django_projects/cp/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
ErrorLog /var/www/errlogs/cperror.log
</VirtualHost>
Finaly, after making a debug with a help of simple wsgi.py (thanks to #GrahamDumpleton for the link), I've found that my resulting sys.path is not too clean.
So I have manually changed sys.path in wsgi.py taking it from python started in virtualenv cp and then added project directory to this list at the begining in wsgi.py:
import os, sys
virtual_env = '/var/www/.virtualenvs/cp'
sys.path=['%s/lib/python34.zip' % (virtual_env,),
'%s/lib/python3.4' % (virtual_env,),
'%s/lib/python3.4/plat-linux' % (virtual_env,),
'%s/lib/python3.4/lib-dynload' % (virtual_env,),
'%s/lib/python3.4/site-packages' % (virtual_env,),
#'/var/www/python/3.4.3/lib/python3.4',
]
sys.path.insert(0,'/var/www/django_projects/cp')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Possibly this is not the "best practice" solution, but it does remove magic functions and easy to understand and repeat for new user like me :)