This may be the most basic question to ask and believe me it does not come without much research and frustration, but I just can't seem to make it work. So I do apologize ahead of time for even having to post it. I am very new to django (2-months), python(4-months) and in fact programming in general. I have reviewed the online doc sevral times now and various books and tutorials trying to find the answer.
However, I can't seem to get my template variables to render within the web page (crazy I know).
I've tried this many different ways and finally backed-up and stripped-down the code to see what it is I'm missing
Here is what I have right now in the veiw:
def response_page(request):
myv = " fun fun fun "
context = {'affirmation': myv}
return render('/response_page/', context )
Here is the template:
<!DOCTYPE html>
{% extends "base.html" %}
{% load static %}
{% load crispy_forms_tags %}
<html lang="en">
<head>
<meta charset="UTF-8">
<title>challenge_engine_response</title>
</head>
<body>
{% block content %}
<h1>Testing 1,2,3</h1>
<p> I am having so much {{ affirmation }} </p>
<a href="/home/">Back to Home Page</a>
</body>
{% endblock %}
</html>
Everything shows up as expected except the variable "affirmation" which of course should render as "fun fun fun".
I am sure I am missing something silly, but what?
Thanks in advance for the help. I have very little hair left at this point (ha).
Thank you all!
Humbly yours,
CTA2052