sh_branch
liangliangyy 4 years ago
parent 88e1fd2d82
commit b8fa19bf7b

@ -55,7 +55,4 @@ urlpatterns = [
r'upload',
views.fileupload,
name='upload'),
path(
r'refresh',
views.refresh_memcache,
name='refresh')]
]

@ -6,7 +6,6 @@ import uuid
from django import forms
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404
from django.shortcuts import render
@ -313,22 +312,6 @@ def fileupload(request):
return HttpResponse("only for post")
@login_required
def refresh_memcache(request):
try:
if request.user.is_superuser:
from djangoblog.utils import cache
if cache and cache is not None:
cache.clear()
return HttpResponse("ok")
else:
return HttpResponseForbidden()
except Exception as e:
logger.error(e)
return HttpResponse("error")
def page_not_found_view(
request,
exception,

@ -126,7 +126,6 @@
<li><a href="{% url "account:login" %}" rel="nofollow">登录</a></li>
{% endif %}
{% if user.is_superuser %}
<li><a href="{% url "blog:refresh" %}" target="_blank">刷新缓存</a></li>
<li><a href="{% url 'owntracks:show_dates' %}" target="_blank">运动轨迹记录</a></li>
{% endif %}
<li><a href="http://gitbook.lylinux.net" target="_blank" rel="nofollow">GitBook</a></li>

Loading…
Cancel
Save