browser shows page that I dont have

November 7, 2019 612 views
Django

I am just flummoxed.
I started the web having just 1 single view in my views.py page, with one line to see if everything was working, namely:

from django.http import HttpResponse

def home(request):
return HttpResponse(‘Hello, World!’)

so a few days after I return, I delete that code and paste a different one

def home(request):

return render(request, 'home.html’, name='home’)

and now that home.html page is located in a directory called templates, and has just an html table and yes, I have modified settings.py to indicate where that templates directory is

DIRS’: [
os.path.join(BASE_DIR, 'templates’)
],

Well, when I go the webpage,I am still seeing the hello world, and is a code that does not exist anymore.

Of course, nothing to do with cookies or browser cache, because apart from having deleted all browsing data, I tried different computers, different browsers, I even shot up Tor that I had never used before.

I am still seeing the hello world. This is incredible.

2 comments
2 Answers

Hello,

It sounds like that you might be editing the files in another document root. Can you share your Nginx config file here and also confirm the path to the views.py file that you are editing?

Also do you have multiple server blocks in your Nginx? If so you could share them here so that I could try to advise you further.

Regards,
Bobby

Hello

Thank you.

What it turned out to be is that gunicorn stays with the latest look of the website until you restart it. So no matter what I did, everything stayed like when I last left it on the 4th of November. When I restarted it, then I could see changes.

But I imagine this is not the way it is supposed to be. As far as I know, systemd should take care of enforcing the changes at runtime.

If I work on my laptop, push my changes to github, what follows?

a) are the server and github so connected that the changes are pulled from the server?

b) do I have to manually pull them from the server?

Have another answer? Share your knowledge.