Skip to content

Latest commit

 

History

History
89 lines (59 loc) · 1.59 KB

README.md

File metadata and controls

89 lines (59 loc) · 1.59 KB

CASE 2: Faculty Upload

One of many case of the VendOPrint project

Setting up a virtual environment

  1. Install virtualenv
pip install virtualenv
  1. Create and move into the project directory
mkdir projectA
cd projectA
  1. Activate the virtual environment (for linux)
source env/bin/activate
  1. Verify whether the virtual environment is created successfully
pip list

This will list all the dependencies of the virtual environment

Congratulations you have isolated application dependencies from the system dependencies!

Creating a requirements file

pip freeze > requirements.txt

This will list all the dependencies of the application, which can be used to replicate across different systems

Creating an environment file to store secrets or configuration information

  1. Install python-dotenv to interact with environment variables.
pip install python-dotenv
  1. create an .env file to store secrets or configuration information
touch .env
  1. Open the environment file(linux)
nano .env
  1. open the environment file and past the following lines
AWS_ACCESS_KEY_ID = 'your_aws_access_key'
AWS_SECRET_ACCESS_KEY = 'your_secret_access keys'
AWS_S3_BUCKET_NAME = 'your_bucket_name'

DB_HOST = 'your_db_host'
DB_USERNAME = 'your_db_username'
DB_PASSWORD = 'your_db_password'
DB_NAME = 'you_db_name'
  1. Exit the nano editor
ctrl + s and ctrl + x
  1. Add a .gitignore file
touch .gitignore
  1. Add .env to .gitignore file to prevent it from being committed to codebase