no update in the view

Hi,
My question is basic but I miss something

Why do I have to restart the server for the view to refresh?

thanks

model.py : in photo i upload a svg file

from django.contrib import admin
from django.db import models

# Create your models here.
class ObjetNumerique(models.Model):
    name = models.CharField(max_length=255)
    photo = models.FileField(upload_to="")
    coordonneeX = models.FloatField()
    coordonneeY = models.FloatField()


class ObjetAdmin(admin.ModelAdmin):
    list_display = ('name','photo','coordonneeX','coordonneeY',)
    list_filer = ('name',)
    search_fields = ['name','photo']

view.py :

from django.shortcuts import render
from config_centrale.models import ObjetNumerique

a = ObjetNumerique.objects.all()

def index(request):
    return render(request,"config_centrale/index.html", context={ 'a':a})

index.html : I display the SVG

{% for element in a %}
   <img id="{{element.id}}" src="{{ element.photo.url }}" class="objet_trouve" width="150" height="150">
{% endfor %}

Because you’re running your query at the module level and not within the view function.

:exploding_head: I didn’t see that!

Thanks for your help