# 3 Build a Python (Django) environment on AWS EC2 instance (ubuntu18.04) part2

Introduction

I am a beginner in programming languages. Therefore, I think there are some misreading and lack of understanding. In that case, I would appreciate it if you could let me know in the comments.

The "goal" wants to go as far as deploying a pre-created Python web application. I will write for beginners as much as possible.

Creation procedure

Build a virtual environment and install Django.

Step 1 (Installation)

update pip3
$ sudo -H pip3 install --upgrade pip

Install virtualenv with pip3
$ sudo -H pip3 install virtualenv

apt-install git with get
$ sudo apt-get install git
$ git --version

Step 2 (Build a virtual environment and install Django etc.)

The'virtual environment name'that creates the virtual environment can be anything, and if you haven't decided, you should use python3.
$virtualenv ‘Virtual environment name’

Activate the virtual environment
$source ‘Virtual environment name’/bin/activate

#When the virtual environment is activated, the name of the virtual environment prompts($Or#Mark)It is displayed on the left side of.
(‘Virtual environment name’) $ 
Example.When the virtual environment name is python3
python3$ 

Step 3 (Install in the virtual environment.)

As a premise, we will proceed assuming that the impression environment name is (python3).

Install various things
(python3) $ pip install django gunicorn psycopg2 psycopg2-binary Pillow

Step 4 (Clone the app pushed to git hub)

Move to the folder to put the key
$cd ~/.ssh

Generate key(Please enter without worrying about everything and proceed)
Then id_rsa and id_rsa.Two keys for the pub are generated.
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/(username)/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

id with ls command_rsa id_rsa.Confirm that pub is created
$ ls

id with cat command_rsa.Copy everything in the pub
$ cat id_rsa.pub

Then jump to this URL. https://github.com/settings/ssh The display differs depending on the version, but as of August 28, 2020, there is a button called New SSH key, so click it Enter something that does not cover the Title (anything is fine) Paste the one you just copied into the key. Then return to the terminal again.

Check the connection.
$ ssh -T [email protected]
Hi ‘git hub user name’! You've successfully authenticated, but GitHub does not provide shell access.
If this return comes, the connection is successful

Navigate to the repository you want to clone the site on git hub. There is a button like ↓ code ▼, so click this (maybe) Click use ssh and copy the url Go to the terminal.

$git clone “copied url”

You should now have cloned your application.

Next time, we will link the application and PostgreSQL.

Recommended Posts

# 3 Build a Python (Django) environment on AWS EC2 instance (ubuntu18.04) part2
Build python environment with pyenv on EC2 (ubuntu)
How to build a Django (python) environment on docker
Building a Python environment on Ubuntu
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
Build a python3 environment on CentOS7
How to build a new python virtual environment on Ubuntu
Build a Python + OpenCV environment on Cloud9
xgboost (python) on EC2 Spot instance environment prepared by AWS Lambda
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
build Python on Ubuntu
Build a WardPress environment on AWS with pulumi
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
Simply build a Python 3 execution environment on Windows
Build a Django environment on Raspberry Pi (MySQL)
Build a python environment with ansible on centos6
Build a Python environment on Mac (Mountain Lion)
Python development on Ubuntu on AWS EC2 (using JupyterLab)
[Python] Build a Django development environment with Docker
Build a Python development environment on your Mac
[Venv] Create a python virtual environment on Ubuntu
Build a Kubernetes environment for development on Ubuntu
Quickly build a Python Django environment with IntelliJ
Build a Python development environment on Raspberry Pi
I made a webAPI! Build environment from Django Rest Framework 1 on EC2
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Build a Django development environment using pyenv-virtualenv on Mac
Deployment procedure on AWS (2) Server (EC2 instance) environment settings
Build a machine learning Python environment on Mac OS
Build python3 environment with ubuntu 16.04
[Part 2] Let's build a web server on EC2 Linux
I made a Python3 environment on Ubuntu with direnv.
Build a GVim-based Python development environment on Windows 10 (1) Installation
Build Python environment on Windows
Build a Python development environment on Mac OS X
Build a Python virtual environment using venv (Django + MySQL ①)
Build a Python environment on your Mac using pyenv
Build python environment on windows
Build a Python development environment using pyenv on MacOS
Build a Python environment offline
How to build a Python environment on amazon linux 2
Build a python machine learning study environment on macOS sierra
Build an Ubuntu python development environment on Google Cloud Platform
Build a python data analysis environment on Mac (El Capitan)
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Build Keras environment on AWS E2 G2 instance February 2017 version
Building an environment to execute python programs on AWS EC2
Until building a Python development environment using pyenv on Ubuntu 20.04
Build a python environment on CentOS 7.7 for your home server
Prepare Python development environment on Ubuntu
Create a Python environment on Mac (2017/4)
Create a python environment on centos
OpenCV3 & Python3 environment construction on Ubuntu
Build a Chainer environment using CUDA and cuDNN on a p2 instance
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Create an AWS Cloud9 development environment on your Amazon EC2 instance
When creating an environment that uses python django on Ubuntu 12.04 LTS
Build Python environment on Ubuntu (when pip is not the default)
Building an environment to run ChainerMN on a GPU instance on AWS
[Pyenv] Building a python environment with ubuntu 16.04
Python 2.7, 3.4, 3.5 extension module build environment on Windows