Images in django in production?

  • 0
    Everything stopped when I installed it.
    Debug = False

    Static works fine after collectstatic

    In a browser.
    & lt; img src = "/ media / media / 1.jpg" & gt;
    Settings.py
    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
    Django James Powell, Mar 26, 2019

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

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

  • 0
    STATIC_ROOT and MEDIA_ROOT write 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
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!