Posts

addition of two numbers using django python

Image
views.py  from urllib import request from django . shortcuts import render from django . http import HttpResponse # Create your views here. def add ( request ):         val1 = float ( request .GET.get( "num1" ))     val2 = float ( request .GET.get( "num2" ))     ans = val1 + val2     return render ( request , "mypage1.html" ,{ 'answer' : ans }) #GET             varnam=request.POST.get('is_private', False)   # or    POST     varnam=request.GET.get('is_private', False) ---------------------------------------------------------------------------- mypage1.html   <body>       <form action="add">           enter first num <input type="text" name="num1">           <br>           enter second num <input type="text" name="num2">       ...

create project hello world using django python step by step

Image
create project hello world using django python step by step 1   Hello world program in django using html( in templates) download python 3 and install download vs code editor and install open vs code editor press ALT +T and enter  or go to terminal menu ->select new terminal ------------------------------------------------- type following commands ----------------------------------------------- cd Desktop for desktop path venv virtual environment support libraries and files activate virtual environment then add pip commands to install django commands in Red PS C:\Users\sachi> cd Desktop PS C:\Users\sachi\Desktop> python -m venv myenv PS C:\Users\sachi\Desktop> myenv\Scripts\activate     output: (myenv) PS C:\Users\sachi\Desktop>  now install django pip install django (myenv) PS C:\Users\sachi\Desktop> python -m pip install django ---------------------------------------------------------------- now create project (myenv) PS C:\Users\sachi\...