Django Server Does not affect view changes

Viewed 584

I m using Nginx, and Gunicorn on Ubuntu 18.04 to serve my Django project.

I configured everything ( like here ) properly and working so well, but I noticed that changes in my views doesn't affect my server side, although template changes are applied.

This is my scenario :


First Commit :

service.views.py :

def showSudent(req):
  student = Student.objects.get(pk=1)
  return render(req, 'bio.html, { 'student' : student} )

template/bio.html :

<h3>{{ student.firstName }}</h3>

Second Commit :

service.views.py :

def showSudent(req):
  student = Student.objects.get(pk=1)
  return render(req, 'student.html, { 'student' : student} )

template/bio.html :

<h3>{{ student.lastName }}</h3>

I changed views and template both and pull them to server.

So now, django is still renders 'bio.html' ( but it must render 'student.html' ) , by the time interestingly it shows 'student.lastName' now.

It means, django sees my template changes but not views changes.

I repeatedly checked everything is right on server, yes all codes are right at server but not affects any view changes although all my templates changes are affected.

Also I restarted nginx, even rebooted the server several times.

What is the problem with that ????

2 Answers

I think you need to restart Gunicorn and Nginx

sudo systemctl restart gunicorn nginx
Related