Backend Development 4 min read

Python Django E‑commerce Project Tutorial with Installation Guide

This tutorial presents a complete Python + Django e‑commerce mini‑project, outlining its main features, required environment, step‑by‑step installation commands, configuration changes, database setup, and how to run the application locally for self‑learners.

Python Programming Learning Circle
Python Programming Learning Circle
Python Programming Learning Circle
Python Django E‑commerce Project Tutorial with Installation Guide

This article shares a Python + Django e‑commerce mini‑project that is ideal for self‑learners who want to practice web development and overcome the typical hurdles of building a shopping site.

Main Features

Account registration and login.

Home page carousel, product categories, and hot‑selling items.

Product list and search functionality.

User order history, shipping address management, and recent browsing.

Shopping cart addition and checkout process.

Environment

Python 2.7

Django 1.11

MySQL 5.7.22

Project Setup and Installation

1. Install the Python environment (the tutorial uses Python 2.x; you can later adapt to Python 3.x).

2. Install required packages:

<code>pip install -r requirements.txt</code>

3. Install MySQL 5.7 and create the codedq database.

<code>mysql -u root -p</code>
<code>Enter password:</code>
<code>mysql> create database codedq;</code>

4. Modify the project configuration (settings.py) to match your database credentials:

<code># settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'codedq',
        'USER': 'root',
        'PASSWORD': '123456',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}
</code>

5. Create database tables:

<code># Generate migration files
python manage.py makemigrations
# Apply migrations to create tables
python manage.py migrate</code>

6. Start the project:

<code>python manage.py runserver</code>

After the server starts, open a browser and visit http://127.0.0.1:8000 to see the application.

Project Screenshots

Disclaimer: This article is compiled from online sources; copyright belongs to the original author. If any information is incorrect or infringes rights, please contact us for removal or authorization.

Backende-commercePythonMySQLTutorialweb-development
Python Programming Learning Circle
Written by

Python Programming Learning Circle

A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.