Can't get Web font loader in django

275 views
Skip to first unread message

Chris Pagnutti

unread,
Nov 20, 2012, 6:05:59 PM11/20/12
to django...@googlegroups.com
Hi.  I'm trying to get the Google Web Font loader via
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
in my <head> section.
But when I load the page I get (in Chromium's console) this message:
HOWEVER, if I call the webfonts.js script in a pure HTML/Javascript page (not running behind the django development server) it works fine.

I can request other googleapis resources without problems, e.g.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
works fine.

Any ideas about what's going wrong?

Issam Outassourt

unread,
Nov 20, 2012, 6:57:27 PM11/20/12
to django...@googlegroups.com
{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "dailyLimitExceededUnreg",
    "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
    "extendedHelp": "https://code.google.com/apis/console"
   }
  ],
  "code": 403,
  "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
 }
}


When I follow the link you passed through, I (give it a try) found this more detailed response.
What you actually need to do is within your view that renders the page requirements log in to your google
account, retrieve the file, and pass it to your template so it incorporates your response within the html
web page.

In your head section template all you need to do is something of this kind :

{% for jsscript in jsscript_list %}
<script type="text/javascript">
{{ jsscript }}
</script>
{% endfor %}

assuming that jsscript is the text jsscript that you want to add to your web page.
You can use pycurl's python module to request the .js file that's needed.

Hope this helped,

Issam


2012/11/21 Chris Pagnutti <chris.p...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/U-KJVz1N_McJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages