1

I have a Django backend and an Angular frontend. I am using a package called django-invitations. When a user receives an invitation in an email they click on it and are taken to the app. django-invitations requires this line in settings.py

INVITATIONS_SIGNUP_REDIRECT = 'register'

This is the name of a route and reverse match is used to determine where to go. The problem is I want the user to be taken to my sign-up page which is

http://example.com/#/registration

This is an Angular route. My urls.py contains this line

url(r'^register', TemplateView.as_view(template_name='index.html'), name='register'),

This however takes the user to my index page and the url becomes

http://example.com/registration#/

How do I route a request from my Django backend to an Angular route with hash notation?

1 Answer 1

1

Got it!

Changed the line in urls.py to

url(r'^register/', views.redirect_to_register, name='register'),

Added a views.py

from django.shortcuts import render
from django.shortcuts import redirect

def redirect_to_register(request):
    return redirect('/#/register')

And it works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.