There is a lot of confusion when newcomers try to understand Django definition of an ‘App’ . In this post we’ll examine the Three major concepts of Django architecture.
- 3rd party packages
A Django project is your entire application that you want to build and there is only ever one project and many ‘apps’. it consist of all your configuration files, setting files. lets look at the example.
Example : suppose we want to create a project let say quiz project and in this quiz project we need some functionality like user authentication, blog.
Lets create the quiz project.
# command to create project django-admin startproject quiz
we have created the project now lets add those functionalities what we have defined above. but for adding those functionalities to our project we need to create an apps . just like in WordPress we install the plugins whenever we want to add some functionalities to our website/project/application.
A Django App is like plugin for our project which provide with us particular functionality so that we can make our project more elegant. and for our quiz project we are going to create two apps blog and registration.
# command to create an app in Django # blog app python manage.py startapp blog # registration app python manage.py startapp registration
Note : In Django whenever we want to add some functionalities to our project we create an apps.
3rd Party Packages
A 3rd party package is a plain old Django application that has been designed to be pluggable into any existing project with the Python packaging tools. You can see a tutorial on this here. It takes just a few additional steps.
This is a case where we can see the power of separating out functionality into smaller apps. It’s far easier to share them either within a larger project, within a company, or to make public like a 3rd Party Package.
Django apps may seem like overkill when you’re starting out but they provide much needed structure and flexibility to any Django web application.