Here's my folder structure:
~/myprojectdir
manage.py
myprojectenv/
bin/
activate
gunicorn
pip3
python3
...
lib/
python3.6
...
fishercoder/
fishercoder/
asgi.py
urls.py
settings.py
wsgi.py
__init__.py
...
blog/
views.py
urls.py
models.py
admin.py
apps.py
templates/
...
catalog/
views.py
urls.py
models.py
admin.py
apps.py
templates/
...
I have run source myprojectenv/bin/activate
Here's my /etc/systemd/system/gunicorn.service
file:
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=ubuntu
Group=www-data
WorkingDirectory=/home/ubuntu/myprojectdir
ExecStart=/home/ubuntu/myprojectdir/myprojectenv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
myproject.wsgi:application
[Install]
WantedBy=multi-user.target
I've replaced this line:
myproject.wsgi:application
with this
fishercoder.wsgi:application
or this
wsgi:application
following the suggestion from this question
Restarted Gunicorn. No luck in either.
My ~/myprojectdir/fishercoder/wsgi.py
looks like this:
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fishercoder.settings')
application = get_wsgi_application()
Any one could shed any light on this would be greatly appreciated!