Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 3.29 KB

README.md

File metadata and controls

72 lines (49 loc) · 3.29 KB

Django Tutorials

This repository holds an implementation of the Django 5.0 tutorial. The tutorial is available at Django 5.0 Tutorial.

The purpose of this is to be able to provide a number of additional tutorials building upon the core one.

The code in the django core tutorial are Copyright (c) Django Software Foundation and individual contributors. See https://github.com/django/django/blob/main/LICENSE for full license.

Getting Started

To use this repository, you will need to have Python 3.8 or later installed as well as git.

To get started, you will need to clone the repository and then create a virtual environment.

# Clone the repository
$ git clone https://github.com/kws/django-tutorial.git

# Change into the directory
$ cd django-tutorial

# Create a virtual environment
$ python -m venv venv

# Activate the virtual environment
$ source venv/bin/activate

# Install the requirements
$ pip install -r requirements.txt

# Run the migrations
$ python manage.py migrate

# Create a superuser
$ python manage.py createsuperuser

# Run the server
$ python manage.py runserver

You should now be able to access the site at http://localhost:8000/polls.

Extending the Tutorial

The tutorial is broken into a number of tags and branches. Each tag or branch represents a step in the tutorial.

Each part of the original tutorial is tagged with the part number. For example, the first part of the tutorial is tagged with DT-PART1 etc. through DT-PART7:

The branch kws-extras adds a few additional features to the tutorial that makes it easier to extend further. First of all it adds a base template that all other templates extend. It also adds fixtures (samples) for the initial data to make it easier to get started.

You can read more about the kws-extras branch in the associated blog post: Extending the Django Tutorial.