7. Apps

7.1. Reusability

7.2. Location

Code 7.18. Django Apps Location

7.3. Create

$ cd addressbook
$ django-admin startapp contact
# settings.py
INSTALLED_APPS += ['addressbook.contact.apps.ContactConfig']

7.4. Structure

Code 7.19. Django Apps Structure
mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        wsgi.py
    polls/
        __init__.py
        admin.py
        migrations/
            __init__.py
            0001_initial.py
        models.py
        static/
            polls/
                images/
                    background.gif
                style.css
        templates/
            polls/
                detail.html
                index.html
                results.html
        tests.py
        urls.py
        views.py
    templates/
        admin/
            base_site.html

7.5. Configuration

Code 7.20. Django Apps Configuration
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _


class ContactConfig(AppConfig):
    name = 'contact'
    verbose_name = _('Contact')