[Answer]-Django and Heroku – How do I get an absolute path to my static files in production?

1👍

You can use the request.build_absolute_uri() built-in method. Pass it the relative URL (/static/) and it will return the absolute one.

UPDATE

To open/read the file in your view:

cool = open(os.path.join(settings.STATIC_ROOT, 'cool_styles.css', 'rb').read()

Leave a comment