Django Framework
Django Framework
URLS:
-UNIFORM RESORCE LOCATER.
PURPOSE:To navigate the website.All urls are available in url.py
1.AFTER END USER HIT THE URL ENTER THEN IT CHANGES TO HTTP
REQUEST AND CHECKS IF IT IS IN URL.PY
3.IF IT THE URL IS PRESENT, then models get imported and other
Django modules as arguments. IF not there 404 errors occurs.
Create venv
Py -m venv soc-3
List of dictionaries
127.0.0.1:8000/admin/
Py manage.py createsuperuser
Bootstrap-Prototype to production
Project-employee management system
Without specifying url-index page
View-all_emp
View-add_emp
View-remove an employee
View-filter employee detailds
Create a project under soc3 environment,the project name is
emp_mgt and create an app under this project emp_app ,add
emp_app settings.py .now create template folder under emp_app
Create 5 html files
1.index.html
2.
2.add_emp.html
3.remove_emp.html
4.view_all_emp.html
5.filter_emp.html
def index(request):
return render(request,’index.html’)
then open urls.py file
path(‘ ’, views.index,name=”index”)
Add an employee
First and last text then remain number
F ,l,s,d,r,b,phone
Form action url name
If request.method==’post’:
F=request.POST[‘’]