• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Deploy Django 1.10 project running Python 3.5 on Ubuntu 14.04 with Plesk 12

sfat

New Pleskian
I just finished my first Django project and wanted to deploy it to my virtual server running Ubuntu 14.04 64 bit and Plesk 12. At first, I wanted to use Phusion Passenger, as described in https://devblog.plesk.com/2014/10/plesk-and-django/. However, Phusion Passenger doesn't support Python 3. Therefore, I followed the official deployment instructions for WSGI (https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/). Unfortunately, I can't seem to get it up and running. What I did so far:

1) First I installed all the dependencies. Then I created a new subdomain in Plesk (myproject.example.com) and cloned my Git repository directly into the subdomain's root. My Django project uses a virtual environment. The basic folder structure is as follows:
Code:
.
├── app1
├── app2
├── env
├── myproject
└── static

So these folders currently reside in /var/www/vhosts/example.com/myproject.example.com/. As far as I understand, this is bad practice, but I wanted to follow the instructions as closely as possible.

2) Then I created a subdomain-specific Apache configuration file in /var/www/vhosts/system/myproject.example.com/conf/vhost.conf with the following content:
Code:
WSGIScriptAlias / /var/www/vhosts/example.com/myproject.example.com/myproject/wsgi.py
WSGIPythonPath /var/www/vhosts/example.com/myproject.example.com

<Directory /var/www/vhosts/example.com/myproject.example.com/myproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

I figured, even if the virtual environment is not yet set up, I should see something. So I restarted the Apache 2.4.7 server and checked http://myproject.example.com/. The response was
Code:
403 Forbidden
You don't have permission to access / on this server.

Clearly, there is something wrong with my setup, but I can't figure out what. The permissions seem fine:
Code:
drwxr-x---     myuser psaserv    myproject.example.com

drwxr-xr-x     myuser psacln     myproject

-rw-r--r--     myuser psacln     wsgi.py

I also tried adding the path to my virtual environment and using mod_wsgi daemon mode, without luck. Can someone please help me?
 
Back
Top