Skip to content Skip to sidebar Skip to footer

Host Django Application In The Lightsail's Built In Apache Server

I want to have a production ready Django app with Lighsail and for that I'm following two tutorials to achieve this Deploy Django-based application onto Amazon Lightsail Deploy A

Solution 1:

The problem here is in the mentioning of the paths for both the project and Django.

Actual Bitnami folder

In my case, projects are under /home/bitnami/projects/ where I created a Django project named tutorial.

Also, if I run the command

python -c "
import sys
sys.path = sys.path[1:]
import django
print(django.__path__)"

it'll print me the location where Django is installed

['/opt/bitnami/python/lib/python3.8/site-packages/django']

Bitnami opt folder not as expected

So, the httpd-app.conf should have instead at the end

Alias /tutorial/static "/opt/bitnami/python/lib/python3.8/site-packages/django/contrib/admin/static"
WSGIScriptAlias /tutorial '/home/bitnami/projects/tutorial/tutorial/wsgi.py'

Post a Comment for "Host Django Application In The Lightsail's Built In Apache Server"