Skip to main content

Django Views (FBV) Complete Guide Telugu

 


🧠 Django Views ante enti?

Django lo View ante backend logic handle chese part.
User request vachinappudu, view process chesi response return chestundi.

πŸ‘‰ Simple ga:
πŸ‘‰ User → Request → View → Response (HTML page)


⚙️ Simple Function Based View (FBV)

πŸ‘‡ Example:

πŸ‘‰ Explanation:

  • request → user nunchi request
  • render() → HTML file return chestundi

πŸ”— URL connect cheyadam

πŸ‘‰ urls.py lo add cheyali:


πŸ‘‰ Ippudu browser lo / open chesthe → index.html load avutundi πŸ”₯


πŸ“Š Dynamic Data pass cheyadam

πŸ‘‰ Static kaadu, data send cheyyochu:




πŸ–₯️ Template lo display



πŸ‘‰ Ippudu dynamic data show avtundi ✔️


πŸ” Loop example (Multiple data)



⚠️ Common mistakes

❌ Template path wrong
❌ Context pass cheyyakapovadam
❌ urls.py connect cheyyakapovadam


🎯 Conclusion

πŸ‘‰ Django lo views chala important
πŸ‘‰ Templates tho kalisi dynamic websites create cheyochu.



Comments

Popular posts from this blog

“Password Reset in Django – Complete Guide”

  Password Reset in Django – Complete Guide πŸ” Introduction Web applications lo Password Reset feature chala important. User password marchipothe, easy ga recover chesukovadaniki use avutundi. Real-time lo: Gmail Facebook Instagram anni password reset system use chestayi. ⚙️ How Password Reset Works? πŸ‘‰ Step-by-step flow: User “Forgot Password” click chestadu Email enter chestadu System reset link send chestundi User link open chestadu New password set chestadu πŸ‘‰ Idi secure ga untundi because: Token based verification Time limit untundi ⚙️ Django Password Reset Code 1️⃣ settings.py (EMAIL Setup) # settings.py EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' πŸ‘‰ Dev lo console lo email link chupistundi πŸ‘‰ Production lo Gmail SMTP use cheyachu 2️⃣ urls.py from django . urls import path from django . contrib . auth import views as auth_views urlpatterns = [ path ( 'password-reset/' , auth_v...

Python Day 5 – If Else Conditions

  🐍 Python Day 5 – If Else Conditions 🧠 Introduction 🐍 Python Day 5 – If Else Conditions Ippati varaku manam operators nerchukunnam. I roju manam decision making (If-Else) nerchukundam. πŸ‘‰ Program lo condition base chesi decisions tiskovadaniki use avutundi πŸ’‘ Example: Age 18 kanna ekkuva unte → eligible Lekapothe → not eligible πŸ”Ή Basic If Condition age = 20 if age > 18 : print ( "Eligible" ) πŸ”Ή If-Else Condition age = 16 if age >= 18 : print ( "Eligible" ) else : print ( "Not Eligible" ) πŸ”Ή If-Elif-Else marks = 75 if marks >= 90 : print ( "Grade A" ) elif marks >= 60 : print ( "Grade B" ) else : print ( "Grade C" ) πŸ§ͺ Real Example (User Input) age = int ( input ( "Enter your age: " )) if age >= 18 : print ( "You can vote ✅" ) else : print ( "You cannot vote ❌" ) ⚠️ Important Points πŸ‘‰ Indentation (space) very import...

Python Day 8 – Lists

  🧠 Introduction 🐍 Python Day 8 – Lists Ippati varaku manam functions nerchukunnam. Eroju manam Lists gurinchi nerchukundam. πŸ‘‰ List ante multiple values ni okesari store cheyadaniki use avutundi πŸ’‘ Example: Shopping items list laga πŸ“¦ πŸ”Ή Create List numbers = [ 1 , 2 , 3 , 4 , 5 ] names = [ "Manju" , "Ravi" , "Kiran" ] πŸ”Ή Access List (Index) print ( numbers [ 0 ]) # 1 print ( names [ 1 ]) # Ravi πŸ‘‰ Index always 0 nundi start avutundi ⚠️ πŸ”Ή Add Elements numbers . append( 6 ) print ( numbers ) πŸ”Ή Remove Elements numbers . remove( 3 ) print ( numbers ) πŸ”Ή Loop Through List for i in numbers : print ( i ) πŸ”Ή List Length print ( len ( numbers )) πŸ”Ή Slicing print ( numbers [ 1 : 4 ]) πŸ§ͺ Real Example marks = [ 80 , 90 , 75 , 60 ] for m in marks : if m >= 75 : print ( "Pass:" , m ) 🎯 Mini Practice names = [ "A" , "B" , "C" ] names . append( "D...