增加部分基础组件

This commit is contained in:
LiYang
2016-07-31 20:26:11 +08:00
parent 0fc35d4d02
commit bcee7bca67
18 changed files with 999 additions and 95 deletions

View File

@@ -1,12 +1,11 @@
# coding=utf-8
import os
import hashlib
import time
import random
import logging
from django.shortcuts import render
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from rest_framework.response import Response
@@ -125,3 +124,7 @@ def build_query_string(kv_data, ignore_none=True):
query_string = "?"
query_string += (k + "=" + str(v))
return query_string
def redirect_to_login(request):
return HttpResponseRedirect("/login/?__from=" + urllib.quote(request.path))