========================================================
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.
Here is a list of all steps in the tutorial.
Part 1:
Part 2:
- Part 2: Database setup
- Step 2: Creating models
- Part 2: Activating models
- Part 2: Playing with the API
- Part 2: Introducing the Django Admin
Part 3:
- Part 3: Writing more views
- Part 3: Write views that actually do something
- Part 3: Write views that actually do something - with templates
- Part 3: Write views that actually do something - A shortcut: render()
- Part 3: Raising a 404 error
- Part 3: Raising a 404 error - A shortcut: get_object_or_404()
- Part 3: Use the template system
- Part 3: Removing hardcoded URLs in templates
- Part 3: Namespacing URL names
Part 4
- Part 4: Write a minimal form
- Part 4: Write a minimal form - results view
- Part 4: Use generic views: Less code is better
Part 5:
- Part 5: Writing our first test - Create a test to expose the bug
- Part 5: Writing our first test - Fixing the bug
- Part 5: Writing our first test - More comprehensive tests
- Part 5: Test a view - Improving our view
- Part 5: Test a view - Testing our new view
- Part 5: Test a view - Testing the DetailView
Part 6:
Part 7:
- Part 7: Customize the admin form - reordering the fields
- Part 7: Customize the admin form - split the form
- Part 7: Adding related objects - register Choice with the admin
- Part 7: Adding related objects - remove Choice from admin, add inline
- Part 7: Adding related objects - use TabularInline (instead of StackedInline)
- Part 7: Customize the admin change list - use list_display option
- Part 7: Customize the admin change list - include was_published_recently()
- Part 7: Customize the admin change list - add attributes to was_published_recently()
- Part 7: Customize the admin change list - add list_filter
- Part 7: Customize the admin change list - add search_fields
- Part 7: Customize the admin look and feel - Customizing your project’s templates
Part 8:
- Prerequisites
- Installation
- Clone the Repository
- Create a Virtual Environment (optional but recommended)
- Activate your Virtual Environment
- Install the Dependencies
- Database Setup
- Create a Superuser (optional)
- Running the Project
- Testing
- Run all tests
- Run a single test
- Python 3.6 or later
- Git
- (Optional) Virtualenv or equivalent virtual environment tool
git clone git@github.com:Anthonyythomas/django-tutorial-step-by-step.git
cd django-tutorial-step-by-step
git clone https://github.com/Anthonyythomas/django-tutorial-step-by-step.git
cd django-tutorial-step-by-step
virtualenv venv
python3 -m venv venv
source venv/bin/activate
venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Open the project in a web browser at http://127.0.0.1:8000/.
python manage.py test
python manage.py test models