Regarding to suggestion for registration page

38 views
Skip to first unread message

RONAK JAIN

unread,
Aug 19, 2019, 6:22:40 AM8/19/19
to django...@googlegroups.com, ifog...@gmail.com, dan...@roseman.org.uk, N'BE SORO
Hello Django developers,

I am trying to redirect my registration page on the home page but, I am not getting when I am trying with a registration page it will work for registration but when I am doing with the home page so I am not getting.

Home Page : localhost:8000

Could you help me out with this problem?

Attached screenshots for Better Understanding please check it out.


urls_file.png
1-homepage.html page.png
views.png
views.py file.png
homepage.png

N'BE SORO

unread,
Aug 19, 2019, 8:25:03 AM8/19/19
to RONAK JAIN, django...@googlegroups.com, ifog...@gmail.com, dan...@roseman.org.uk
Ok, I will check. 

Smovie Makers Club

unread,
Aug 19, 2019, 5:10:33 PM8/19/19
to django...@googlegroups.com
return redirect('{{ request.scheme }}://{{ request.get_host }}') 
This will redirect to home page

--
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/CA%2BAqMUeYs7CALaGOmfFfJ%2BHp%3DWoKMyrjvYcOc8Za3JkTLFY_CQ%40mail.gmail.com.

Ronit Mishra

unread,
Aug 20, 2019, 12:13:55 AM8/20/19
to django...@googlegroups.com
Hi,

If I've understood your issue correctly, you probably just need to add this lil' snippet in your settings.py

LOGIN_REDIRECT_URL = '/' (or wherever you wanna redirect after login)

Let me know if it works out for you!

Regards,
Ronnie

Sipum

unread,
Aug 20, 2019, 12:56:39 AM8/20/19
to django...@googlegroups.com
Hey Ronit,

It is very simple. 
Just do return redirect ('/name used in url')

If ur url for home page be like,  path('home', views.index, name='home')

Then u hv to write as redirect('/home'). 


RONAK JAIN

unread,
Aug 21, 2019, 1:22:31 AM8/21/19
to django...@googlegroups.com
I am trying to redirect my registration page but, I am not getting please check my attached screenshot and please let me know where I am doing wrong...



Screenshot 2019-08-21 at 12.48.29 AM.png
Screenshot 2019-08-21 at 12.50.30 AM.png
Screenshot 2019-08-21 at 12.49.26 AM.png
Screenshot 2019-08-21 at 12.50.17 AM.png
Screenshot 2019-08-21 at 12.52.48 AM.png
Screenshot 2019-08-21 at 12.48.51 AM.png

Tosin Ayoola

unread,
Aug 21, 2019, 2:53:55 AM8/21/19
to django...@googlegroups.com
Using httpRedirect to d view 4 the URL u want user to b redirected to 

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BAqMUfr2GkV1bxR9HOWH1Lv5FdknZcbULmAuWXrkCqiZDQS3g%40mail.gmail.com.

RONAK JAIN

unread,
Aug 21, 2019, 3:05:41 AM8/21/19
to django...@googlegroups.com
Hey 
I tried but still getting like that...

Attached screenshots take a look..



Thanks 

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
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.

--
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.

--
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.

--
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.

--
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/CAHLKn72u3TFpjakgZ9GhzEv2DYZtFHLCKCmDwQbGbr%3D0htwfnw%40mail.gmail.com.
Screenshot 2019-08-21 at 12.33.32 PM.png
Screenshot 2019-08-21 at 11.58.39 AM.png

Amitesh Sahay

unread,
Aug 21, 2019, 1:26:21 PM8/21/19
to django...@googlegroups.com
I guess you have forgotten to mention the APP name under which the pages are created. Please cross-verify on my observation .

Regards,
Amitesh Sahay
91-750 797 8619


Gaurav Ravindra Bole

unread,
Aug 22, 2019, 12:33:00 AM8/22/19
to django...@googlegroups.com
in register method
add user.set_password = request.POST.get('password') before user.save()

Sipum

unread,
Aug 22, 2019, 12:51:50 AM8/22/19
to django...@googlegroups.com
Hey Ronak,

At first u did wrong in import. 

Do as below and compare what u have done. 

From django.contrib.auth.models import User
From django.contrib import auth

Then when u are creating user do as-
 user = User.objects.create_user(uanme,pwd,email)

THEN for login after sign up use as below - 
auth.login(request, user) 

RONAK JAIN

unread,
Aug 22, 2019, 1:46:18 AM8/22/19
to django...@googlegroups.com
Thank you so much all of you for your kind of help.


I have done this Task.


Thanks





Sipum

unread,
Aug 22, 2019, 1:53:04 AM8/22/19
to django...@googlegroups.com
Can u plz tell what you have done so we can learn also. 

RONAK JAIN

unread,
Aug 22, 2019, 2:06:59 AM8/22/19
to django...@googlegroups.com
Yeah sure,


I was doing a silly mistake I need to add one more name parameter in HTML form.



Thanks 



Screenshot 2019-08-22 at 11.35.46 AM.png
Reply all
Reply to author
Forward
0 new messages