0% found this document useful (0 votes)
17 views11 pages

Python With Django Project (Login&Register)

Uploaded by

azim292002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views11 pages

Python With Django Project (Login&Register)

Uploaded by

azim292002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Python With Django Project

Sing-in and Register Page


Step by Step Process
Step 1
Create two folders example:
Login_Register_Login_Page\Project
Step 2
Open D:\ Login_Register_Login_Page\Project (Path) on vs code.
1. Using Cmd: Open the original file location → Go to the path area (present above the screen) →
Select the path and remove it and write cmd and press enter → In cmd write “code .”
or
2. Using VS Code: Open VS code → Go to File Tab → Select Open Folder → Select the folder
Django_Project

Also in VS code→ Go to File Tab → Select Auto Save option (This will auto save the programs)
Now we are going to add a virtual environment and a project under this Django_Project Folder
• Step 3
Setting up virtual environment.
Open terminal by pressing “Ctrl + Shift + `”

• Step 4
Install django → needs to be installed within venv

➢ pip install Django

• Step 5
Create a project under D:\Python_With_Django_\Django_Project

➢ django-admin startproject project

Here “project” is the project name.

• Step 6
Move to project folder by using the cd command (change directory).

➢ cd project

• Step 7
Now we need to create an app within the project (i.e, myrecaptcha)

➢ python manage.py startapp app

Here app name is “app”. We can also name it something else.

• Step 8
Adding the app to the settings.py file.
The `app` is added to `INSTALLED_APPS` to register it as a Django application, allowing its
functionalities to be utilized.
• Step 9
Within “app” write the code in “models.py”

• Step 10
Within “app” write the code in “views.py”
• Step 10
Within “app” create a file “urls.py”
And then write the code in “urls.py”
• Step 11
Within “project” open the file “urls.py”
And then make the changes in “urls.py”

• Step 12
Within “app” create the folder “templates”
Next, within “templates” create three files named:
▪ home.html
▪ login.html
▪ register.html
• Step 13
Enter the code in “home.html”
• Step 14
Enter the code in “login.html”

……….continued code
• Step 15
Enter the code in “register.html”

……………continued code

• Step 16
Create a new folder “static” for storing images in “app”
Next download two images:
▪ One for Sign in page
▪ Another one for Register page
• Step 17
Go “settings.py” and enter the code in line 120

• Step 18
Run these codes in the terminal
After running these codes new files will be created

You might also like