I have two sites, site-one is a django app and site-two is a wordpress site.
I have two .conf files inside /etc/apache2/sites-available:
site-one.com.conf
<VirtualHost *:80>
ServerAdmin adminmail#gmail.com
ServerName site-one.com
ServerAlias www.site-one.com
DocumentRoot /var/www/site-one.com/public_html
ErrorLog ${APACHE_LOG_DIR}/site-one.com.error.log
CustomLog ${APACHE_LOG_DIR}/site-one.com.access.log combined
Alias /static /var/www/site-one.com/public_html/static
<Directory /var/www/site-one.com/public_html/static>
Require all granted
</Directory>
<Directory /var/www/site-one.com/public_html/MyApp>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /var/www/site-one.com/public_html/MyApp/wsgi.py
WSGIDaemonProcess django_app python-path=/var/www/site-one.com/public_html
WSGIProcessGroup django_app
</VirtualHost>
site-two.com.conf
<VirtualHost *:80>
ServerAdmin adminmail#gmail.com
ServerName site-two.com
ServerAlias www.site-two.com
DocumentRoot /var/www/site-two.com/public_html
ErrorLog ${APACHE_LOG_DIR}/site-two.com.error.log
CustomLog ${APACHE_LOG_DIR}/site-two.com.access.log combined
</VirtualHost>
The site-one.com is 100% working but when I load site-two.com I get this error:
Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.
The site-two.com.error.log shows this:
[Mon Nov 02 09:09:48.629460 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] mod_wsgi (pid=2396): Failed to exec Python script file '/var/www/site-one.com/public_html/MyApp/wsgi.py'.
[Mon Nov 02 09:09:48.631915 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] mod_wsgi (pid=2396): Exception occurred processing WSGI script '/var/www/site-one.com/public_html/MyApp/wsgi.py'.
[Mon Nov 02 09:09:48.632702 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] Traceback (most recent call last):
[Mon Nov 02 09:09:48.632776 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "/var/www/site-one.com/public_html/MyApp/wsgi.py", line 16, in <module>
[Mon Nov 02 09:09:48.632784 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] application = get_wsgi_application()
[Mon Nov 02 09:09:48.632794 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "/usr/local/lib/python3.8/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Mon Nov 02 09:09:48.632799 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] django.setup(set_prefix=False)
[Mon Nov 02 09:09:48.632808 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "/usr/local/lib/python3.8/dist-packages/django/__init__.py", line 19, in setup
[Mon Nov 02 09:09:48.632813 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Mon Nov 02 09:09:48.632822 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 83, in __getattr__
[Mon Nov 02 09:09:48.632827 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] self._setup(name)
[Mon Nov 02 09:09:48.632835 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 70, in _setup
[Mon Nov 02 09:09:48.632840 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] self._wrapped = Settings(settings_module)
[Mon Nov 02 09:09:48.632849 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 177, in __init__
[Mon Nov 02 09:09:48.632854 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] mod = importlib.import_module(self.SETTINGS_MODULE)
[Mon Nov 02 09:09:48.632862 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[Mon Nov 02 09:09:48.632867 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] return _bootstrap._gcd_import(name[level:], package, level)
[Mon Nov 02 09:09:48.632875 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[Mon Nov 02 09:09:48.632884 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[Mon Nov 02 09:09:48.632893 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
[Mon Nov 02 09:09:48.632902 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Mon Nov 02 09:09:48.632910 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[Mon Nov 02 09:09:48.632919 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[Mon Nov 02 09:09:48.632928 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
[Mon Nov 02 09:09:48.632948 2020] [wsgi:error] [pid 2396] [remote 151.49.10.216:63056] ModuleNotFoundError: No module named 'MyApp'
I am not an expert on apache config files so I can't understand why WSGI is called when I'm requesting site-two.
How can I solve this problem?
The site-one.com.eror.log file is empty by the way
Django project deploy with apache, the apache is running, but its shows error and dependency is already install
[Wed Dec 12 10:59:32.115495 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 13, i$
[Wed Dec 12 10:59:32.115497 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] django.setup(set_prefix=False), referer: http://13.127.165.50/en/admin/
[Wed Dec 12 10:59:32.115501 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 27, in$
[Wed Dec 12 10:59:32.115503 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] apps.populate(settings.INSTALLED_APPS), referer: http://13.127.165.50/en/ad$
[Wed Dec 12 10:59:32.115507 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "/usr/local/lib/python3.5/dist-packages/django/apps/registry.py", line 8$
[Wed Dec 12 10:59:32.115509 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] app_config = AppConfig.create(entry), referer: http://13.127.165.50/en/admi$
[Wed Dec 12 10:59:32.115513 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "/usr/local/lib/python3.5/dist-packages/django/apps/config.py", line 94,$
[Wed Dec 12 10:59:32.115515 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] module = import_module(entry), referer: http://13.127.165.50/en/admin/
[Wed Dec 12 10:59:32.115518 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module, $
[Wed Dec 12 10:59:32.115521 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] return _bootstrap._gcd_import(name[level:], package, level), referer: http:$
[Wed Dec 12 10:59:32.115524 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "<frozen importlib._bootstrap>", line 986, in _gcd_import, referer: http$
[Wed Dec 12 10:59:32.115534 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "<frozen importlib._bootstrap>", line 969, in _find_and_load, referer: h$
[Wed Dec 12 10:59:32.115538 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked, r$
[Wed Dec 12 10:59:32.115550 2018] [wsgi:error] [pid 20200:tid 140575906928384] [client 103.3.228.58:42384] ImportError: No module named 'djangocms_text_ckeditor', referer: http://13.127.$
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'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.
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 :)