Z
Z
zelsky2015-05-25 06:48:43
Django
zelsky, 2015-05-25 06:48:43

Images in django in production?

Everything stopped when I set
Debug = False The
static works fine after collectstatic
in the browser. Settings.py
<img src="/media/media/1.jpg">

STATIC_URL = '/static/'


MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, '..', 'media')

CKEDITOR_UPLOAD_PATH = "media/"
CKEDITOR_IMAGE_BACKEND = "pillow"

pandaphpgun.pythonanywhere.com/rozdil/1

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zelsky, 2015-05-25
@zelsky

url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),

A
Andrey K, 2015-05-25
@mututunus

Django probably has nothing to do with it. See the server config that you have on top of Django.

A
Alexey Sergeev, 2015-05-25
@SergeevAI

Write STATIC_ROOT and MEDIA_ROOT in the settings with the full path, i.e. /home/pandaphpgun/tgv/static.
And the path to / media is not registered in the web server configuration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question