Skip to content

Latest commit

 

History

History
119 lines (96 loc) · 3 KB

File metadata and controls

119 lines (96 loc) · 3 KB

Python


The Python learning resources.

Project Setup

  • Configuration
  • Dependencies
  • Database Configuration
  • Build Instructions
  • Unit Tests
  • Deployment Instructions

Python Settings

python3 --version
python3 -m pip --version
python3 -m ensurepip --default-pip

Setup Virtual Environment

python3 -m pip install virtualenv
python3 -m venv venv
source deactivate
source venv/bin/activate

Upgrade PIP Requirements (Dependencies)

pip install --upgrade pip

Setup Configurations

  • Create or update local .env configuration file.
touch .env
HOST = 127.0.0.1
PORT = 8080
DEBUG = True
DEFAULT_POOL_SIZE = 1
RDS_POOL_SIZE = 1

By default, Flask will run the application on port 5000.

Build Service

python3 -m build

Save Requirements (Dependencies)

pip freeze > requirements.txt

Unit Tests

python3 -m unittest
python -m unittest discover -s ./tests -p "test_*.py"

Reference

- Beautiful is better than ugly.
- Explicit is better than implicit.
- Simple is better than complex.
- Complex is better than complicated.
- Flat is better than nested.
- Sparse is better than dense.
- Readability counts.
- Special cases aren't special enough to break the rules.
- Although practicality beats purity.
- Errors should never pass silently.
- Unless explicitly silenced.
- In the face of ambiguity, refuse the temptation to guess.
- There should be one-- and preferably only one --obvious way to do it.
- Although that way may not be obvious at first unless you're Dutch.
- Now is better than never.
- Although never is often better than *right* now.
- If the implementation is hard to explain, it's a bad idea.
- If the implementation is easy to explain, it may be a good idea.
- Namespaces are one honking great idea -- let's do more of those!

Contribution Guidelines

  • Writing tests
  • Code review
  • Other Guidelines

Version

MAJOR.MINOR.PATCH.BUILD

Author

  • Rohtash Lakra