Skip to content

Instantly share code, notes, and snippets.

View chenchiyuan's full-sized avatar

chenchiyuan chenchiyuan

  • QingCheng
  • Beijing
View GitHub Profile
class AlipaySDK(object):
def __init__(self, app_id, debug=False, version="2.0"):
self.app_id = app_id
self.debug = debug
self.gateway = "https://openapi.alipay.com/gateway.do"
self.version = version
self.sign_type = "RSA"
self.charset = "utf-8"
self.oauth_url = "https://openauth.alipay.com/oauth2/appToAppAuth.htm"
<!doctype html>
{% verbatim %}
<html lang="zh-cn">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<link href="http://cdn.staticfile.org/twitter-bootstrap/3.0.0-rc2/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="/static/js/angular-1.2.3/angular.min.js"></script>
<script type="text/javascript" src="/static/js/angular-1.2.3/angular-route.min.js"></script>
<script>
<!doctype html>
<html ng-app lang="zh-cn">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<link href="http://cdn.staticfile.org/twitter-bootstrap/3.0.0-rc2/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>
<script >
function SearchController($scope) {
$scope.hotels = [
0xFFD8FFE000104A46494600010100000100010000FFE100304578696600004D4D002A000000080001013100020000000E0000001A000000007777772E6D656974752E636F6D00FFDB0043000302020302020303030304030304050805050404050A070706080C0A0C0C0B0A0B0B0D0E12100D0E110E0B0B1016101113141515150C0F171816141812141514FFDB00430103040405040509050509140D0B0D1414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414FFC0001108009600AA03011100021101031101FFC4001F0000010501010101010100000000000000000102030405060708090A0BFFC400B5100002010303020403050504040000017D01020300041105122131410613516107227114328191A1082342B1C11552D1F02433627282090A161718191A25262728292A3435363738393A434445464748494A535455565758595A636465666768696A737475767778797A838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4001F0100030101010101010101010000000000000102030405060708090A0BFFC400B511000201020404030407050404000102770001020311040521310612415107
# regist by chenchiyuan, chenchiyuan03@gmail.com, Upyun python sdk, storage for django.
# UpYun storage for django, written by Tyr Chen @ tukeq.com
# to run this gist you need to get upyun python sdk first.
# Waring: need to force name str, so in UpYunStorage _save, name = to_str(name).
# Implement django file storage.
class Photo(models.Model):
name = models.CharField(_('图片名'), max_length=64, help_text=_(''), unique=True)
filename = UpYunFileField(verbose_name = _('文件名'), help_text=_(''))