python-requests Django Framework Django Core Concepts


Example

Django is a full stack, feature rich web development framework. It bundles a lot of functionality together to provide a common, quick and productive experience for web developers.

Django projects consist of common settings, and one or more applications. Each application is a set of functionality along with dependencies (such as templates and models) that are bundled together as Python modules.

The django bootstrapping script automatically creates a settings file for your project, with most common features enabled.

This concept of applications allows easy plug-and-play of functionality, and there is a large library of applications available to handle most common tasks. This concept of applications is fundamental to django; a lot of the built-in functionality (such as user authentication and the admin site) are simply django apps.

To create your first application, from within the project directory:

python manage.py startapp yourapp

yourapp is the name of your custom application.

Each application allows you to develop:

  1. A series of views - these are pieces of code that are executed in response to a request.

  2. One or more models; which are an abstraction to databases. These allow you to define your objects as Python objects, and the built-in ORM provides a friendly API to storing, retrieving and filtering objects from databases.

  3. Closely related to models are migrations which are scripts that are generated to provide a consistent and reliable method of applying changes in your models, to the database.

  4. A set of urls that the application will respond to.

  5. One or more admin classes; to customize how the application behaves in the built-in django admin application.

  6. Any tests that you may write.