A production-ready E-commerce solution built with Django 5 and Python.
This project demonstrates a professional development lifecycle using GitHub Flow and Conventional Commits. The infrastructure is designed for scalability and persistence in cloud environments.
- ☁️ AWS S3 Integration: Configured Amazon S3 buckets to handle user-uploaded media files, ensuring data persistence across ephemeral deployments.
- 🛒 Full E-commerce Logic: Product variations, shopping cart session management, and order processing.
- 🚀 Production DevOps: Deployed on Railway with Gunicorn and PostgreSQL.
- ⚡ Performance: Static assets served via WhiteNoise with compression and caching.
- 🎨 Responsive Design: Custom Bootstrap 5.3 theme with FontAwesome 7.1 icons.
- Language: Python 3.11.4
- Framework: Django 5.2.7
- Database: PostgreSQL (Production) / SQLite3 (Development)
- Storage: AWS S3 (via
boto3&django-storages) - Server: Gunicorn 25.1.0 (WSGI)
- Templates: Django Template Language (DTL)
- Styling: Bootstrap 5.3.8 (via
npm&django-crispy-forms) - Icons: Font Awesome 7.1.0 (via
npm) - Asset Pipeline: Custom
npmscripts usingcpxandmkdirpto manage vendor static files.
- Hosting: Railway (PaaS)
- Static Files: WhiteNoise 6.11.0
- Version Control: Git (GitHub Flow)
Follow these steps to set up the project on your local machine.
- Python 3.11.4: Download from python.org
- Node.js 20+: Download from nodejs.org
- Git: Version control system.
-
Clone the Repository
git clone [https://github.com/brunoF-Silva/django-ecommerce.git](https://github.com/brunoF-Silva/django-ecommerce.git) cd django-ecommerce -
Set Up Virtual Environment Create and activate the environment to manage dependencies.
- Git Bash (Windows):
python -m venv venv source venv/Scripts/activate - PowerShell:
python -m venv venv .\venv\Scripts\Activate.ps1 - macOS/Linux:
python3 -m venv venv source venv/bin/activate
- Git Bash (Windows):
-
Install Python Dependencies
pip install -r requirements.txt
-
Set Up Frontend Assets This project uses
npmto fetch Bootstrap and FontAwesome. A custom script (cpx) moves them to Django's static folder.# 1. Install packages (Bootstrap 5.3.8, FontAwesome 7.1.0) npm install # 2. Run the deploy script (Copies CSS/JS to static/libs/) npm run deploy
-
Database Setup Run migrations to create the local SQLite database.
python manage.py migrate
Create an admin user to access the dashboard.
python manage.py createsuperuser
-
Run the Server You can run the server directly. To enable Debug mode locally, pass the environment variable inline.
-
PowerShell:
$env:DEBUG="True"; python manage.py runserver
-
Git Bash / Linux:
DEBUG=True python manage.py runserver
-
Access:
- Site: http://127.0.0.1:8000
- Admin: http://127.0.0.1:8000/admin
-
This project is configured for seamless deployment on Railway.
- Build Command:
python manage.py collectstatic --noinput - Start Command:
python manage.py migrate && gunicorn store.wsgi - Required Variables:
SECRET_KEYDEBUG(Set toFalse)DATABASE_URL(PostgreSQL connection string)AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_STORAGE_BUCKET_NAMEALLOWED_HOSTS
Based on the Udemy course "Python 3+ Complete" by Luís Otávio. Adapted, refactored, and deployed to cloud infrastructure by Bruno Silva.