Skip to content

bartoszcholewa/django4-learning

Repository files navigation

Django 4 by Example - Antonio Melé [packt] 2022


Repository is a continuation of django3-learning based on book of Antonio Melé - Django 3 By Example.


Requirements

Project is based on Python 3.10.* and Django 4.1.0

All required packages are in requirements.txt

pip install -r requirements.txt

Add new package to requirements.in and compile new file by

pip-compile

To add and install new package run

pip-compile && pip-sync

Pre-commit hooks

To add new pre-commit hook, edit .pre-commit-config.yaml

Then install new hooks by

pre-commit install

and check if everythin passes by

pre-commit run --all-files

Celery, RabbitMQ, Redis and Flower

Terminal 1

docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:management

Termina 2

celery -A myshop worker -l info

Terminal 3

celery -A myshop flower

Terminal 4

docker run -it --rm --name redis -p 6379:6379 redis

Stripe CLI

stripe login
stripe listen --forward-to localhost:8000/payment/webhook/

Memchacked

docker pull memcached
docker run -it --rm --name memcached -p 11211:11211 memcached -m 64

Covered chapters

  • Chapter 8: Building an Online Shop

    • Creating an online shop project
    • Building a shopping cart
    • Registering customer orders
    • Asynchronous tasks
  • Chapter 9: Managing Payments and Orders

    • Integrating a payment gateway
    • Exporting orders to CSV files
    • Extending the administration site with custom views
    • Generating PDF invoices dynamically
  • Chapter 10: Extending Your Shop

    • Creating a coupon system
    • Building a recommendation engine
  • Chapter 11: Adding Internationalization to Your Shop

    • Preparing your project for internationalization
    • Translating Python code
    • Translating templates
    • Rosetta
    • Fuzzy translations
    • URL patterns
    • Switching languages
    • django-parler
    • Format localization
    • django-localflavor
  • Chapter 12: Building an E-Learning Platform

    • Setting up the e-learning project
    • Serving media files
    • Building the course models
    • Creating models for polymorphic content
    • Adding authentication views
  • Chapter 13: Creating a Content Management System

    • Creating a CMS
    • Managing course modules and the contents
  • Chapter 14: Rendering and Caching Content

    • Displaying courses
    • Adding student registration
    • Accessing the course contents
    • Using the cache framework
  • Chapter 15: Building an API

    • Building a RESTful API
  • Chapter 16: Building a Chat Server

    • Creating a chat application
    • Real-time Django with Channels
    • Installing Channels
    • Writing a consumer
    • Routing
    • Implementing the WebSocket client
    • Enabling a channel layer
    • Modifying the consumer to be fully asynchronous
    • Integrating the chat application with existing views
  • Chapter 17: Going Live

    • Creating a production environment
    • Using Docker Compose
    • Serving Django through WSGI and NGINX
    • Securing your site with SSL/TLS
    • Using Daphne for Django Channels
    • Creating a custom middleware
    • Implementing custom management commands

Chapter 8 - Additional resources

Chapter 9 - Additional resources

Chapter 10 - Additional resources

Chapter 11 - Additional resources

Chapter 12 - Additional resources

Chapter 13 - Additional resources

Chapter 14 - Additional resources

Chapter 15 - Additional resources

Chapter 16 - Additional resources

Chapter 17 - Additional resources

About

Django 4 by Example - Antonio Melé [packt] 2022

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published