Website

Ferme

Demo e-commerce website

Description

Demo e-commerce website made with Django, Bootstrap 5 and Oracle SQL (student project).

Features

Products page with filters and search, product details page and cart button.

Products page

Dev environment setup

Prerequisites:

Python 3+, Docker/Podman and dependencies listed in requirements.txt

Organization

The DB scripts are located in the /scripts_oracle directory. The project uses the Django MVT pattern.

Setup

  1. Clone
git clone https://github.com/jaycem-dev/ferme-website.git
cd ferme-website
  1. Create Python virtual environment and install dependencies
python3 -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt
  1. Setup Oracle SQL Free container (Docker/Podman)

We’ll use Oracle Database 23ai Free Lite. Read more here.

podman run -d --name oracle-db -p 1521:1521 container-registry.oracle.com/database/free:23.6.0.0-lite
  1. Check container status
podman ps
  1. Change DB password
podman exec <oracle-db> ./setPassword.sh <your_password>
  1. Copy /scripts_oracle to the container:
podman cp scripts_oracle/ oracle-db:/tmp/scripts_oracle
  1. Connect with sqlplus
podman exec -it oracle-db sqlplus sys/admin@freepdb1 as sysdba
  1. Create user and assign permissions.

For local development, we can assign all permissions for quick start.

CREATE USER ferme IDENTIFIED BY password;
GRANT ALL PRIVILEGES TO ferme;
  1. Run the scripts in sqlplus
@/tmp/scripts_oracle/1.SCRIPT_CREACION_TABLAS.ddl
@/tmp/scripts_oracle/2.SCRIPT_INSERTS.sql
@/tmp/scripts_oracle/3.TRIGGERS_AND_SP.sql
@/tmp/scripts_oracle/4.INSERT_PRODUCTOS_MUESTRA.sql
  1. Update credentials in ferme/settings.py with the new user.
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.oracle",
        "NAME": "localhost:1521/freepdb1", # freepdb1 is the default pluggable db name in the oracle container
        "USER": "ferme",
        "PASSWORD": "password",
    }
}
  1. Create migrations and superuser
python manage.py migrate
python manage.py createsuperuser
  1. Run the server
python manage.py runserver