All Projects → jagadeshbabut → django-setup

jagadeshbabut / django-setup

Licence: MIT License
Setup Django application with Nginx and uWSGI on a Ubuntu server

Projects that are alternatives of or similar to django-setup

django-nixos
NixOS/NixOps configuration for Django
Stars: ✭ 21 (+75%)
Mutual labels:  deployment
GNU-bash-mac-installer
Downloads and builds a Mac package installer for GNU bash 5
Stars: ✭ 17 (+41.67%)
Mutual labels:  deployment
tiller
Deploy Trellis, Bedrock and Sage via AWS CodeBuild
Stars: ✭ 19 (+58.33%)
Mutual labels:  deployment
go-gin-web-server
Deploy Go Gin on Render
Stars: ✭ 23 (+91.67%)
Mutual labels:  deployment
deploy-docker-swarm-using-terraform-ansible
No description or website provided.
Stars: ✭ 20 (+66.67%)
Mutual labels:  deployment
atlassian-kubernetes
All things Atlassian and Kubernetes
Stars: ✭ 30 (+150%)
Mutual labels:  deployment
fastify-boilerplate
fastify boilerplate for building RESTful APIs ⏰ Includes design (APIs), deploy(Application), and monitoring(Application).
Stars: ✭ 27 (+125%)
Mutual labels:  deployment
pytorch-serving
[UNMAINTAINED] A starter pack for creating a lightweight responsive web app for Fast.AI PyTorch models.
Stars: ✭ 16 (+33.33%)
Mutual labels:  deployment
tensorflow flask
tensorflow model deployment in flask REST API
Stars: ✭ 26 (+116.67%)
Mutual labels:  deployment
slipway
Compact binary for integrating Nelson with your CI
Stars: ✭ 15 (+25%)
Mutual labels:  deployment
ByteTrack
ByteTrack: Multi-Object Tracking by Associating Every Detection Box
Stars: ✭ 1,991 (+16491.67%)
Mutual labels:  deployment
elixir cluster
Distributed Elixir Cluster on Render with libcluster and Mix Releases
Stars: ✭ 15 (+25%)
Mutual labels:  deployment
sre.surmon.me
💻 SRE service for Surmon.me blog.
Stars: ✭ 34 (+183.33%)
Mutual labels:  deployment
kuzgun
simple, ssh based deployment tool
Stars: ✭ 16 (+33.33%)
Mutual labels:  deployment
ML-Reserve
An Open-Source repository where students could showcase their skills by contributing their ML and DL projects!
Stars: ✭ 15 (+25%)
Mutual labels:  deployment
Django-on-Docker-with-Heroku-and-OpenCV
Deploy Django on Docker to Heroku and include OpenCV
Stars: ✭ 24 (+100%)
Mutual labels:  deployment
DMIA ProductionML 2021 Spring
Репозиторий направления Production ML, весна 2021
Stars: ✭ 42 (+250%)
Mutual labels:  deployment
liara-cli
The command line interface for Liara
Stars: ✭ 54 (+350%)
Mutual labels:  deployment
HomePage
Python Django开发管理后台+Bootstrap响应式网站
Stars: ✭ 32 (+166.67%)
Mutual labels:  uwsgi
init ec2
init EC2 cluster, for free-password-login(ubuntu and root). for hostname, for hosts file.
Stars: ✭ 11 (-8.33%)
Mutual labels:  deployment

Setup Django, Nginx and uWSGI on a Ubuntu server - Two User setup

sayThanks

Login to UBUNTU user

ssh [email protected]

CREATE apps USER

sudo adduser apps
sudo su apps #Login to apps user and add ssh keys
mkdir ~/.ssh
echo -e "<SSH Key from your local machine>" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
exit

REQUIRED PACKAGES/DEPENDENCIES

sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install python-dev python-pip nginx vim uwsgi uwsgi-plugin-python
sudo pip install virtualenvwrapper

DATABASE

SQLITE
sudo apt-get -y install sqlite3 libsqlite3-dev
MYSQL
wget http://dev.mysql.com/get/mysql-apt-config_0.8.3-1_all.deb (Choose the latest one from https://dev.mysql.com/downloads/repo/apt/)
sudo dpkg -i mysql-apt-config_0.8.3-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server
POSTGRESQL
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

SETUP

NGNIX

sudo rm /etc/nginx/sites-enabled/default
sudo vim /etc/nginx/sites-available/parsel_tongue_nginx.conf 

Copy the parsel_tongue_nginx.conf file

sudo ln -s /etc/nginx/sites-available/parsel_tongue_nginx.conf /etc/nginx/sites-enabled/parsel_tongue_nginx.conf
sudo service nginx configtest
sudo service nginx restart

APPLICATION DEPENDENCIES

sudo chown apps:www-data -R /var/log/uwsgi
sudo vim /etc/uwsgi/apps-available/parsel_tongue_uwsgi.ini

Copy the parsel_tongue_uwsgi.ini file

sudo ln -s /etc/uwsgi/apps-available/parsel_tongue_uwsgi.ini /etc/uwsgi/apps-enabled/parsel_tongue_uwsgi.ini

PERMISSIONS FOR UWSGI RESTART

sudo visudo (Add the following line)
apps ALL=(ALL) NOPASSWD: /usr/sbin/service uwsgi status, /usr/sbin/service uwsgi start, /usr/sbin/service uwsgi stop, /usr/sbin/service uwsgi restart
ctrl + o
ENTER
ctrl + x

exit

Login to APPS user

ssh [email protected]

APPLICATION DEPENDENCIES

echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
Django Application Setup
mkvirtualenv parsel_tongue
pip install django
django-admin startproject parsel_tongue
cd parsel_tongue
echo -e 'STATIC_ROOT = os.path.join(BASE_DIR, "static/")' >> parsel_tongue/settings.py
python manage.py collectstatic
python manage.py migrate
python manage.py createsuperuser
deactivate
Restart Services
sudo service uwsgi start

exit

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].