Tuesday 4 August 2020

AWS lightsail for Django and Wagtail project.

I was looking for somewhere to host my code so that I could use it from wherever I want.  Just for myself at this stage and as AWS were offering a free month.   So I thought I’d review it here.
Unfortunately though I didn’t get to the point I wanted to with it , so have now ditched it.   I think it’d be worth other developers considering my issues and finding resolutions for these before you end up wasting your time as well.
https://aws.amazon.com/getting-started/hands-on/deploy-python-application/
and the first steps here.  
https://www.youtube.com/watch?v=-rO67fTzVBc

The initial part of setting up a Django project on Lightsail was really straightforward, using the instructions here. 

1. Create a Lightsail instance

2. Deploy a project - I deployed my own custom Django code here. 

3. Using the ‘connect SSH’ I could git clone the project I was working on from Github

4.However for the moment I had to disable everything ‘Wagtail’ in my project to get it working. 

5. In the instruction above and following ‘Test the application’    


At this point I can get a website that I can see and access from anywhere using


‘cd /opt/bitnami/apps/django/django_projects/django_sb_goals/ && python3 manage.py runserver 0.0.0.0:8000”


However only while I have the SSH window open on my computer, once I shut this down it stops working.


The solution for which I was hoping would be by following the instructions ‘Host the application using Apache ‘ .  I reviewed these instructions a number of times and could not get them to work.


I also spent the best part of a working day Googling and searching for a solution .  With no success.


The other problem - Getting Wagtail to work .  As I could not ‘pip install wagtail’ I would have needed to change a fair bit of code.  Considering this and the first issue, and that I’d already wasted a lot of Dev time I decided to abandon using AWS lightsail as my hosting solution.


I’d be interested to find out the resolutions to these issues if anyone knows why I struggled, or other hosting recommendations. 


No comments: