06 Oct 2022
Cara how to clear cache phyton django
Phyton Django Clear Cache use django admin django-clearcache
Do you have project built with phyton django ?? and you need to clear cache using admin panel ?? no need wory, you can do with use django-clearcache.how to install it ?? and use it ??
for first you need to open terminal and activate you venv. after that you can run this command
pip install django-clearcache
after that you need to insert to your django setting, just visit on djangoprojectname/settings.py - edit use code editor, and paste this code
'clearcache',
A complete code like this
INSTALLED_APPS += [
'clearcache',
'django.contrib.admin',
]
After insert on setting app, now we need to register on root urls, so you can open djangoprojectname/urls.py - open with code editor, then you can paste this code.
path('admin/clearcache/', include('clearcache.urls')),
the complete code example like this
urlpatterns = [
path('admin/clearcache/', include('clearcache.urls')),
path('admin/', admin.site.urls),
]
and now you can run your django project with run
py. manage.py runserver
, visit locahost:8000for using clear cache you can visit on localhost:8000/admin/clearcache
And click clear cache . congratulations you have successfully for using django clear cache .
if you need use terminal for clear cache so you can run this command
py manage.py clearcache
that's it... very easy and simple right...
BONUS CONTENT YOU NEED TO KNOW :
New Point of sale mesin kasir →
All sourcecode project free download →