Django Introduction Example : 1 To test Python Django working Example :2 To display welcome message Example :3 To To Display Students Data In Table Format
Setting the Path of Python
* setting PYTHON_HOME
* Select the path of python
* C:\Python37
* Set the path (PYTHON_HOME)
* PYTHON_HOME= C:\Python37;
* AND CHANGE IN PATH as
* %PYTHON_HOME%;
Suppose we have a folder
E:\DJANGO
To test Django
GO TO folder e:\django
Step :1 : Create a project in django
E:\Django>django-admin startproject welcome
E:\Django>dir
Volume in drive E is disk_2_2
Volume Serial Number is 4CD9-C42C
Directory of E:\Django
12/15/2019 08:46 PM <DIR> .
12/15/2019 08:46 PM <DIR> ..
12/15/2019 08:46 PM <DIR> welcome
0 File(s) 0 bytes
3 Dir(s) 109,864,316,928 bytes free
E:\Django>
Step:2 : go inside the project folder using “cd” command.
E:\Django>cd welcome
E:\Django\welcome>
Step:3 : Create an application
E:\Django\welcome>python manage.py startapp testapp
E:\Django\welcome>dir
Volume in drive E is disk_2_2
Volume Serial Number is 4CD9-C42C
Directory of E:\Django\welcome
12/15/2019 08:51 PM <DIR> .
12/15/2019 08:51 PM <DIR> ..
12/15/2019 08:46 PM 648 manage.py
12/15/2019 08:51 PM <DIR> testapp
12/15/2019 08:51 PM <DIR> welcome
1 File(s) 648 bytes
4 Dir(s) 109,864,263,680 bytes free
E:\Django\welcome>
Step:4 : Run the server so that we can check whether django is running or not.
E:\Django\welcome>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks…
System check identified no issues (0 silenced).
You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run ‘python manage.py migrate’ to apply them.
December 15, 2019 – 21:15:48
Django version 2.2.3, using settings ‘welcome.settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Step:5 Now copy and paste
http://127.0.0.1:8000/
we get output as
If the above screen gets displayed on the browser it means our django is running properly.
Congrats
Django Introduction Example : 1 To test Python Django working Example :2 To display welcome message Example :3 To To Display Students Data In Table Format