PYTHOPIACHANNEL Telegram 191
Pythopia
آخر این GET و POST توی وب دقیقا چی ان؟ تصور کن رفتی داروخانه: می‌گی: «قرص سردرد دارین؟» داروساز فقط جواب می‌ده بله/خیر. این میشه GET. فقط اطلاعات می‌گیری، چیزی نمی‌دی. حالا می‌گی: «این نسخه رو دارم، لطفاً داروهاشو برام بیارین.» 📝 این میشه POST. داری اطلاعات…
📌 مثال واقعی از جنگو:
# urls.py
path("login/", views.login_view)

# views.py
from django.shortcuts import render
from django.http import HttpResponse

def login_view(request):
if request.method == "POST":
# یعنی کاربر فرم لاگین رو فرستاده
username = request.POST.get("username")
password = request.POST.get("password")
return HttpResponse(f"سلام {username}، وارد شدی ")
else:
# یعنی کاربر فقط صفحه لاگین رو می‌خواد
return render(request, "login.html")

اینجا:

وقتی کاربر برای اولین بار وارد /login/ میشه، یه GET اتفاق افتاده (فقط صفحه رو می‌بینه).

وقتی فرم رو پر می‌کنه و می‌زنه روی دکمه ورود، یه POST میره سمت سرور.
@pythopiachannel
12



tgoop.com/pythopiachannel/191
Create:
Last Update:

📌 مثال واقعی از جنگو:

# urls.py
path("login/", views.login_view)

# views.py
from django.shortcuts import render
from django.http import HttpResponse

def login_view(request):
if request.method == "POST":
# یعنی کاربر فرم لاگین رو فرستاده
username = request.POST.get("username")
password = request.POST.get("password")
return HttpResponse(f"سلام {username}، وارد شدی ")
else:
# یعنی کاربر فقط صفحه لاگین رو می‌خواد
return render(request, "login.html")

اینجا:

وقتی کاربر برای اولین بار وارد /login/ میشه، یه GET اتفاق افتاده (فقط صفحه رو می‌بینه).

وقتی فرم رو پر می‌کنه و می‌زنه روی دکمه ورود، یه POST میره سمت سرور.
@pythopiachannel

BY Pythopia




Share with your friend now:
tgoop.com/pythopiachannel/191

View MORE
Open in Telegram


Telegram News

Date: |

To edit your name or bio, click the Menu icon and select “Manage Channel.” The group also hosted discussions on committing arson, Judge Hui said, including setting roadblocks on fire, hurling petrol bombs at police stations and teaching people to make such weapons. The conversation linked to arson went on for two to three months, Hui said. During the meeting with TSE Minister Edson Fachin, Perekopsky also mentioned the TSE channel on the platform as one of the firm's key success stories. Launched as part of the company's commitments to tackle the spread of fake news in Brazil, the verified channel has attracted more than 184,000 members in less than a month. Joined by Telegram's representative in Brazil, Alan Campos, Perekopsky noted the platform was unable to cater to some of the TSE requests due to the company's operational setup. But Perekopsky added that these requests could be studied for future implementation. Avoid compound hashtags that consist of several words. If you have a hashtag like #marketingnewsinusa, split it into smaller hashtags: “#marketing, #news, #usa.
from us


Telegram Pythopia
FROM American