PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, May 18, 2022

[FIXED] How to render partial with django?

 May 18, 2022     django, partial, python     No comments   

Issue

I am working on a web project with Django and I have a list of objects displayed on the main column of my page. I want to make filters (like price filter, city...) of this objects on left. I would like to separate this two parts of code, with a special views method to render the left colum (filters) and an other one to render the central part.

How can I do that?


Solution

You can use the {% include %} template tag.

Alternatively, you can create a custom template tag if the "partial" are used in multiple views and you don't want to explicitly insert extra context variables.



Answered By - Lie Ryan
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing