Wednesday, March 24, 2021

python introduction day1

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> 5+10
15
>>> a=5
>>> print(a)
5
>>> print(type(a))

>>> b=10
>>> print(b)
10
>>> print(type(b))

>>> c=a+b
>>> print(c)
15
>>> print(type(c))

>>> a="saikumar"
>>> print(a)
saikumar
>>> print(type(a))

>>> print(id(a))
23484040
>>> print(id(a))
23484040
>>> print(id(b))
1656382704
>>> a=15
>>> a
15
>>> type(a)

>>> id(a)
1656382784
>>> a=20
>>> id(a)
1656382864
>>>

Tuesday, March 16, 2021

django day6 class html input

https://drive.google.com/file/d/1z8wgE8vx-OeX4j-0ii7LjAHMddpDKMNk/view?usp=sharing

Sunday, March 14, 2021

django day 5 view page logic

View.py ===================== from django.shortcuts import render from django.http import HttpResponse # Create your views here. def home(request): #1+2 #HttpResponse("

this is homepage

") #return HttpResponse("

this is test2 app homepage

") user="ranjith" context={'name':user} if user == "chandu": #context={'name':user} return render(request, "home.html", context) elif user == "ranjith": return render(request, "contact.html", {'price':1000}) else: return render(request, "home.html", context) def contact(request): return HttpResponse("

this is app contactpage

") contact.html =========================

HTML Table

Company Contact price
Alfreds Futterkiste Maria Anders {{price}}
Centro comercial Moctezuma Francisco Chang {{price}}
Ernst Handel Roland Mendel Austria
Island Trading Helen Bennett UK
Laughing Bacchus Winecellars Yoshi Tannamuri Canada
Magazzini Alimentari Riuniti Giovanni Rovelli Italy
urls.py =================================== from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('',views.home,name="home"), path('contact',views.contact,name="contact") ]

Monday, March 8, 2021

django day4 first app running

your app urls.py ===================== from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('',views.home,name="home"), path('contact',views.contact,name="contact") ] your app views.py ====================== from django.shortcuts import render from django.http import HttpResponse # Create your views here. def home(request): #1+2 #HttpResponse("

this is homepage

") #return HttpResponse("

this is test2 app homepage

") return render(request, "home.html", {'name': "the king"}) def contact(request): return HttpResponse("

this is app contactpage

") template--home.html ========================

this is templates page home page{{name}}

this is templates page home page{{name}}

this is templates page home page{{name}}

this is templates page home page{{name}}

this is templates page home page{{name}}

this is templates page home page{{name}}

project urls.py ============================= from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('',include('test2.urls')), path('admin/', admin.site.urls), ]

Sunday, March 7, 2021

django day3

#urls.py from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('',views.home,name="home"), path('contact',views.contact,name="contact"), path('aboutus',views.aboutus,name="aboutus"), path('admin/', admin.site.urls), ] #views.py from django.http import HttpResponse def home(request): #1+2 #HttpResponse("

this is homepage

") return HttpResponse("

this is firstpage

") def contact(request): return HttpResponse("

this is contactpage

") def aboutus(request): return HttpResponse("

about page

")

Friday, March 5, 2021

sep, end in print method in python

""" print(10,20,30,sep='@') print(10,20,end='') print(" ", 30) #print(input("enter number")) #print("you opened django server with IP:http://127.0.0.1:8000\n") def ranjith(): print("ranjith is basha") print("chandu is king") ranjith() def connect(): print("you opened django server with IP:http://127.0.0.1:8000\n") def disconnect(): print("it is disconnected") connect() while(1): print("basha") disconnect() i=0 if(i==0): print("rajinikanth") else: print("ramyakrishna") """

python class topic video