Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
Wagtail Images Not Loading Once Deployed

I'm not quite sure what's going on, but my images loaded fine on my local development server. However, once I deployed, the images will not load. I checked the URL and it seems to be correct. I'm not sure what's going on here.

base.py

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

HTML

{% load wagtailcore_tags wagtailimages_tags %}
...
{% with post.main_image as main_image %}
    {% if main_image %}{% image main_image fill-400x200 %}{% endif %}
{% endwith %}

Page Source for Element

<img alt="photo" src="/media/images/Lily.2e16d0ba.fill-400x200.jpg" width="400" height="201">

I'm pretty confused and I can't really find much about the topic. Am I the only one who's run in to this issue? Any help would be greatly appreciated.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

During development (when you use ./manage.py runserver and have the DEBUG setting set to True), Django serves static files itself as a convenience. In production, it's up to you to configure your web server to serve static files from /media and /static: https://docs.djangoproject.com/en/1.10/howto/static-files/deployment/

This is for performance and security reasons - there's no point having static files served via Python code when there's already a web server properly tuned for that task.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!