First check to ensure Python 3.12 is installed and is the current version in use.
python3 --version
> python3.12
Create a virtual environment, activate it, then install the backend python pip requirements.dev.txt
file.
python3.12 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
uvicorn app.main:app --host 0.0.0.0 --port 8888 --log-level info --reload
> ... App Running at 0.0.0.0:8888
> :q
source venv/bin/deactivate
Examples:
- Password Encryption in Python: Securing Your Data
- Asymmetric Encryption and Decryption in Python
- Asymmetric Cryptography with Python
- Exploring approaches to field-level encryption in Python for Django applications
- Example RSA_example.py
- Example rsa.py
- Advanced Encryption Standard (AES) Methods
- A Guide to Advanced Encryption Standard (AES)
First, run the alembic init command and specify where the migrations are to be stored.
alembic init alembic
Next edit the alembic.ini
file to the location of the initialized alembic directory
[alembic]
script_location = alembic
Last, edit the env.py
file in the migrations directory to include your config and db base to migrate.
Check current db version.
alembic current
After changing db models/tables, run revision, and autogenerate. Always add a message about what changed in the db models/tables.
alembic revision --autogenerate -m "added table ____"
alembic upgrade head
alembic upgrade +1
alembic downgrade -1
alembic downgrade base
pytest
pytest tests/crud
pytest tests/api/api_v1/test_websites.py
Delete DS_Store files
find . -name '.DS_Store' -type f -delete
Delete all python cache files
find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf