more
This commit is contained in:
parent
8ffc8c006c
commit
e686f0d57e
1
contrib/frontends/django/nntpchan/.gitignore
vendored
1
contrib/frontends/django/nntpchan/.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
*.sqlite3
|
*.sqlite3
|
||||||
*.pyc
|
*.pyc
|
||||||
__pycache__
|
__pycache__
|
||||||
|
media
|
BIN
contrib/frontends/django/nntpchan/assets/placeholder.jpg
Normal file
BIN
contrib/frontends/django/nntpchan/assets/placeholder.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
0
contrib/frontends/django/nntpchan/media/.keep
Normal file
0
contrib/frontends/django/nntpchan/media/.keep
Normal file
@ -123,5 +123,7 @@ USE_TZ = True
|
|||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
|
ASSETS_ROOT = os.path.join(BASE_DIR, 'assets')
|
||||||
|
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
|
@ -82,7 +82,7 @@ def webhook(request):
|
|||||||
with open(fname, 'wb') as f:
|
with open(fname, 'wb') as f:
|
||||||
f.write(payload)
|
f.write(payload)
|
||||||
tname = os.path.join(settings.MEDIA_ROOT, 'thumb-{}.jpg'.format(fn))
|
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):
|
if not os.path.exists(tname):
|
||||||
thumbnail.generate(fname, tname, placeholder)
|
thumbnail.generate(fname, tname, placeholder)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user