Django URL Redirect

I’m new to Django and webdev. I got stuck trying to redirect a registered user to my views.index, but I keep getting ‘page not found’. I found out the URL is redirecting to register/ while I want it to return redirect to ‘index’ I’ll be grateful if I get some help. Thanks

Welcome @Nathy96 !

We’re going to need to see some details here. We need to see the view that is creating these links or otherwise trying to redirect you, along with the template being rendered with those links.

It may also be helpful if you post your urls.py file.

Finally, when you say “new”, can you be a little more specific? What have you done up to this point? (Is this your first real project? What resources did you use to learn Django?)

Note: When posting code, templates, or error messages here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted.

Can paste screenshots please?

Can upload screenshot please?

No, please don’t paste screenshots. Copy/paste the appropriate code into the body of your post, surrounded between lines of ``` as described above.

1 Like