Question

Setting up Python/Django project to run www.blah.com/directory

Posted April 16, 2015 1.7k views
UbuntuPythonDjango

Hey Guys,

I’ve been digging around stackoverflow, DO, and reddit for an answer. Most of my attempts have failed. I am looking to run a Python/Django via either a subdomain or directory (which ever is easier).

How do I accomplish this? (LAMP Ubuntu image, Django running on it as well)

Thus far it only runs via www.blah.com:port

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.

×
1 answer

There are a few ways that you could do this. If you are already running Apache, then using mod_wsgi might be a good approach. This tutorial takes you through its installation and configuration. It should point you in the right direction:

To set it up in a sub-domain, you’ll need to use a separate VirtualHost.

Let us know how it goes, and if you run into any problems.

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
Submit an Answer