DJango Tutorial - Django Project vs App

Last updated Jun 11, 2021

In this Django tutorial series we will cover what is Django project and App. There is plenty of confusion when newcomers plan to understand Django definition of an ‘App’ . during this post we’ll examine the Three major concepts of Django architecture.

  1. Project
  2. Apps
  3. Third party packages

 

Django Project vs App

 

Project
A Django project is your entire application that you simply simply want to make and there is only ever one project and much of ‘apps’. it contains all of your configuration files, setting files. lets check out the instance .
Example : suppose we might wish to make a project let say quiz project and through this quiz project we'd like some functionality like user authentication, blog.
Lets create the quiz project.

# command to make project
django-admin startproject quiz

 

we have created the project now lets add those functionalities what we've defined above. except for adding those functionalities to our project we'd like to make an apps . a bit like in WordPress we install the plugins whenever we would like to feature some functionalities to our website/project/application.

Apps
A Django App is like plugin for our project which give with us particular functionality so as that we'll make our project more elegant. and for our quiz project we are getting to create two apps blog and registration.

 

# command to make an app in Django
# blog app
python manage.py startapp blog
# registration app
python manage.py startapp registration

 

Note:In Django whenever we might wish to feature some functionalities to our project we create an apps.

 

Third-party packages
A 3rd party package may be a plain old Django application that has been designed to be pluggable into any existing project with the Python packaging tools. you'll see a tutorial on this here. It takes just a couple of additional steps.
This is a case where we'll see the power of separating out functionality into smaller apps. It’s far easier to share them either within a much bigger project, within an organization , or to make public kind of a third Party Package.

 

Conclusion
Django apps could seem like overkill when you’re starting out but they supply much needed structure and adaptability to any Django web application.

 

Article Contributed By :
https://www.rrtutors.com/site_assets/profile/assets/img/avataaars.svg

505 Views