Last active
August 29, 2015 14:03
-
-
Save xiaotangyuan/8d5ce6fd8b6b6dba4832 to your computer and use it in GitHub Desktop.
django的media_url、static_url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#媒体文件上传(本地)位置 | |
MEDIA_ROOT=os.path.join(BASE_DIR,'moping/static/media/') | |
if ONLINE: | |
MEDIA_URL = 'http://mp360-img.stor.sinaapp.com/' | |
else: | |
MEDIA_URL = '/static/media/' | |
STATIC_ROOT = 'moping/static' | |
STATIC_URL = '/static/' | |
# 在django模板中的读取方式 | |
# {{pj.photo.url}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment