Self-Hosted Local Development Setup Guide (Phase 2)

Last updated: February 2026

Introduction

This phase covers building and preparing your eCommerce store locally. By the end of this phase, you will have a fully working store that is ready to be deployed to production.

Important:
In the Djangify self-hosted model, local development is the source of truth. The production server should not be used for building, migrating, or configuring the store unless you have enough experience to do so.


Step 1: Create and Activate a Virtual Environment (Local)

From your local project directory:

python3 -m venv venv

source venv/bin/activate

Upgrade pip:

pip install --upgrade pip

Install project dependencies:

pip install -r requirements.txt


Step 2: Apply Database Migrations (Local)

Run migrations locally to create the database schema:

python manage.py migrate

This will:

  • create the SQLite database file (db.sqlite3)

  • create all required tables for users, products, orders, pages, and settings

Migrations only need to be run locally.


Step 3: Collect Static Files (Local)

Collect static assets:

python manage.py collectstatic --no-input

This prepares:

  • admin assets

  • frontend styles

  • JavaScript and images

These files will later be uploaded to production as part of the deployment. Also run collectstatic if you make any changes that belong in the static folder.


Step 4: Create the Admin Account (Local)

Create your admin (superuser) account:

python manage.py createsuperuser

Follow the prompts to set:

  • email address

  • password

This account will exist in the local database and will be deployed to production.


Step 5: Start the Application Locally (Verification)

Start the local development server:

python manage.py runserver

Visit:

http://127.0.0.1:8000

Verify:

  • homepage loads

  • admin panel is accessible at /admin

  • you can log in successfully

Stop the server with:

Ctrl + C


Step 6: Configure the Store Locally

Using the admin panel, configure your store:

  • Site settings

  • Dashboard settings

  • Page structure

  • Shop configuration

  • Email settings

  • Stripe (test mode)

  • Add products

  • Add pages and content

At the end of this step, your store should be functionally complete.


Step 7: Final Local Verification

Before deploying, confirm:

  • database contains all content

  • products display correctly

  • admin works as expected

  • test Stripe payments work

  • email sending works

Once confirmed, you are ready to deploy.


Output of Phase 2

At the end of Phase 2, you should have:

  • db.sqlite3 (fully populated)

  • media/ directory (uploads, product images, downloads)

  • static/ directory

  • application code

  • .env file (local values)

These artefacts will be deployed to production in Phase 3.

Now is a good time to add content to your site in local development. See the links inside the Self-Hosted Quick Start Guide. It will take you to different parts of the documentation.