pure css javascript not working after deployment Django

1.3k views Asked by At

I am using pure css and bootstrap in one of my Django project, and everything is fine when I run in my local machine. But after I deployed, it looks different. Snapshot of the font from my local machine is

enter image description here

but the font-width increased after i deployed it in digital ocean. Snapshot of how it looks right now after deployment is

enter image description here

It is live at http://getfbstuff.com . I am posting the html code of head

{% load staticfiles %}
<head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">

      <title>Get Facebook Stuff</title>

      <link rel="stylesheet" href="{% static 'downloader/pure-market.css' %}">
      <link rel="stylesheet" href="{% static 'downloader/baby-blue.css' %}">
      <link rel="stylesheet" type="text/css" href="{% static 'downloader/bootstrap/css/bootstrap.css' %}"/>
      <link rel="stylesheet" type="text/css" href="{% static 'downloader/bootstrap/css/bootstrap.min.css' %}"/>
      <link rel="stylesheet" type="text/css" href="{% static 'downloader/bootstrap/css/bootstrap-responsive.css' %}"/>
      <link rel="stylesheet" href="{% static 'downloader/style.css' %}">

      <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/pure-min.css">
      <script src="http://use.typekit.net/ajf8ggy.js"></script>
      <script>
          try { Typekit.load(); } catch (e) {}
      </script>

</head> 

i think problem is with this javascript

 <script src="http://use.typekit.net/ajf8ggy.js"></script>
 <script>
     try { Typekit.load(); } catch (e) {}
 </script>

Don't know what to do.Any help would be appreciated. Thanks in advance

2

There are 2 answers

3
Hedde van der Heide On

If you have Chrome, Firefox or IE (with web developer tools) installed see the console debugger, there's a few dependencies not loading at their expected paths.

Have you setup your production server to serve static content? You also seem to have a cross domain issue.

0
Daniel On

For anyone still having trouble with such problem, I fixed mine after realizing that files are served differently in a production environment. It suddenly dawned on me to try running "python manage.py collectstatic" again, and that solved the problem for me.

Apparently the changes in my CSS file didn't take effect, because the changed file was located in the static folder and just weren't delivered directly.