[Fixed]-Django: Add Link in View

1πŸ‘

βœ…

I think that what you’re trying to do is best done in the client, and not constructed in the srever.
You should return the url in the json response, and then parse that response in your HTML code.

response = {
    'type': 'error',
    'url': <url>
}

That way you can wrap the url in an <a></a> tag for example in your HTML, or do a million other things to show the user that he has to register.

If you still want to have the html tags in your response, you could use Django filters, which allow you to add HTML to your responses

πŸ‘€thomas

Leave a comment