Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9116433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:40:18+00:00 2026-06-17T04:40:18+00:00

Currently, I have been having issues with getting my static and media to work

  • 0

Currently, I have been having issues with getting my static and media to work with django on heroku. My static is finally working, but my media won’t, and this is my first in any sort of production environment, so I’m not sure if it is done correctly. My media files will work after an upload, however they no longer work once I edit something unrelated and try to push it to heroku typing:

git add .
git commit -m "changes"
git push heroku master

So after I update my heroku app, a user would have to re-add their media files in order for them to work every time I do an update. As far as the code I have so far:

#settings.py
DEBUG = False
MEDIA_ROOT = 'media'
MEDIA_URL = '/media/'
STATIC_ROOT = 'static'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
    'static',
)

#urls.py
urlpatterns += staticfiles_urlpatterns()

if not settings.DEBUG:
    urlpatterns += patterns('',
        (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
        (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    )

I’m pretty lost on what to do, and I have tried several different changes to my urls and settings without any luck. I have read other posts and tried them, I’ve read the docs, and I still don’t really understand unfortunately. Everything was working fine in development, but I had different code for my project in development under my settings. Any help would be greatly appreciated.

EDIT

So after more digging, I decided to give Amazon S3 a try for handling my media files. I’m still not really sure how uploading files to S3 works, but I already created a S3 bucket and set my heroku settings (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, S3_BUCKET_NAME). I am still unsure of what my media and static settings should look like. If anyone can point me in the right direction, I would really appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:40:19+00:00Added an answer on June 17, 2026 at 4:40 am

    Ok so I finally got things working the way they should after a lot of banging my head against the wall. I am now using Amazon S3 for my static and media files (partially thanks to this post, and the most helpful post for me in getting things set up correctly was here. If you are using heroku, you probably want to look into using S3 for static and media files. Yes, it is something else you have to try to configure and integrate, and no it is not free, but if you just push back you may find yourself using it in the end anyway, so save yourself some time. This was also helpful for separating static and media into separate dierctories.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been having some issues getting my method hooks to work. I can get
I have been having a heck of a time getting Udp sockets working correctly
I have been working on keeping things object oriented for my project. Currently, I'm
I am currently working with Python and have been confused over the fact that
The title may have been confusing, but please let me explain: Currently when I
I'm currently using the hilo id generator for my classes but have just been
Currently working on a 3D media engine using C# and I have come across
I have been investigating building web parts for sharepoint 2010 and currently have a
I have been using the storyboard to make an application and currently there are
Currently, I have been reading lists of data from a binary data file programmatically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.