I’ve been learning Django for the past couple of years and I’m now ready to implement it as a backend solution. For someone who has always worked on the front end it’s a fabulous framework - especially for sole traders like myself.
The one issue I’m finding with Django is hosting. My shared hosting is all CloudLinux with WHM running cPanel instances. My current hosting providers doesn’t support Python with cPanel and this appears to be across the board with Australian hosting providers. My only real alternative now as I move away from WordPress is to create my own hosting solution, which also creates another income stream.
The advice that I have been given on StackOverflow is thus:
Use Docker(docker-compose) for local and production deployment.
Configure uWsgi with Nginx(Available on docker.)
Create a CI/CD pipeline with any tool like Jenkins.
Monitor your projects using any good tool like Raygun.
Can anyone point me to some good video tutorials (I’m a visual learner) in configuring a VPS for multiple domains? I’m hosting 17 sites on a reseller WHM account at the moment and I would like to rebuild half of them using Django to get my experience up before I go to market.
Hello @StudioProjects. Configure a WHM its all through GUI, configure a VPS for Django will be almost entirely CLI. Do you have experience with Ubuntu/Debian or Fedora/Centos, or similar?
In order to help you with your request, you need to provide more background.
When you complete your first deployment you can replicate the same procedure, but with new names in order to deploy other sites. For example your gunicorn.socket and gunicorn.service could be renamed as: gunicorn_b.socket and gunicorn_b.service severally (that is create new files, no rename the files you have used for your first deployment). The same for your venvs, nginx configurations files, etc.
Now, if you use environment variables in your Django project (highly recommended) be sure to include a file and a configuration line for that in gunicorn files.
Finally if you want to use https(highly recommended too) in your sites you can use Certbot, again there is no instruction for CloudLinux.
Now I am curious. Why use CloudLinux? I think this make senses for reselling WP and in general PHP hosting, but as far as I know there won´t be major benefit for Django deployment.