Embed presentation
Download to read offline






![So, let’s first explore what each file does:● migrations/: here Django stores some files to keep track of the changes you create inthe models.py file, so to keep the database and the models.py synchronized.● admin.py: this is a configuration file for a built-in Django app called Django Admin.● apps.py: this is a configuration file of the app itself.● models.py: here is where we define the entities of our Web application. The models aretranslated automatically by Django into database tables.● tests.py: this file is used to write unit tests for the app.● views.py: this is the file where we handle the request/response cycle of our Webapplication.Now that we created our first app, let’s configure our project to use it. Open settings.py file andfind installed_apps block.settings.pyINSTALLED_APPS = ['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','Django.contrib.staticfiles',‘articles’]Here we have added ‘articles’ in the installed apps section. Now the app is ready to run with theDjango project.Configuring DatabaseBy default Django project comes with sqlite3 database but you can customize it to use MySQLor Postgresql as per the requirements.settings.py](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fdjangoworkflowandarchiecture-221123113142-1035710f%2f75%2fDjango-Workflow-and-Architecture-7-2048.jpg&f=jpg&w=240)


Django is a free and open-source web application framework written in Python that simplifies web development through its MVT architecture, which stands for Model, View, and Template. It offers benefits such as rapid development, security, scalability, and ease of modification, making it a popular choice for developers. The document also outlines how to create a new Django project and app, as well as how to configure a database for the project.






![So, let’s first explore what each file does:● migrations/: here Django stores some files to keep track of the changes you create inthe models.py file, so to keep the database and the models.py synchronized.● admin.py: this is a configuration file for a built-in Django app called Django Admin.● apps.py: this is a configuration file of the app itself.● models.py: here is where we define the entities of our Web application. The models aretranslated automatically by Django into database tables.● tests.py: this file is used to write unit tests for the app.● views.py: this is the file where we handle the request/response cycle of our Webapplication.Now that we created our first app, let’s configure our project to use it. Open settings.py file andfind installed_apps block.settings.pyINSTALLED_APPS = ['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','Django.contrib.staticfiles',‘articles’]Here we have added ‘articles’ in the installed apps section. Now the app is ready to run with theDjango project.Configuring DatabaseBy default Django project comes with sqlite3 database but you can customize it to use MySQLor Postgresql as per the requirements.settings.py](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fdjangoworkflowandarchiecture-221123113142-1035710f%2f75%2fDjango-Workflow-and-Architecture-7-2048.jpg&f=jpg&w=240)
