2 | {% load pictures %}
3 |
4 |
5 |
6 | Testapp
7 |
8 |
9 |
43 |
44 |
45 |
46 | {% block content %}{% endblock %}
47 |
48 |
49 |
--------------------------------------------------------------------------------
/tests/testapp/templates/testapp/profile_detail.html:
--------------------------------------------------------------------------------
1 | {% extends "testapp/base.html" %}
2 | {% load pictures %}
3 |
4 | {% block content %}
5 | {{ profile.name }}
6 | {{ profile.description }}
7 | {% if profile.picture %}
8 | {% picture profile.picture profile.name m=6 l=4 %}
9 | {% endif %}
10 | {% endblock %}
11 |
--------------------------------------------------------------------------------
/tests/testapp/urls.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from django.urls import include, path
3 |
4 | from . import views
5 |
6 | urlpatterns = [
7 | path("profile//", views.ProfileDetailView.as_view(), name="profile_detail"),
8 | path("_pictures/", include("pictures.urls")),
9 | path("admin/", admin.site.urls),
10 | ]
11 |
--------------------------------------------------------------------------------
/tests/testapp/views.py:
--------------------------------------------------------------------------------
1 | from django.views import generic
2 |
3 | from . import models
4 |
5 |
6 | class ProfileDetailView(generic.DetailView):
7 | model = models.Profile
8 |
--------------------------------------------------------------------------------