#steps to write python code.
- open terminal and Follow this commands
mkdir project
cd project
- Create virtual enviroment and download required dependencies.
virtualenv virt
source virt/bin/activate
pip install flask
pip install mysql-connector-python
- create application file and template folder
touch application.py
mkdir template
touch application.py
cd template
touch sign_up.html
touch page.html
- Get all your requirements into one file.
pip freeze > requirements.txt
- Create .ebignore file and paste your environement there and save this file.
- Two more files should be created i.e. .elasticbeanstalk and .gitgnore. (This files gets created by itself if project(python code) is deployed from terminal)
.elasticbeanstalk file
branch-defaults:
default:
environment: environment name
environment-defaults:
environment name-env:
branch: null
repository: null
global:
application_name: application name
branch: branch name
default_ec2_keyname: null
default_platform: Python 3.8 running on 64bit Amazon Linux 2
default_region: ap-south-1
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: aws-app
sc: git
workspace_type: Application
.gitgnore file
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml