Skip to content

Instantly share code, notes, and snippets.

View chenchiyuan's full-sized avatar

chenchiyuan chenchiyuan

  • QingCheng
  • Beijing
View GitHub Profile
# 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=_(''))