login and signup form in one view

46 views
Skip to first unread message

uma shankar

unread,
Mar 5, 2021, 9:17:12 AM3/5/21
to Django users
i have two forms in one html file and i want to write both of them in single view with and without submit buttons

Kasper Laudrup

unread,
Mar 5, 2021, 10:33:02 AM3/5/21
to django...@googlegroups.com
On 05/03/2021 13.59, uma shankar wrote:
> i have two forms in one html file and i want to write both of them in
> single view with and without submit buttons
>

OK. Sounds simple enough. Good luck.

Kind regards,

Kasper Laudrup

Eugene TUYIZERE

unread,
Mar 5, 2021, 10:40:44 AM3/5/21
to django...@googlegroups.com
Then, what is the problem

Sent from my iPhone
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c1bbb435-a757-6491-459c-b84d9cc50b73%40stacktrace.dk.

Kasper Laudrup

unread,
Mar 5, 2021, 11:04:02 AM3/5/21
to django...@googlegroups.com
On 05/03/2021 16.39, Eugene TUYIZERE wrote:
> Then, what is the problem
>

I have no idea. Doesn't seem like there is any.

I guess Uma just wanted to share what he's currently working with for
some reason. Would be nice if he shared it if he's come up with some
clever solution though.

Kind regards,

Kasper Laudrup

uma shankar

unread,
Mar 5, 2021, 11:51:54 AM3/5/21
to Django users
I want to connect my Html input  tags with fields created in models .py using the name attribute of each input tag

def user_login(request): 
    if request.method=='POST':
        if request.POST.get('submit') == 'checkform1':
            user_form = SignupForm(data = request.POST) # i want this to connect with html input tags using the name attribute but they are overlapping each other

            return render(request,'first_app/Login.html')

uma shankar

unread,
Mar 5, 2021, 11:52:57 AM3/5/21
to Django users
please tell me how to do that 

Ryan Nowakowski

unread,
Mar 7, 2021, 3:04:58 PM3/7/21
to Django users

On Fri, Mar 05, 2021 at 08:51:54AM -0800, uma shankar wrote:
> I want to connect my Html input tags with fields created in models .py
> using the name attribute of each input tag
>
> def user_login(request):
> if request.method=='POST':
> if request.POST.get('submit') == 'checkform1':
> user_form = SignupForm(data = request.POST) # i want this to
> connect with html input tags using the name attribute but they are
> overlapping each other
>
> return render(request,'first_app/Login.html')

I think you might be looking for Form.prefix:

https://docs.djangoproject.com/en/3.1/ref/forms/api/#prefixes-for-forms

> On Friday, 5 March 2021 at 21:34:02 UTC+5:30 Kasper Laudrup wrote:
>
> > On 05/03/2021 16.39, Eugene TUYIZERE wrote:
> > > Then, what is the problem
> > >
> >
> > I have no idea. Doesn't seem like there is any.
> >
> > I guess Uma just wanted to share what he's currently working with for
> > some reason. Would be nice if he shared it if he's come up with some
> > clever solution though.
> >
> > Kind regards,
> >
> > Kasper Laudrup
> >
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ed93ac8e-198a-4366-989b-4fb94e23c312n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages