diff --git a/contrib/frontends/django/nntpchan/.gitignore b/contrib/frontends/django/nntpchan/.gitignore index 1e8916b..a762814 100644 --- a/contrib/frontends/django/nntpchan/.gitignore +++ b/contrib/frontends/django/nntpchan/.gitignore @@ -1,3 +1,4 @@ *.sqlite3 *.pyc -__pycache__ \ No newline at end of file +__pycache__ +media \ No newline at end of file diff --git a/contrib/frontends/django/nntpchan/assets/placeholder.jpg b/contrib/frontends/django/nntpchan/assets/placeholder.jpg new file mode 100644 index 0000000..c355ce8 Binary files /dev/null and b/contrib/frontends/django/nntpchan/assets/placeholder.jpg differ diff --git a/contrib/frontends/django/nntpchan/media/.keep b/contrib/frontends/django/nntpchan/media/.keep new file mode 100644 index 0000000..e69de29 diff --git a/contrib/frontends/django/nntpchan/nntpchan/settings.py b/contrib/frontends/django/nntpchan/nntpchan/settings.py index d7be1f2..5678e48 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/settings.py +++ b/contrib/frontends/django/nntpchan/nntpchan/settings.py @@ -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/' diff --git a/contrib/frontends/django/nntpchan/nntpchan/views.py b/contrib/frontends/django/nntpchan/nntpchan/views.py index 10c87ce..b897de7 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/views.py +++ b/contrib/frontends/django/nntpchan/nntpchan/views.py @@ -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)