我想访问function.Python中if语句的变量

2024-05-11 07:30:26 发布

您现在位置:Python中文网/ 问答频道 /正文

def Home(request):#django

    if request.method == 'POST':
        city = request.POST.get('search')
        print(city)
        
    URL = f'http://api.openweathermap.org/data/2.5/weather?q={city}

Tags: djangoapihttpurlcityhomesearchget