Skip to content
Advertisement

how to create django template tag for custom model

I’m new for django template tag. I am trying to display logged user payment_status and remaining_days on django html template. For this I wrote model and I don’t know how to write template tag for this. Request your help on this.

JavaScript

I want to display payment_status above in model and remaining_days = expired_date-subscripted_date

Advertisement

Answer

You should take a look at the Django documentation

But ideally, you should have the variables sent from your Django view and then in the templates, have the variables in double quotes {{ }}

In your case, you will have

JavaScript

But I encourage you to check out the documentation

Advertisement