Last active
May 30, 2023 06:17
-
-
Save jamstooks/178408072a641381cbb636c3d1de1822 to your computer and use it in GitHub Desktop.
Notes on starting up an AWS Cloud9 Django dev environment with Python3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo yum -y update | |
| # start by changing `alias python=python27` to `alias python=python3` in ~/.bashrc | |
| sudo pip-3.6 install --upgrade pip | |
| # for some reason `pip` is not found with sudo, so I use the full path. | |
| sudo /usr/local/bin/pip install virtualenvwrapper | |
| echo "export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3" >> ~/.bashrc | |
| echo "export WORKON_HOME=$HOME/environment/Envs" >> ~/.bashrc | |
| echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc | |
| echo "export PS1='\[\e]0;\w\a\]\[\e[32m\]\u:\[\e[33m\]\w\[\e[0m\]\n\$ '" >> ~/.bashrc | |
| source ~/.bashrc | |
| mkvirtualenv -p /usr/bin/python3 p3 | |
| mkvirtualenv -p /usr/bin/python2.7 p2 | |
| # for testing, I sometimes create many virtual envs, like p2-dj1-10 | |
| # OPTIONAL: remove `alias python=python3` altogether in ~/.bashrc | |
| echo "alias dj='python manage.py'" >> ~/.bashrc | |
| echo "alias djr='dj runserver \$IP:\$PORT'" >> ~/.bashrc | |
| echo "alias djt='dj test'" >> ~/.bashrc | |
| echo "alias djs='dj shell'" >> ~/.bashrc | |
| # Set up git profile | |
| git config --global user.email "[email protected]" | |
| # confirm | |
| git config --global user.email | |
| # https://help.github.com/articles/connecting-to-github-with-ssh/ | |
| ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
| # add to github | |
| ssh -T [email protected] | |
| # Postgresql setup | |
| # https://medium.com/@floodfx/setting-up-postgres-on-cloud9-ide-720e5b879154 | |
| sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs | |
| sudo service postgresql initdb | |
| # Follow instructions in blog post... OR write the sed command yourself :) | |
| sudo service postgresql start | |
| # also consider: | |
| # ALTER ROLE "ec2-user" SET client_encoding TO 'utf8'; | |
| # ALTER ROLE "ec2-user" SET default_transaction_isolation TO 'read committed'; | |
| # ALTER ROLE "ec2-user" SET timezone TO 'UTC'; | |
| # MongoDB | |
| # https://docs.mongodb.com/manual/tutorial/install-mongodb-on-amazon/ | |
| sudo service mongod start | |
| # MySQL mysql55 is already installed | |
| sudo service mysqld start | |
| # Add github ssh connection | |
| # https://help.github.com/articles/connecting-to-github-with-ssh/ | |
| # Node setup | |
| # use nvm: https://github.com/creationix/nvm | |
| curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash | |
| nvm install node | |
| nvm use node | |
| sudo yum install yarn | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment