views.py 462 B

1234567891011121314
  1. #coding=utf-8
  2. from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
  3. def index(request):
  4. return HttpResponseRedirect('/dist/index.html')
  5. def admin_index(request):
  6. user_id = request.META.get('HTTP_USER_ID')
  7. token = request.META.get('HTTP_ACCESS_TOKEN')
  8. if not user_id or not token:
  9. return HttpResponseRedirect('/views/account/login.html')
  10. else:
  11. return HttpResponsePermanentRedirect("/views/index.html")