Well, in my case it was cache. But which cache? Client browser cache? Apache cache? memcached? django internal cache? I'm using Django with Apache, wsgi.
Also now I see one website and the client sees other one! Even after opening a private window. So this can't be browser cache. Somehow I'm seeing a different process or thread than the client is.
So I open a different browser and here it is! In Firefox I see contents that don't exist in Chrome! Some wicked sorcery is going on.
Could it be some apache cache thing? Ok, restart apache, check for cache settings, nothing works. Still seeing different contents on the homepage on different browsers.
I then I check django cache settings and I realise it's a file cache setting. Ok, lets clear it:
. env/bin/activate ./manage.py shell
> from django.core.cache import cache
That should do it, right? nope! So it's not cache. What can it be?
So I do one last try and take the cache folder and rename it so that django has to create new cache. I find the cache folder path in the settings file and renamed it.
And it works! So it was cache after all. But why didn't the cache.clear() thing worked? The only theory I have is that I tried to clear cache with a different user than the owner of the cache files. No error was shown, but the cache was not really cleared by shell command.
The best idea should be to put the clear cache command inside settings.py so that when the website is restarted, the cache files owner has proper access. But because writing code inside settings is not the best practice, maybe a management command is better.
As a last resort, if it is a file cache, just erase the cache folder; django will write a new one.