
Create a new django app named sql query, activate the virtual environment, and run manage.py startapp to generate it. Register the app in settings installed apps so Django recognizes it.
Package your SQL query inspector middleware for Django package distribution on PyPI and validate it on TestPyPI before uploading to the Python Package Index, preparing your package description and metadata.
Package a simple Django middleware as a Python package for distribution on the Python Package Index, including license, readme, toml metadata, and dependencies like Django, Pygments, SQL, and Python 3.11+.
Create and publish a new GitHub repository, using Git for version control and GitHub desktop, configure a .gitignore, commit changes, push, and automate uploading to Python package index with actions.
The Python Package Index (PyPI) is a software repository for the Python programming language. in this course, we teach you how to build and publish a Python package to the PyPI. The package we built and published is centred around a Django middleware tool we developed in this course. We start by learning how to build a Django project and how to inspect SQL queries executed by a Django application. We will learn the basics of Django Middleware and how to build a simple middleware component that will form our package's basic functionality. Once we grasp the fundamentals of Django, Django middleware and how to capture SQL queries executed by Django, we move to the next phase, building a new package. In the first stages, we explore the essential files and configurations required to build a new package. We then incorporate the middleware we have built previously and build our package in preparation for being uploaded to the PyPI. The life cycle of our application does not stop after distribution. Therefore we take the following steps to automate the delivery of our app to the PyPI. We develop GitHub actions to manage the packaging and upload of the package to the PyPI. In this course, we provide an introduction to testing with Pytest, creating stand-alone Django apps to aid the testing process.