• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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