Archived
1
0
This commit is contained in:
Jeff Becker 2016-11-05 14:58:28 -04:00
parent 8ffc8c006c
commit e686f0d57e
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
5 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,4 @@
*.sqlite3
*.pyc
__pycache__
media

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -123,5 +123,7 @@ USE_TZ = True
STATIC_URL = '/static/'
ASSETS_ROOT = os.path.join(BASE_DIR, 'assets')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

View File

@ -82,7 +82,7 @@ def webhook(request):
with open(fname, 'wb') as f:
f.write(payload)
tname = os.path.join(settings.MEDIA_ROOT, 'thumb-{}.jpg'.format(fn))
placeholder = os.path.join(settings.MEDIA_ROOT, 'placeholder.jpg')
placeholder = os.path.join(settings.ASSETS_ROOT, 'placeholder.jpg')
if not os.path.exists(tname):
thumbnail.generate(fname, tname, placeholder)