Answer the question
In order to leave comments, you need to log in
Deploy django project to virtual server, how to do it right??
In general, the server has python 2.6 python 3.5 and python 3.6
, there is also apache 2.2 version of
mod_wsgi-py35
and additional packages.
Apache config
<VirtualHost XXX.XXX.XXX.XXX:80>
ServerName sub.sample.com
ServerAlias www.sub.sample.com
ServerAlias webmail.sub.sample.com
ServerAlias admin.sub.sample.com
DocumentRoot /home/sample/public_html
ErrorLog /var/log/virtualmin/sub.sample.com_error_log
CustomLog /var/log/virtualmin/sub.sample.com_access_log combined
WSGIDaemonProcess voud python-home=/home/sample/public_html/projects_py/env/ python-path=/home/sample/public_html/ processes=1 maximum-requests=1 threads=1
WSGIProcessGroup %{GLOBAL}
WSGIScriptAlias / /home/sample/public_html/projects_py/sample/sample/wsgi.py process-group=%{GLOBAL}
<Directory /home/sample/public_html/projects_py/sample/sample>
<Files wsgi.py>
allow from all
</Files>
</Directory>
</VirtualHost>
WSGISocketPrefix /run/wsgi
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sample.settings")
application = get_wsgi_application()
[Thu Jun 07 17:30:58 2018] [error] File "<frozen importlib._bootstrap>", line 985, in _gcd_import
[Thu Jun 07 17:30:58 2018] [error] File "<frozen importlib._bootstrap>", line 968, in _find_and_load
[Thu Jun 07 17:30:58 2018] [error] File "<frozen importlib._bootstrap>", line 943, in _find_and_load_unlocked
[Thu Jun 07 17:30:58 2018] [error] File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
[Thu Jun 07 17:30:58 2018] [error] File "<frozen importlib._bootstrap>", line 985, in _gcd_import
[Thu Jun 07 17:30:58 2018] [error] File "<frozen importlib._bootstrap>", line 968, in _find_and_load
[Thu Jun 07 17:30:58 2018] [error] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Thu Jun 07 17:30:58 2018] [error] ImportError: No module named 'sample'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question