Professional Documents
Culture Documents
BY :KAMALPREET KAUR
SCHOOL OF COMPUTER SCIENCE AND ENGINEERING
Django Virtual Environment
A Django virtual environment is a self contained directory that houses a specific Python
environment for Django project.
It allows you to isolates the dependencies and libraries for that particular project ,ensuring
that different project can have their own unique sets of dependencies without interfering
with each others.
Python has a tool called venv that creates these isolated environment.
.
Once activated ,the virtual environment provides its own Python executable and its own
set of libraries separate from the system –wide Python installation.
python –m venv myenv
myenv\Scripts\activate.bat -For Window
source myenv/bin/activate -Linux
Installing Django
Open VS
Open new terminal
Change the path using cd where the project is available
Make a project using (mkdir project)
.
.
Writing content in paragraph-”””
Results
.
Adding f string
Iterating the dictionary
Providing path to dictionary
.
Output
Dynamic URL in Django
Dynamic route means there will be only one route and values going to be changed.
Dynamic pages can be made on three basis:
a) int
b) str
c) slug
Adding dynamic path in url.py
Creating the function with dynamic parameter
Dynamic Output
Dynamic Output(parameter dynamic)
Dynamic Output(parameter dynamic)
Dynamic string output
Dynamic routing-using slug
Output