Learn how to build a Micro eCommerce Web App with Python, Serverless Postgres, and Stripe Checkout. Live demo at url below.
- star 数
- 81
- watcher 数
- 2
- fork 数
- 52
- issue 数
- 2
- 最終更新
- 2024/02/14
Learn how to build a Micro eCommerce Web App with Python, Serverless Postgres, and Stripe Checkout. Live demo at url below.
Learn how to build a Micro eCommerce Web App with Python and Serverless Postgres
mkdir -p ~/dev cd ~/dev git clone https://github.com/codingforentrepreneurs/micro-ecommerce cd micro-ecommerce git checkout start
Run echo "" > .env to create the .env in the root of your project:
DATABASE_URL="" DJANGO_SECRET_KEY=<some-secret> DJANGO_DEBUG=1 ALLOWED_HOST="*"
Replace <some-secret> by any of the following commands:
openssl rand -base64 32
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'python -c 'import secrets;print(secrets.token_urlsafe(32))'=== Configure Environment
To install packages and run various command shortcuts, we use rav. Open rav.yaml to see the various commands available if you prefer to not use rav.
macOS/Linux Users
python3 -m venv venv
source venv/bin/activate
venv/bin/python -m pip install pip pip-tools rav --upgrade
venv/bin/rav run installs
rav run freezeIn rav.yaml, you'll see that rav run installs maps to:
venv/bin/pip-compile src/requirements/requirements.in -o src/requirements.txtvenv/bin/python -m pip install -r src/requirements.txtnpm installWindows Users
c:\Python310\python.exe -m venv venv .\venv\Scripts\activate python -m pip install pip pip-tools rav --upgrade rav run win_installs rav run win_freeze
In rav.yaml, you'll see that rav run win_installs maps to:
pip-compile src/requirements/requirements.in -o src/requirements.txtpython -m pip install -r src/requirements.txtnpm install=== Main Commands
With all the configuration done, here are the main commands you'll run:
rav run server
rav run watch
rav run vendor_pull
rav run server maps to python manage.py runserver in the src folderrav run watch triggers tailwind to watch the tailwind input file to make the compiled tailwind output file via npx tailwindcss -i <input-path> -o <output-path> --watchrav run vendor_pull run this occasionally to pull the latest version of Flowbite, HTMX, and any other third party static vendor files you need.