You would use the data from request.POST or request.GET.
Here’s everything you need to know about views:
https://docs.djangoproject.com/en/2.2/topics/http/views/
Here’s an example:
def my_view(request):
if request.POST:
field1 = request.POST.get(‘field1’)
field2 = request.POST.get(‘field2’)
model = MyModel.objects.create(field1=field1, field2=field2)
return redirect(model.get_absolute_url())
return whatever
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
django-users...@googlegroups.com.
To post to this group, send email to
django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/41384b09-ed76-4485-9518-8dc10e26f2fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.