• 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.

Plesk and Django

David Turner

New Pleskian
I have a django project which I am deploying to my server. This is a combination of nginx/apache running on CentOS6.5. The project is running fine in a virtual environment using this combination. My issue is when I come to deploy it, how do I amend the nginx configuration to serve the static files?

Without Plesk I would edit the /ect/nginx/conf.d/"virtualhost" file. However, as I understand it this is not how you do it with Plesk. Any help would be apprecited or any recommendations for alternatives.

Thanks in advance.
 
I apologise for the mistaken comment in thinking you for you previous answer. We decided to go down a different route

I have built a django app which runs in a container using Centos Apache and Nginx. Everything works fine.

On our server we have Centos and Plesk with Apache and Nginx. I have installed Python3.4 whilst maintaining the system python so everything is fine at this stage.

I have then installed pip and django and uploaded the django project. this is running on a sub-domain e.g
var/www/vhosts/mainsite/sub-domain
I have checked that this is working
$uwsgi --http :8000 --module testsite.wsgi
Again everything works fine.
Having read the Plesk documentation I understand that to add directives to the virtual host I have to add them to either:
vhost.conf
vhost_nginx.conf
in the var/www/vhosts/system/testsite
However when I come to add the following which works I get errors such as
“upstream" directive is not allowed here in /var/www/vhosts/system/testsite.vet-connect.co.uk/conf/vhost_nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed”
My directives form my local site on the virtual box server is as follows:
upstream django {
# server unix:///var/www/vhosts/maindomain/subdomain/testsite.socket
}
# configuration of the server
server {
# the port your site will be served on
listen 8000;
# the domain name it will serve for
server_name testsite
charset utf-8;

# max upload size
client_max_body_size 75M; # this is just to test

# Django media

location /static {
alias /var/www/vhosts/mainsite/testsite/djangoapp/static;
}

# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /var/www/vhosts/mainsite/testsite/dajngoapp/uwsgi_params;
}
}

Any help on this would be appreciated.
 
Back
Top