title: Django - render to string fails to load CSS
body: <p>I am trying to use Django(1.8) render_to_string to convert html to pdf with management command instead of using View/request. The following code is able to convert the template to pdf. But it fails to load CSS into the template.</p>
  
  <pre><code>def html_to_pdf():
      ...
      context = {'some_key': 'some_value'}
      html = render_to_string('my_app/sample.html', context)
      file.write(html)
      ...
  </code></pre>
  
  <p>sample.html</p>
  
  <pre><code>{% load static %}
  &lt;link href="{% static 'my_app/css/sample.css' %}" rel="stylesheet" type="text/css"/&gt;
  </code></pre>
  
  <p>Also I have static defined in the setting file:</p>
  
  <pre><code>STATIC_URL = '/static/'
  </code></pre>
  
  <p>In my Django project, there is another View function which is able to load the template with CSS when the url get called. So I believe the issue has something to do with render_to_string.</p>
  
  <p>Anyone can help it out?</p>