Can't get sorl.thumbnail to work
This is my first time using this app and I can't seem to get it
working within the template. No errors. It's just that nothing shows
up (which is obviously an error).
Here's the snippet from the template:
{% extends 'base.html' %}
{% load thumbnail %}
{% block page_title %}User Profile{% endblock %}
{% block headline %}User profile for {{profile.user.username}}{%
endblock %}
{% block content %}
{% if profile.user.profile_pic %}
{% thumbnail item.image "50x50" crop="center" as im %}
<img src="{{ profile.profile_pic.url }}"
width="{{ im.width }}" height="{{ im.height }}">
{% endthumbnail %}
{% endif %}
Something to note. In my models file, the "from sorl.thumbnail import
ImageField" is shaded out using PyCharm, so I'm curious as to whether
that's affecting it (although the docs say that sorl.thumbnail's
ImageField is not required). Also, using django-profiles and django-
registration, but everything with those is working smoothly.
Any help greatly appreciated as this is a stickler.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home