Deploy Django Application on Alibaba Cloud

Prerequisites

sudo apt-get install python-pip
sudo pip install virtualenv
mkdir ~/.virtualenvs
sudo pip install virtualenvwrapper
export WORKON_HOME=~/.virtualenvs
export WORKON_HOME=~/.virtualenvs
/usr/local/bin/virtualenvwrapper.sh
apt-get install git
Sudo apt-get install nginx

Procedure

Launching your first Linux instance

Installing and Deploying Django Application

mkvirtualenv DjangoApp
workon DjangoApp
pip install Django
django-admin startproject todoAppcd todoApp/
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver 0.0.0.0:8000
python manage.py migrate
Python manage.py collectstatic --noinput
pip install uWSG
vim uwsgi.ini
uwsgi uwsgi.ini (your ini file)
server   {       listen 80 default_server;                listen [::]:80 default_server ipv6only=on;                server_name localhost;  location /static/   {                    include uwsgi_params;                    alias /root/todoApp/public/;  } location  /    {                    include uwsgi_params;                    uwsgi_pass unix:/tmp/uwsgi.sock; } }

Conclusion

Original Source:

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

MapReduce: Simplified Data Processing on Large Clusters

Catalogues to TEI to HTML at the National Gallery

Flutter Analysis and Practice: Practices of High-Performance Dynamic Template Rendering

Spring MVC

A Simple Continuous Deployment of a React Native App to Google Play

Learning NumPy from scratch

Simple Terraform Wrapper Module for Deploying an Azure Blockchain Service

Build Mobile App Fast And Easy with Expo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

How to deploy your Django/Python app easily on Ubuntu 20.04 using Uwsgi + Nginx.

CI/CD with Django and GitHub (with Video)

GitLab Django Cloud Run — How To Properly Stand Back and Relax

Deploy Django using Postgres, Nginx in digital ocean ubuntu droplet

Deploy Django using Postgres, Nginx in digital ocean