path ¶įilesystem path to the application directory, e.g. This attribute defaults to label.title(). Human-readable name for the application, e.g. It must be unique across a Django project. It defaults to the last component of name. This attribute allows relabeling an application when two applications
This attribute defines which application the configuration applies to. name ¶įull Python path to the application, e.g. INSTALLED_APPS contains the path to an application module ratherĬonfigurable attributes ¶ AppConfig. The apps.pyĬonvention merely allows Django to load them automatically when You can define any other attribute documented in theĪppConfig subclasses may be defined anywhere. The AppConfig.name attribute tells Django which application thisĬonfiguration applies to. Specific class in their INSTALLED_APPS setting. If your users want to pick a non-defaultĬonfiguration, they must replace 'rock_n_roll' with the dotted path to that To tell Django which one to use by default, set default to You can provide several AppConfig subclasses with different behaviors. If you need to prevent this, setĭefault to False in the class definition. RockNRollConfig will be loaded automatically when INSTALLED_APPSĬontains 'rock_n_roll'. # rock_n_roll/apps.py from django.apps import AppConfig class RockNRollConfig ( AppConfig ): name = 'rock_n_roll' verbose_name = "Rock ’n’ roll" There’s no restriction that a project package can’t also be considered anĪpplication and have models, etc. That’s why the application registry maintains metadata in anĪppConfig instance for each installed application. Interact with installed applications, mainly for configuration and also for However, there’s a few places where Django needs to There’s no such thing asĪn Application object. That interacts with various parts of the framework.
It is important to understand that a Django application is a set of code Mechanisms such as URLconfs, the MIDDLEWARE setting, or template Projects with the INSTALLED_APPS setting and optionally with other Tags, static files, URLs, middleware, etc. Applications may be reused in variousĪpplications include some combination of models, views, templates, template The term application describes a Python package that provides some set ofįeatures. The container for all of a project’s applications which aren’t installed
Templates which aren’t tied to a particular application.Ī project’s root directory (the one that contains manage.py) is usually Project package is often extended to include things like fixtures, CSS, and Package with settings.py, urls.py, asgi.py and wsgi.py. You’ll get a mysite project directory that contains a mysite Python For example, when you run django-admin startproject mysite
Package is defined primarily by a settings module, but it usually contains The term project describes a Django web application.