klen / django_markdown

Django markdown support and wysiwig
GNU Lesser General Public License v3.0
391 stars 143 forks source link

Incorrect url's generated for static content #67

Closed jeroenjacobs79 closed 7 years ago

jeroenjacobs79 commented 8 years ago

Hi,

I'm using S3 + CloudFront for static content, and the django_markdown static url's have incorrect url's in Django Admin (I'm using Grapelli interface). I use the s3-storage-redux provider for S3 access.

This is the output in admin html:

<link href="content.headincloud.be/django_markdown/skins/simple/style.css" type="text/css" media="screen" rel="stylesheet" />
<link href="content.headincloud.be/django_markdown/sets/markdownextra/style.css" type="text/css" media="screen" rel="stylesheet" />
<script type="text/javascript" src="https://content.headincloud.be/static/admin/js/core.78280057239a.js"></script>
<script type="text/javascript" src="https://content.headincloud.be/static/admin/js/admin/RelatedObjectLookups.724e5c83a428.js"></script>
<script type="text/javascript" src="https://content.headincloud.be/static/admin/js/jquery.min.c1a27df1b997.js"></script>
<script type="text/javascript" src="https://content.headincloud.be/static/admin/js/jquery.init.c1a27df1b997.js"></script>
<script type="text/javascript" src="https://content.headincloud.be/static/admin/js/actions.min.7f64b3c51d67.js"></script>
<script type="text/javascript" src="content.headincloud.be/django_markdown/jquery.init.js"></script>
<script type="text/javascript" src="content.headincloud.be/django_markdown/jquery.markitup.js"></script>
<script type="text/javascript" src="content.headincloud.be/django_markdown/sets/markdownextra/set.js"></script>

Notice the absence of "https://".

I suspect you are using the STATIC_URL in settings directly somewhere, while you probably need to use the staticfiles template tags. Depending on STATIC_URL will probably make it incompatible with other storage providers for Django (like S3Storage, or even the built-in manifest storage provider).