• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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