title: profile update from admin site only
body: <p>I'm working on a personal portfolio project. I want to add/update the profile dynamically. What I want is to have one profile image and one personal image(about_pic). I want to update them from the admin section/site. I only want to add one profile object.</p>
  
  <p><code>model.py</code></p>
  
  <pre><code>from sorl.thumbnail import ImageField
  
  class Profile(models.Model):
      profile_pic = ImageField(upload_to='profile', blank=True, null=True)
      background_pic = ImageField(upload_to='profile', blank=True, null=True) # you can leave it for now
      about_pic = ImageField(upload_to='profile', blank=True, null=True) 
  </code></pre>
  
  <p><code>views.py</code></p>
  
  <pre><code>def home_view(request, tag_slug=None):
      profile = Profile.objects.all() 
      return render(request, 'mypf/index.html', { 'profile':profile })
  
  </code></pre>
  
  <p><code>index.htm</code></p>
  
  <pre><code># profile pic
  {% for p in profile %}
    &lt;img src="{% if p.profile_pic %} {{ p.profile_pic.url }} 
    {% else %} {% static 'img/natsu.jpg' %}
    {% endif %}" class="img-fluid rounded-circle"&gt;
  {% endfor %}
  
  # about pic
  {% for p in profile %}
    &lt;img src="{% if p.about_pic %}
      {{ p.about_pic.url }} {% else %} {% static 'img/img2.jpg' %}
      {% endif %}" width="150px" height="200px" class="img-thumbnail"&gt;              
  {% endfor %}
  </code></pre>
  
  <p>Also, How can I do efficiently without using two loops since there is another HTML code like div, main, section. Is there another way?</p>
  
  <p><a href="https://i.stack.imgur.com/yBQlU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yBQlU.jpg" alt="image looks like this"></a></p>