Answer the question
In order to leave comments, you need to log in
ImportError: No module named myproject.wsgi. How to fix?
Good day. I want to raise the project on the server. I am using Gunicorn+Nginx.
Setting up Nginx
server {
listen 80;
server_name 'server ip';
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/user/sites/project;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/user/sites/project/myproject/myproject.sock;
}
}
description "Gunicorn desc"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid usr
setgid www-data
chdir /home/usr/sites/project
exec env/bin/gunicorn --workers 3 --bind unix:/home/usr/sites/project/myproject/myproject.sock myproject.wsgi:application
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
application = get_wsgi_application()
WSGI_APPLICATION = 'myproject.wsgi.application'
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