Chapter 2. Django Quick Start

Project vs. App

Project vs. App
Tag:

As explained in the previous sections, the django-admin startproject command mostly creates configuration files required to manage the project, while the startapp command creates key files to design Django applications. It is essential for you to understand that one Django project can have multiple apps. As you saw in the earlier section, several preset apps are already written. You can also add several customized apps of your own.

A URL dispatcher plays an important role in managing multiple apps under one Django project. The urls.py file created when you run the django-admin startproject command will be an entry point for HTTP requests. As explained in the previous section, the main urls.py file can include other URLs written in other urls.py files created under the app directory.

The approach to connecting with more than one application is the same. You can add another line of URL patterns in the main urls.py file, like shown in the illustration below.

Project-vs-App

As explained in the previous sections, the django-admin startproject command mostly creates configuration files required to manage the project, while the startapp command creates key files to design Django applications. It is essential for you to understand that one Django project can have multiple apps. As you saw in the earlier section, several preset apps are already written. You can also add several customized apps of your own.

A URL dispatcher plays an important role in managing multiple apps under one Django project. The urls.py file created when you run the django-admin startproject command will be an entry point for HTTP requests. As explained in the previous section, the main urls.py file can include other URLs written in other urls.py files created under the app directory.

The approach to connecting with more than one application is the same. You can add another line of URL patterns in the main urls.py file, like shown in the illustration below.

Project-vs-App

Tag: