Django pass variable into template

后端 未结 4 1838
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-20 15:01

Hi thank you for helping, I\'m poor in coding.

To point: I\'m doing a Django project that pass data form data-base to front-end; but right now i can\'t even pass an

4条回答
  •  隐瞒了意图╮
    2020-12-20 15:52

    I found out why Django can't pass variables to HTML because;

    I didn't have my apps url activated the function/model in views

    I feel so embarrasses, for such simple mistakes.

    All I need to do is add this code in my apps url

    urlpatterns = [
    path('', views.timedex, name='timedex'), #need add this 
    path('', views.index, name='index'),
    ]
    

提交回复
热议问题