It seems like you want to use display a default picture if the user does not have one.
Cheers
On Monday, February 29, 2016 at 10:49:53 PM UTC+1, setivo...@gmail.com wrote:
-- {% load static %} {% static "images/default_pic.jpg" as default_pic %} {{ account.accountuserinfo.picture|default:default_pic }}
Cheers
On Monday, February 29, 2016 at 10:49:53 PM UTC+1, setivo...@gmail.com wrote:
I need choice base url MEDIA_URL (/media/) - for uploaded user picture, or STATIC_URL (/static/) - picture by defaultI am try next:p><img src="{% if account.accountuserinfo.picture %}MEDIA{% else %}STATIC{% endif %}_URL{{ account.accountuserinfo. picture_url }}" alt="picture_for_{{ account.name }}" id="account_picture"></p> , but result is MEDIA_URL(STATIC_URL) and path to file.I am next try:but result is {{ MEDIA_URL }} or {{ STATIC_URL }} (not working)may by anyone known how solved this problem--------------------------------------------------- Thanks
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ad20612d-2a90-4108-8737-d4bbe99a262c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment