Skip to content

Cartify is a modern, minimal ecommerce Django project included in this workspace. It demonstrates a polished UI, account management, product/shop models, cart, checkout, orders, and a lightweight admin and seeding script for development.

License

Notifications You must be signed in to change notification settings

PeterOlayemi/django_ecommerce_site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cartify — Django Ecommerce Example

Cartify is a modern, minimal ecommerce Django project included in this workspace. It demonstrates a polished UI, account management, product/shop models, cart, checkout, orders, and a lightweight admin and seeding script for development.


Project: django_ecommerce_site

Overview

Cartify is a small ecommerce site built with Django. It includes the following functional areas:

  • User accounts with signup/login/profile and password reset flows (account app).
  • Core site pages and utilities (core app).
  • Product, cart, order, payment and checkout flows (shop app).
  • Basic styling & frontend inlined in templates (the project uses a modern glass/neon theme in account/templates/base.html).

This repository is suitable as a starter template to learn a full Django ecommerce flow or to extend into a production project.

Features

  • User authentication (signup, login, password reset)
  • Product listing and detail pages
  • Cart and checkout pages and order creation
  • Order list and order detail views
  • Admin management and data seeding command
  • Responsive frontend templates with a reusable base template

Repository Structure (important files/folders)

  • manage.py — Django management utility
  • requirements.txt — Python dependencies
  • ecommerce/ — Django project settings and entry points (settings.py, urls.py, wsgi.py, asgi.py)
  • account/ — account-related views, templates, and forms
  • core/ — site core views, tags, utilities
  • shop/ — product models, cart, orders, templates and management commands (seed)
  • media/ — uploaded media (products images)
  • static/ — static assets (images, JS, CSS)

Inspect the apps to find the models and views used for the storefront and order flow.

Prerequisites

  • Python 3.10+ (project was developed against Python 3.10+; newer 3.x versions should work)
  • pip (Python package manager)
  • (Optional) virtualenv or venv for isolated environments

Local Setup (PowerShell)

Open PowerShell in the project root (django_ecommerce_site) and run:

# create and activate a virtual environment (recommended)
python -m venv .venv
.\.venv\Scripts\Activate.ps1

# install dependencies
pip install -r requirements.txt

If you prefer `cmd.exe` or WSL adapt activation commands accordingly.

## Environment Variables (.env template)

Create a `.env` file in the project root with at least the following values. DO NOT commit secrets.

Django

SECRET_KEY=replace-with-a-secret-key

Database (if using sqlite the default file is included: db.sqlite3)

For postgres/mysql use a DATABASE_URL or set the DB_* variables used in settings

DB_NAME=db_name DB_USER=username DB_PASSWORD=password DB_HOST=localhost DB_PORT=5432

Email (for password reset flows)

email=you@example.com appPassword=your-email-app-password admin_email=admin@example.com

PAYSTACK_PUBLIC_KEY="pk_test_xxx" PAYSTACK_SECRET_KEY="sk_test_xxx"


Adjust `ecommerce/settings.py` to confirm which environment variables are loaded and used.

## Database and migrations

To initialize migrations and apply them locally:

```powershell
# make migrations (only if you change models)
python manage.py makemigrations
python manage.py migrate

# create a superuser
python manage.py createsuperuser

Seeding sample data

The shop app includes a management command to seed the store (management/commands/seed_store.py). Use it to create demo products and categories:

python manage.py seed_store

If you need different seed data, open shop/management/commands/seed_store.py and adjust the fixtures.

Running the app (development)

Start the development server:

python manage.py runserver

Then open http://127.0.0.1:8000/ in your browser.

Troubleshooting

  • Missing static/css: run python manage.py collectstatic and ensure static files are served by your webserver.
  • Email not sending: check SMTP credentials and port; verify firewall rules.
  • Page errors on production: confirm DEBUG=False and check logs for errors; ensure ALLOWED_HOSTS contains your domain.
  • Database locked (sqlite): ensure no conflicting writers or consider using Postgres for concurrency.

If you hit an error while running commands, run them with verbosity or inspect logs in the console for stack traces.

Contributing

Contributions are welcome. Suggested workflow:

  1. Fork the repository and create a feature branch
  2. Write tests for new behavior
  3. Run the test suite and linters locally
  4. Open a pull request with a clear description of changes

Please follow the existing coding style in the repository.

License

This project is licensed under MIT License.


About

Cartify is a modern, minimal ecommerce Django project included in this workspace. It demonstrates a polished UI, account management, product/shop models, cart, checkout, orders, and a lightweight admin and seeding script for development.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published