What's the proper way to add {{gamestoday|lookup:i}} into the <a href={%url 'stats'%}>. Do I need to make changes to urls.py?
{% load tags %}
<center>
<div class = "scoreboardbackground">
<div class="row">
{% for i in ngames %}
<div class="col">
<a href={%url 'stats'%}>
<div class="livegamebox">
{{teamnames|lookup:i|lookup:0}} vs {{teamnames|lookup:i|lookup:1}} - {{gamestoday|lookup:i}}
<br>
<div style="font-size:12px;">
{{datetimegames|lookup:i}}
</div>
<br>
<div style = "font-size:30px">
<b>{{latestscore|lookup:i}}</b>
</div>
</div>
</a>
You can just pass variables as parameters:
Having:
from django.urls import path
from . import views
urlpatterns = [
path('user/<str:username>/', views.user_profile, name='user_profile')
]
You can:
<a href={% url 'user_profile' username=username %}>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With