Skip to content

Repository files navigation

Django E-commerce Platform

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.

✨ Key Features

  • ☁️ 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.

🚀 Tech Stack

Backend & Database

  • 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)

Frontend

  • 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 npm scripts using cpx and mkdirp to manage vendor static files.

DevOps & Infrastructure

  • Hosting: Railway (PaaS)
  • Static Files: WhiteNoise 6.11.0
  • Version Control: Git (GitHub Flow)

🛠️ Local Development Setup

Follow these steps to set up the project on your local machine.

Prerequisites

Installation

  1. Clone the Repository

    git clone [https://github.com/brunoF-Silva/django-ecommerce.git](https://github.com/brunoF-Silva/django-ecommerce.git)
    cd django-ecommerce
  2. 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
  3. Install Python Dependencies

    pip install -r requirements.txt
  4. Set Up Frontend Assets This project uses npm to 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
  5. 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
  6. Run the Server You can run the server directly. To enable Debug mode locally, pass the environment variable inline.


☁️ Deployment (Railway)

This project is configured for seamless deployment on Railway.

  1. Build Command: python manage.py collectstatic --noinput
  2. Start Command: python manage.py migrate && gunicorn store.wsgi
  3. Required Variables:
    • SECRET_KEY
    • DEBUG (Set to False)
    • DATABASE_URL (PostgreSQL connection string)
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
    • AWS_STORAGE_BUCKET_NAME
    • ALLOWED_HOSTS

Credits

Based on the Udemy course "Python 3+ Complete" by Luís Otávio. Adapted, refactored, and deployed to cloud infrastructure by Bruno Silva.

About

Full-stack E-commerce built with Django and Python. Features AWS S3 for media storage, PostgreSQL, and professional Git workflows (GitHub Flow & Conventional Commits).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages