from django.shortcuts import render
def your_view(request):
if request.method == 'POST':
dynamic_variable = request.POST.get('dynamic_variable')
static_word = "Static"
concatenated_word = static_word + " " + dynamic_variable
# Rest of your code
return render(request, 'your_template.html', {'concatenated_word': concatenated_word})
else:
return render(request, 'your_template.html')
@csrf_exempt
def recipe_form(request):
if request.method == 'POST':
name = request.POST.get('name')
amount=request.POST.get('amount')
input="recipe"
about="tell me about"
nutrition="Generate nutrition values for a"
user_input = name + " " + input
about_recipe = about + " " + name
nutrition_value = nutrition + " " + name
data = {
'name': user_input,
'amount':request.POST.get('amount')
}
# Print all the request data
print('Request Data:', data)
OUTPUT
Top comments (0)