bhylu.com

Advertisements

Django Installation

Keep the Django project separate from Bhylu’s Laravel application. A virtual environment gives this course its own dependencies without changing PHP, Apache or MySQL.

How it works

Use Python 3.12 for the reviewed baseline and Django 5.2.18 LTS. Download the supplied project files into a new folder using the source downloader on this page. In Windows CMD, run py -3.12 -m venv .venv, then .venv\Scripts\python.exe -m pip install -r requirements.txt. Use that same interpreter for manage.py and lesson scripts. There is no Django browser playground; the Python editor does not provide this server project.

Run in the supplied local Django project

This lesson uses Django 5.2.18 LTS with Python 3.12. Download the source downloader and run node download-project.mjs http://127.0.0.1:8000 with Node 22 while previewing locally. It creates a new bhylu-django-lab folder and refuses to overwrite an existing one. After deployment, the default base is bhylu.com; until then use your local preview URL.

Inside that new folder, create a virtual environment, install requirements.txt and run the complete lesson file shown below. Every lesson creates a fresh in-memory SQLite database and temporary upload storage. It does not edit the interactive lab’s db.sqlite3 or Bhylu’s database. The visible listing below is the lesson’s core code; its complete downloaded file includes the shared bootstrap.

Django does not run in Bhylu’s current browser playground. No Apache, MySQL or global PHP configuration change is needed. See the setup lesson for the full project and commands.

Windows CMD setup

Windows CMD

cd bhylu-django-lab
py -3.12 -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txt
.venv\Scripts\python.exe lessons\setup.py
.venv\Scripts\python.exe manage.py migrate
.venv\Scripts\python.exe manage.py seed_lab
.venv\Scripts\python.exe manage.py runserver 127.0.0.1:8130

Open http://127.0.0.1:8130 for the separate teaching application. To use login or admin, run python manage.py createsuperuser with your virtual-environment interpreter and choose your own local credentials. The seeded Alex and Jay accounts deliberately have unusable passwords. Stop it with Ctrl+C. Commands use the environment’s interpreter directly, so you do not need to change PowerShell execution policy. Replace the lesson filename to run another example. On Linux/macOS use python3 -m venv .venv and .venv/bin/python instead.

Inspect the source manifest. Each project file is also linked below as plain text; restore its listed path without the final .txt suffix.

Example

Run .venv\Scripts\python.exe lessons\setup.py from the downloaded project root. Download the complete lesson file; keep it under lessons/. The project’s shared models, forms, views and fixture are prerequisites, not a hidden online runtime.

lessons/setup.py — core code

import django
import sys
print(django.get_version())
print(sys.version_info.major == 3 and sys.version_info.minor >= 12)

Expected result

5.2.18
True

The version check confirms the selected framework and a suitable Python interpreter. Using python -m pip with an explicit environment avoids installing a dependency into one interpreter and trying to run it with another.

Use Django’s versioned official documentation for exact API contracts and the deployment checklist before a separate release.

Advertisements