I need to clear my cache each time when I restart my server..
Is there any other way to automatically clear the cache for my project only, so that the template reflects my new changes?
I'm assuming you're talking about the server side django cache, since the browser cache should only be kept if you're sending the correct client side http headers.
Flushing the cache should really only need to be done in development - so you can see the changes reflected as you work. So, for production, just let the cache expire naturally.
In development or test, set your cache backend to the in memory cache. To do so, set your cache settings in your development settings file:
CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'LOCATION': 'unique-snowflake' } } Now, when you restart your development server, the cache will be destroyed.