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()
Source:stackexchange.com