Skip to content Skip to sidebar Skip to footer

How To Do Mapping User Input Html Page To View.py In Django?

I am a newbie in Django and not able to map my user-input to my stored procedure query. views.py from django.db import connection from django.shortcuts import render from .forms

Solution 1:

Try something like that:

defitemnumber(request): 
    if request.method == 'POST': 
        form = InputForm(request.POST):
            if form.is_valid():
                # rest of your code. Now you should access form data, using form.PARAMETER_NAME

More info on topic you can find here

Also, you should define your form's action. You can do it like that:

<form action = "{% url 'app_name:item' %}" method = "post">

For more info on built-in tags refer to this page

Post a Comment for "How To Do Mapping User Input Html Page To View.py In Django?"