django-tutorial-step-by-step

========================================================

This repository contains the Django project you build in the official Django tutorial: the mysite project with the polls app.

Each commit corresponds to a step in the tutorial.

Table of contents:

Here is a list of all steps in the tutorial.

Part 1:

Part 2:

Part 3:

Part 4

Part 5:

Part 6:

Part 7:

Part 8:

Django Tutorial Step-by-Step

Prerequisites

  • Python 3.6 or later
  • Git
  • (Optional) Virtualenv or equivalent virtual environment tool

Installation

Clone the Repository

With SSH

git clone git@github.com:Anthonyythomas/django-tutorial-step-by-step.git
cd django-tutorial-step-by-step

With HTTPS

git clone https://github.com/Anthonyythomas/django-tutorial-step-by-step.git
cd django-tutorial-step-by-step

Create a Virtual Environment (optional but recommended)

If you have virtualenv installed, run:

virtualenv venv

If you're using Python 3.3 or later, you can use venv directly:

python3 -m venv venv

Activate your Virtual Environment

On macOS/Linux:

source venv/bin/activate

On Windows:

venv\Scripts\activate

Install the Dependencies

pip install -r requirements.txt

Database Setup

python manage.py migrate

Create a Superuser (optional)

python manage.py createsuperuser

Running the Project

python manage.py runserver

Open the project in a web browser at http://127.0.0.1:8000/.

Testing

Run all tests

python manage.py test

Run a single test

python manage.py test models