Skip to content

Instantly share code, notes, and snippets.

@ibrahimsha23
Last active December 19, 2016 19:43
Show Gist options
  • Save ibrahimsha23/5061895e4946395beba5c4995d21d606 to your computer and use it in GitHub Desktop.
Save ibrahimsha23/5061895e4946395beba5c4995d21d606 to your computer and use it in GitHub Desktop.
#Steps to install python2 & python3 # Python is not installed defaultin Ubuntu 16.04.1 LTS
1. sudo add-apt-repository ppa:fkrull/deadsnakes
2. sudo apt-get update
3. sudo apt-get install python2.7
4. sudo apt-get install python3.5
5. sudo apt-get install python-pip
#Add Deploymentkey in code repo
1. If ssh keys is not available, generate ssh key in your machine by using cmd (ssh-keygen -t rsa -C "mail_id@domain.xyz")
2. To view and copy the generated ssh key in your deployment key section of code repo. [cat ~/.ssh/id_rsa.pub]
# Setting up the django application in machine
1. git clone git@bitbucket.org:investing13f/edgar13f.git
2. sudo pip install virtualenv virtualenvwrapper
3. echo "export WORKON_HOME=~/Env" >> ~/.bashrc
4. echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
5. source ~/.bashrc
6. pip install -r requirements.txt
7. mv dev.py.sample prod.py
8. Add templates in app_dir
9. Create the debug log file by using cmd (touch /home/ubuntu/edgar13f/logs/debug.log)
10. sudo chown www-data:www-data -R /var/log/uwsgi
11. Create a log file ('/home/ubuntu/edgar13f/logs/debug.log', chmod 777)
12. configure uwsgi
13. Install nginx on ubuntu
14. check ufw status
15. Configure static root
16. Run collectstatic cmd
17. venv for py3 http://railslide.io/virtualenvwrapper-python3.html
18. http://serverfault.com/questions/775965/wiring-uwsgi-to-work-with-django-and-nginx-on-ubuntu-16-04
19. http://guoqiao.farbox.com/post/2014/0416-use-uwsgi-the-right-way
20. sudo ufw allow 22, 443, 80
21. sudo apt-get install uwsgi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment