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

Django ante enti? (Beginner Friendly Telugu Guide)

  Introduction Meeru web development start cheyyali anukuntunnara? Leka backend development nerchukovali anukuntunnara? Appudu meeru tappakunda vinnadi oka peru ๐Ÿ‘‰ Django Ee article lo manam simple ga, clear ga ardham ayyela chuddam — Django ante enti, enduku use chestaru, ela start cheyyali.

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...

Django Templates & HTML Rendering (Complete Guide Telugu)

  Introduction Previous article lo manam Views & URLs chusam. Ipudu next important concept ๐Ÿ‘‰ Templates & HTML Rendering Django lo dynamic HTML pages ela create cheyyalo ee article lo nerchukundam ๐Ÿ”ฅ ๐Ÿง  Templates ante enti? ๐Ÿ‘‰ Template ante HTML file "T emplate ante HTML file matrame kaadu, Django lo dynamic content ni display cheyadaniki use chestam. Example ga, database lo unna blog posts ni HTML page lo chupinchadaniki templates use avutayi. " But special enti ante: ๐Ÿ‘‰ Dynamic data display cheyyachu (Python data → HTML lo show) ๐Ÿ“ Templates folder create cheyyadam Mee app lo templates ane folder create cheyandi: myapp/ templates/ index.html ⚙️ settings.py lo config cheyyali settings.py open cheyandi: TEMPLATES = [ { 'DIRS': [], ... }, ] ๐Ÿ‘‰ Usually app templates automatic ga detect chestundi ๐Ÿ’ป Simple HTML Template index.html : <!DOCTYPE html> <html> <head> <title>Django Page</title> ...