Routing from Django to Angular route


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


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

This is an Angular route.
My 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

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


Got it!

Changed the line in to

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

Added a

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

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

And it works.

Answered By – Fauzan Raza

Answer Checked By – Katrina (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.