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

Flutter vs. React Native Comparison: What to Choose to Build a Mobile App in 2021

Some screens of The Hole app, which is built on Flutter

Discover The Refreshing Indie Music Of Atuzo and Kuotsho, Two 21-Year-Old Musicians From Nagaland

Let’s configure Hadoop from Ansible

Easiest explanation of Abstract class and Interface

Getting data out of word file (docx) and storing in a list using python

My Internship and Goal

Elixir's modularity toolbox

Using Container Service to Build WeChat Applets

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

List as a parameters in “GET” request : Django

WSGI in Django

Retrieving images using database and media in Django

Django Untangled 1 — Intro