The document discusses how to create applications within a Django project and how to install applications in the project. It explains that the startapp command is used to create one or multiple applications within the project folder. It also explains that applications must be installed in the project by adding them to the INSTALLED_APPS list in the settings.py file for Django to recognize them. Sample commands and code are provided to demonstrate creating a project, applications within it, and installing the applications.
The document discusses how to create applications within a Django project and how to install applications in the project. It explains that the startapp command is used to create one or multiple applications within the project folder. It also explains that applications must be installed in the project by adding them to the INSTALLED_APPS list in the settings.py file for Django to recognize them. Sample commands and code are provided to demonstrate creating a project, applications within it, and installing the applications.
The document discusses how to create applications within a Django project and how to install applications in the project. It explains that the startapp command is used to create one or multiple applications within the project folder. It also explains that applications must be installed in the project by adding them to the INSTALLED_APPS list in the settings.py file for Django to recognize them. Sample commands and code are provided to demonstrate creating a project, applications within it, and installing the applications.
The document discusses how to create applications within a Django project and how to install applications in the project. It explains that the startapp command is used to create one or multiple applications within the project folder. It also explains that applications must be installed in the project by adding them to the INSTALLED_APPS list in the settings.py file for Django to recognize them. Sample commands and code are provided to demonstrate creating a project, applications within it, and installing the applications.
Download as PPTX, PDF, TXT or read online from Scribd
Download as pptx, pdf, or txt
You are on page 1/ 4
How to Start/Create Application
A Django project contains one or more applications which means we create application inside Project Folder. Syntax:- python manage.py startapp appname
Creating One Application inside Project:-
• Go to Project Folder • Run Command python manage.py startapp course
Creating Multiple Applications inside Project:-
• Go to Project Folder • python manage.py startapp course • python manage.py startapp fees • python manage.py startapp result How to Install Application in Our Project As we know a Django project can contain multiple application so just creating application inside a project is not enough we also have to install application in our project. We install application in our project using settings.py file. settings.py file is available at Project Level which means we can install all the application of project. This is compulsory otherwise Application won’t be recognized by Django. Open settings.py file INSTALLED_APPS = [ INSTALLED_APPS = [ ‘django.contrib.admin’, ‘django.contrib.admin’, ‘course’, ‘application_name1’, ] ‘application_name2’, INSTALLED_APPS = [ ] ‘django.contrib.admin’, Save settings.py File ‘course’, ‘fees’, ‘result’, ] Geeky Steps • Create Django Project: django-admin startproject geekyshows • Change Directory to Django Project: cd geekyshows • Create Django Application: python manage.py startapp course • Add/Install Application to Django Project (course to geekyshows) Open settings.py Add course INSTALLED_APPS = [‘django.contrib.admin’,‘course’, ] Save settings.py Geeky Steps • Create Django Project: django-admin startproject geekyshows • Change Directory to Django Project: cd geekyshows • Create Django Application1: python manage.py startapp course • Create Django Application2: python manage.py startapp fees • Create Django Application3: python manage.py startapp result • Add/Install Applications to Django Project Open settings.py Add course, fees, result INSTALLED_APPS = [‘django.contrib.admin’,‘course’, ‘fees’ , ‘result’ ,] Save settings.py