Question

How to deploy django website in ubuntu 18.04 + plesk + apache

In my droplet is running several PHP websites, recently I tried to deploy a Django website that I build locally. But it’s doesn’t work properly.

I will explain the step that I did.

1, Pointed a Domain name to my droplet. 2, Added Domain name using Plesk Add Domain Option. 3, Uploaded the Django files to httpdocs by Plesk file manager. 4, Connected the server through ssh and type python manage.py runserver 0:8000 5, My Django Website is successfully running.

Here are the real issues occurs, We need to type exact port number to view the website every time. Eg:- **xyz.com:8000 **

As well as the Django webserver is down after sometimes.

I am newbie to Django all I have experience in deploying a PHP website. If my procedure is wrong please guide me to correct procedure.

Thanks in Advance.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @mrsreez,

What you could do is set up an Apache reverse proxy for this particular domain. That way you would not have to type the port specifically each time.

You can follow the steps here on how to set up a reverse proxy for Apache:

https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04

One important thing to keep in mind is, as you are using Plesk, you need to make sure that you follow the steps described here in order to correctly edit your Virtual Host configuration file:

https://docs.plesk.com/en-US/obsidian/advanced-administration-guide-linux/72064/

Another thing to try is to follow the steps from the official Plesk documentation on how to install Django applications on Plesk:

https://support.plesk.com/hc/en-us/articles/115002701209-How-to-allow-installing-and-install-Django-applications-

Hope that this helps! Let me know if you have any questions. Regards, Bobby