• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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