Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

else if in django template

Your {% elif %} in {% if my video...%} doesn't have any condition.

I think you should have {% else %} instead?

{% if my_video %}//if that url is an link to video
    <img src="{{ my_video.thumbnail }}" class="img-rounded" alt="" height="75" width="75"/>
{% else %} //if that url isn't a video
    <img src="{{post.image}}"  class="img-rounded" alt=" EBAGU" height="75" width="75"/>
{% endif %}
Comment

PREVIOUS NEXT
Code Example
Python :: python sort dictionary by key 
Python :: pickle.dump python 
Python :: axios django 
Python :: creating data frame in python with for loop 
Python :: isdigit in python 
Python :: python replace character in string 
Python :: convert list into integer in python 
Python :: threading.Timer python recurrent 
Python :: python split string every character 
Python :: django date formatting 
Python :: access google transalte pandas 
Python :: how to sort a dictionary py 
Python :: tensorflow_version 
Python :: remove punctuation python 
Python :: how to pass data between views django 
Python :: creating base models django 
Python :: split a variable into multiple variables in python 
Python :: python summary() 
Python :: python dict append 
Python :: yahoo finance api python 
Python :: Sorting Dataframes by Column Python Pandas 
Python :: pandas replace values based on condition 
Python :: python timer decorator 
Python :: pygame how to find the full screen mode 
Python :: numpy array length 
Python :: pythonwrite to file 
Python :: extract tgz files in python 
Python :: jpython 
Python :: how to change python version 
Python :: colab version python 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =