Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Error while running Django app Tets having JSONField models
I am trying to test my django app using pyhon manage.py test appName Some tables contains JSONField also may be thats why I am getting following error please give me solution. My errorlog is as follows : Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv super(Command, self).run_from_argv(argv) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv self.execute(*args, **cmd_options) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 74, in execute super(Command, self).execute(*args, **options) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute output = self.handle(*args, **options) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 90, in handle failures = test_runner.run_tests(test_labels) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/test/runner.py", line 532, in run_tests old_config = self.setup_databases() File "/home/piyush/.environments/awsd/local/lib/python2.7/site- File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/home/piyush/.environments/awsd/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: cannot cast type character varying[] to jsonb -
Django template: convert modelform dropdown field into textfield
Im trying to allow user to edit data that they have stored in my database. so here are my codes. My model.py: class Farm(models.Model): farmID = models.CharField('farmID',primary_key=True, max_length=20) fieldsize = models.FloatField('Field Size (hactre)') class Plot(models.Model): farm = models.ForeignKey(Farm,verbose_name='FarmID') plotID = models.CharField('PlotID',max_length=50) class PlotManagement(models.Model): farm = models.ForeignKey(Farm,verbose_name='FieldID') plotID = models.ForeignKey(Plot,verbose_name='PlotID') My form.py class PlotManagementForm(forms.ModelForm): class Meta: model=PlotManagement exclude=('enteredpersonel',) def __init__(self, *args, **kwargs): super(PlotManagementForm, self).__init__(*args, **kwargs) self.fields['farm'].widget.attrs['class'] = 'form-control' self.fields['plotID'].widget.attrs['class'] = 'form-control' my template.html: <div class="form-group"> {{ plotmanagementform.farm.errors }} <label for="farm" class="col-md-4 control-label">Farmer:</label> <div class="col-md-4 selectContainer"> {{ plotmanagementform.farm }} </div> </div> <div class="form-group"> {{ plotmanagementform.plotID.errors }} <label for="plotID" class="col-md-4 control-label">Plot ID:</label> <div class="col-md-4 selectContainer"> {{ plotmanagementform.plotID }} </div> </div> What I want to do is when a user want to edit, he/she should be able to see the PlotID in textfield format not dropdown format, because for right now the Plot_ID field is displayed as dropdown not textfield. What I want to do is when a user want to edit, he/she should be able to see the PlotID in textfield format not dropdown format, because for right now the Plot_ID field is displayed as dropdown not textfield. -
django-allauth social prelogin custom view
I am new to django, django-allauth. i want custom social registration using providers Facebook and google.needs to change default behavior such like user provided with login form and link options to login via Google and Facebook. user click choice (Google/Facebook) Authenticate at providers site. If authenticated load my custom view to ask "mobile". here i want to restrict direct login and send otp to mobile. validate otp and then after make user login. I am Using Python 3.6.0 Django 1.10.5 Django-allauth latest Yet I have done installed and configured django-allauth able to login via providers google and facebook. Thanks. -
Changing eb deploy folders
I have a django app running on a eb instance, and I'm having the following problem. I set it up to use folder folderA, so eb deploy was working just fine. I moved folderA to folderB, then i did eb use myenvfrombefore, but when I do eb deploy now it succeed but I'm getting Your WSGIPath refers to a file that does not exist. Checking the app that was deployed showed that the folder .ebextensions is ignored, so that might be why. I tried to move it back to folderA, but it's the same thing now :\ (no .ebextensions folder in the app version upload. -
Appending an item to a Django JsonField - Getting a TypeError
In my models.py, I have the following code: from __future__ import unicode_literals from django.db import models from django.contrib.postgres.fields import JSONField import json class Table(models.Model): name = models.CharField(max_length=255) structure = JSONField(default=json.dumps('{}')) def __unicode__(self): return self.name class Column(models.Model): table = models.ForeignKey(Table, related_name='columns') name = models.CharField(max_length=255) required = models.BooleanField(default=True) def __unicode__(self): return self.name + ' FROM TABLE ' + self.table.name def save(self, *args, **kwargs): if not self.pk: self.table.structure[self.name] = { 'required' : self.required, } As you can see from the code, when a Column is saved, if the column's required field gets added to the structure of the Table. However, when I try saving a column from the admin panel, I get the following error: TypeError at /admin/myapp/column/add/ 'unicode' object does not support item assignment I think the problem is with the default value of my structure field. I also tried the following: structure = JSONField(default={}) structure = JSONField(default='{}') structure = JSONField(default=dict) Each time, I got the same error. Any help? Thanks. -
how to save the fields in the table at different times
I have 100 fields in my table and i want to save some fields at a time and remaining fields at other time based on which basis we can save remaining fields in the same record itself? -
Cachelot results not appearing in django-debug-toolbar (django 1.9.7, SQLite)
I'm not having some difficulty determining if Cachelot is working for me, and the CachelotPanel for debug-toolbar isn't helping, as it's blank. Using Django 1.9.7 and SQLite test db (I'm pretty much new to everything django) I've followed the quickstart guide: INSTALLED_APPS += ('cachalot',) DEBUG_TOOLBAR_PANELS += ['cachalot.panels.CachalotPanel', ] CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': 'unix:/tmp/memcached.sock', } } My debug-toolbar's CACHE panel shows some big long entries: (dict_keys(['33cd0b10f8c2fd53802b0948820b8b58da6bb27c', .... ']),) But the CACHELOT panel is blank: Database 'default' Application Model Last invalidation When cachelot is added, there is no noticeable speed difference on a page that currently takes about 10 seconds to load (334 queries) =P I've also tried adding the django cache middleware, but it makes no difference (other than the django default caching starts kicking in the same as without cachelot) # 'django.middleware.cache.UpdateCacheMiddleware', # 'django.middleware.cache.FetchFromCacheMiddleware', What am I might be doing wrong? -
Django add a field to User model which refers to the same table
I'm trying to add the column 'sponsor' to the django's User model. The thing is I want this column to reference the username field (And it can be left blank). I have the following model # models.py class Sponsor(models.Model): user = models.OneToOneField(User, primary_key=True) sponsor = models.ForeignKey(User, null=True, to_field='username', related_name='spn') I don't know if I'm doing it alright. However, I have done the following in order to add an sponsor through the admin page: #admin.py class SponsorInline(admin.TabularInline): model = Sponsor fk_name = 'sponsor' When I want to add a new User in my admin page, I'm receiving three scroll bars to add a sponsor, and it doesn't seem OK, of course. Is there a way to make a form where input the sponsor's username. How is the best way to achieve all of this? -
Best way to draw a graph in Django
I'm working with finite state machines and I would like to visualize them. I have the following models: class Automata(models.Model): pass class Alphabet(models.Model): alphabet = models.CharField(max_length = 10, null = True, blank = True) automata = models.ForeignKey(Automata, on_delete = models.CASCADE) class States(models.Model): state = models.CharField(max_length = 10, null = True, blank = True) final = models.BooleanField(default = False) initial = models.BooleanField(default = False) automata = models.ForeignKey(Automata, on_delete = models.CASCADE) class Transition(models.Model): current_state = models.ForeignKey(States, on_delete = models.CASCADE, related_name = 'current') input = models.ForeignKey(Alphabet, on_delete = models.CASCADE) next_state = models.ForeignKey(States, on_delete = models.CASCADE, related_name = 'next') automata = models.ForeignKey(Automata, on_delete = models.CASCADE) The graph would look something like this: The most popular graph visualizing tool I found is GraphViz but I'm not sure how to use that with Django nor how to make it render the graph straight to the view and not have it create a file separately and then loading it. What is the best way I can create a graph from the data in my database and display it in my view? -
Access parent Model class fields in filter query
Is it possible to access the fields in a parent Model through a filter query? For example if I have the following Model structure: class Airwaves(models.Model): @cached_property def stations(self): name_substr = self.name if " " in name_substr: name_substr = name_substr[:name_substr.index(" ")] return Station.objects.filter(Q(name__contains=self.name) | Q(name__contains=name_substr)) class Radio(models.Model): ident = models.CharField(max_length=4) name = models.CharField(max_length=500) # Meta class Meta: abstract = True class Station(Radio): frequency = models.DecimalField(max_digits=8, decimal_places=2) With the existing code I get the error Cannot resolve keyword 'ident' into field. Choices are: frequency, id. How can I access the ident and name fields for the filter query in Airwaves? -
How do I update a field that is a foreignkey to another model with CreateView in django?
I would like to be able to update the notifications in my note model from the detail for my note model. Notification is a foreignkey to the note model. I want to use a form to update that particular field without having to go into the admin. Can someone please provide a code sample for how to do this? Thanks in advance. models.py from django.db import models from django.core.urlresolvers import reverse from notification.models import NoteNotification class Note(models.Model): title = models.CharField(max_length=100, default='') text = models.TextField() notification = models.ForeignKey(NoteNotification, null=True, blank=True) posted = models.DateTimeField() modified = models.DateTimeField(auto_now=True) class Meta: ordering = ["-posted"] def get_absolute_url(self): return reverse('notes:note_detail', args=[str(self.id)]) def __str__(self): return self.title views.py from django.shortcuts import render from django.views.generic import ListView, DetailView, CreateView, DeleteView from django.views.generic import UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from note.models import Note from notification.models import NoteNotification class ListNoteView(LoginRequiredMixin, ListView): model = Note class DetailNoteView(LoginRequiredMixin, DetailView): model = Note class CreateNoteView(LoginRequiredMixin, CreateView): model = Note fields = ['title', 'posted', 'text'] template_name_suffix = '_create_form' class EditNoteView(LoginRequiredMixin, UpdateView): model = Note fields = ['title', 'text'] class CreateNoteNotificationView(LoginRequiredMixin, CreateView): model = NoteNotification fields = ['notification'] class EditNoteNotificationView(LoginRequiredMixin, UpdateView): model = NoteNotification fields = ['notification'] urls.py from django.conf.urls import url from note.views import CreateNoteView, … -
Optimistic "locking" with Django transactions
I have a function fn() that needs to atomically do some database work that relies on some set of data not changing during its execution (true most of the time). What is the correct way to implement this in Django? Basically I'd like to do something like this: def ensure_fn_runs_successfully(): # While commit unsuccessful, keep trying while not fn(): pass @transaction.atomic def fn(): data = read_data_that_must_not_change() ... do some operations with the data and perform database operations ... # Assume it returns true if commit was successful, otherwise false return commit_only_if_the_data_actually_didnt_change() @transaction.atomic takes care of part of the problem (database should only ever see the state before fn runs or after fn runs successfully), but I'm not sure if there exists a good primitive to do the commit_only_if_the_data_actually_didnt_change, and retrying the operation if it fails. To verify the data didn't change, it would be enough to just check the count of items returned for a query is the same as it was at the beginning of the function; however, I don't know if there are any primitives that let you make the check and commit decision at the same time / without race condition. -
data is not inserting in database when I click submit button
I have created my first app in Django (1.10.5) / Python 3.4. I have a login page and a register page. Which is working fine. I can create new user and login with that id. Now after the login I want user to fill a form with some information and click on submit. And the information should get stored in the database. So I created a model first : Model.py class UserInformation(models.Model): firstName = models.CharField(max_length=128) lastName = models.CharField(max_length=128) institution = models.CharField(max_length=128) institutionNumber = models.CharField(max_length=128) cstaPI = models.CharField(max_length=128) orchidNumber = models.CharField(max_length=128) This has created a table in the DB. forms.py class UserInformationForm(ModelForm): class Meta: model = UserInformation fields = '__all__' views.py def home(request): form = UserInformationForm() variables = { 'form': form, 'user': request.user } return render(request,'home.html',variables) home.html {% extends "base.html" %} {% block title %}Welcome to Django{% endblock %} {% block head %}Welcome to Django{% endblock %} {% block content %} <p> Welcome {{ user.username }} !!! <a href="/logout/">Logout</a><br /><br /> </p> <form method="post" action=".">{% csrf_token %} <table border="0"> {{ form.as_table }} </table> <input type="submit" value="Submit" style="position:absolute"/> </form> {% endblock %} But when I click on submit button, It does not insert data into my table. -
Issue on a template
Every worked perfectly till, in home.html, I decided to change <li> <a>Facebook</a> </li> to <li> <a href="{% https://www.facebook.com/profile.php?id=100007037139675 %}">Facebook</a> </li> I executed the local server, and I got the following error : Invalid block tag on line 36: 'https://www.facebook.com/profile.php?blabla'. Did you forget to register or load this tag? Could anyone be able to tell me what is the issue -
Deleted Migration folder (Django 1.8) by accident what are my options?
I have accidently deleted one of migrations folders and and have no backup for it. What are my options? DB is postgres. Right now everything is OK.(I have moved instead migration folder I have on my DEV server with SQL lite) So I am just getting red message on server that not all migrations have been applied. But next time if i run migration i will be in trouble. What is my way out? -
user instance with id 1L does not exist
In Django Project I am using 2 database, first is mysql second is postgresql, in postgresql I have only geometric values but I need users too, so In models I have from django.conf import settings from django.contrib.gis.db import models: user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1) location = models.PointField() everything is works fine but when I try to save, user field is show an error user instance with id 1L does not exist' So what could be the answer ? does problem comes from router.py file ? -
Error on my objects.get() request because I haven't populated the attribute, but that's because the attribute value is triggered by another event?
When an element is clicked I trigger this ajax GET function: $('a.username').on('click', function() { var username = $(this).html(); var url = window.location.href.split('?')[0]; $.ajax({ type: 'GET', url: url, data: { username_clicked: username, csrfmiddlewaretoken: $("input[name='csrfmiddlewaretoken']").val() }, success: function (data) { console.log(data.username_clicked) } }) }); which gets the text of the element clicked (aka the username). This successfully sends to my view which captures the GET data through the following code: username_clicked = request.GET.get('username_clicked') print(username_clicked) #prints the correct text However when I add this code under the above text in the view: profile = Profile.objects.get(username=username_clicked) if username_clicked: print(profile.age) It gives me this error ONLOAD: DoesNotExist at /news/151/ Profile matching query does not exist. How can this error be raised if I haven't even triggered the click() event? The error appears when I load the page. Also just to reassure, when I manually add an instance of username, e.g. like this: profile = Profile.objects.get(username='zorgan'), that works fine. But it won't take a variable for some reason. Here's my models if you're wondering: class Profile(models.Model): username = models.CharField(max_length=32, default='AnonymousUser') age = models.IntegerField(default=0) def __str__(self): return self.username -
What is GAE changing to my POST request?
I'm working with an external API that unfortunately doesn't have that great error logging. I use django 1.9.5 and requests 2.11.1. When I make the following request, I get back a 200 status code r = requests.post( 'https://plazaapi.bol.com/offers/v1/%s' % product.ean, data=xml_to_send, headers=headers) headers are a dictionary of the date, an authorization code and the content-type .When I use the built-in server via manage.py runserver this works fine. But as there is a problem with requests on GAE according to other answers on this site, I have tried to use the requests_toolbelt monkeypatch and urlfetch, but I always get back the following error then: Request contains invalid authentication headers Code with the monkeypatch: import requests_toolbelt.adapters.appengine requests_toolbelt.adapters.appengine.monkeypatch() r = requests.post( 'https://plazaapi.bol.com/offers/v1/%s' % product.ean, data=xml_to_send, headers=headers) and from google.appengine.api import urlfetch r = urlfetch.fetch( url='https://plazaapi.bol.com/offers/v1/%s' % product.ean, payload=xml_to_send, method=urlfetch.POST, headers=headers, follow_redirects=False) # tried this, but has no effect. The headers I'm setting are: headers = {'Content-Type': 'application/xml', 'X-BOL-Date': date, 'X-BOL-Authorization': signature} Is GAE changing my request and adding headers? If so, can I stop it from doing so? -
How can I change from TEMPLATE_DIRS to TEMPLATE in Django 1.10
How can I change from TEMPLATE_DIRS to TEMPLATE in Django 1.10? I have tested the raspberry pi automation from the example with TEMPLATE_DIRS as following: TEMPLATE_DIRS = ( os.path.join(os.path.dirname(file),'templates').replace('\','/'), ) But now I use Django 1.10 and there is a warning to change from TEMPLATE_DIRS to TEMPLATES How can I change this code to make it works? -
DisallowedHost at / even though ALLOWED_HOSTS are correct
I am getting the following error when navigating to the url for my test site... My settings.py file looks correct... Is there any other reason that anyone can think of why I might be getting this error? I have tried deleting all .pyc files and restarting nginx and tried multiple ALLOW_HOSTS settings. I am using Amazon EC2 and Django 1.10.4 -
Model properties returning empty
I have a Model which retrieves data from one table in a database, and two other Models (Streets and Cities) that retrieve data from two other tables. All of this information needs to be accessed from the LandVehicle Model. I'm having some trouble figuring out exactly how the to retrieve data from the other tables into the properties in the LandVehicle Model. Below is the class structure I'm working with: class Vehicle(models.Model): name = models.CharField(max_length=500) lat = models.DecimalField(max_digits=15,decimal_places=6) lon = models.DecimalField(max_digits=15,decimal_places=6) radius = Decimal(.06) @abstractproperty def streets(): pass @abstractproperty def cities(): pass @cached_property def nearby_vehicles(): return Vehicle.objects.filter(lat__range=[self.lat - 2, self.lat + 2], lon__range=[self.lon - 2, self.lon + 2]) # Meta class Meta: abstract = True class LandVehicle(Vehicle): @property def streets(): name_substr = self.name if " " in name_substr: name_substr = name_substr[:name_substr.index(" ")] return LandVehicle.objects.filter(Q(streets__name__contains=self.name) | Q(streets__name__contains=name_substr) | (Q(streets__lat__range=[self.lat - self.radius, self.lat + self.radius]) & Q(streets__lon__range=[self.lon - self.radius, self.lon + self.radius]))) @property def cities(): name_substr = self.name if " " in name_substr: name_substr = name_substr[:name_substr.index(" ")] return LandVehicle.objects.filter(Q(cities__name__contains=self.name) | Q(cities__name__contains=airport_name_substr) | (Q(cities__lat__range=[self.lat - self.radius, self.lat + self.radius]) & Q(cities__lon__range=[self.lon - self.radius, self.lon + self.radius]))) # Meta class Meta: db_table = 'landvehicles' class Streets(models.Model): # Meta class Meta: db_table = 'streets' class … -
Django: AttributeError: "Object has no attribute"
I'm trying to get a property calculated in one class into another class. And I'm stuck... In the class "Reward", I need to subtract "deductible" from "pledge_level". In class "Pledge", I need to subtract the "not_taxable" from "amount" to return "decuctible_total". This works fine when accessing it in my template: (${{ reward.deductible}} is tax deductible or ${{ reward.not_taxable }} is not tax deductible) When run on the server, I get an internal server error: [Django] ERROR (EXTERNAL IP): Internal Server Error: /projects/fund/billing/1000 Here's the Traceback: Internal Server Error: /projects/fund/billing/1000/ Traceback (most recent call last): File "/var/venv/website/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/var/sites/proj/payments/views.py", line 98, in pledge_billing html = template.render(c) File "/var/venv/website/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render return self.template.render(context) File "/var/venv/website/lib/python2.7/site-packages/django/template/base.py", line 209, in render return self._render(context) File "/var/venv/website/lib/python2.7/site-packages/django/template/base.py", line 201, in _render return self.nodelist.render(context) File "/var/venv/website/lib/python2.7/site-packages/django/template/base.py", line 903, in render bit = self.render_node(node, context) File "/var/venv/website/lib/python2.7/site-packages/django/template/base.py", line 917, in render_node return node.render(context) File "/var/venv/website/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render return compiled_parent._render(context) File "/var/venv/website/lib/python2.7/site-packages/django/template/base.py", line 201, in _render return self.nodelist.render(context) File "/var/venv/website/lib/python2.7/site-packages/django/template/base.py", line 903, in render bit = self.render_node(node, context) File "/var/venv/website/lib/python2.7/site-packages/django/template/base.py", line 917, in render_node return node.render(context) File "/var/venv/website/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render result = block.nodelist.render(context) File … -
Deployment of Django App Through AWS Elastic Beanstalk Breaks CSS Paths
I have just finished deploying my first simple Django 1.8.6 (in case it matters) app to AWS through Elastic Beanstalk. Everything seems to be working; however, the styles are not loading. Here is the code of the template: {% load blog_tags %} {% load staticfiles %} <!DOCTYPE html> <html> <head> <title>{% block title %}{% endblock %}</title> <link href="{% static "css/blog.css" %}" rel="stylesheet"> </head> <body> <div id="content"> {% block content %} {% endblock %} </div> <div id="sidebar"> <h2>My blog!</h2> <p>This is my blog. I have written {% total_posts %} posts so far.</p> <h3>Latest posts</h3> {% show_latest_posts 3 %} </div> </body> </html> And here is the source code of the page: <!DOCTYPE html> <html> <head> <title>My Blog !!!</title> <link href="/static/css/blog.css" rel="stylesheet"> </head> <body> <div id="content"> ... If I click on the link "/static/css/blog.css" on the local machine, the CSS file opens; however, on the Beanstalk it cannot be found. I suspect that this has to do with some configs. Any idea where I can look to fix this? -
Django template "<QuerySet |<model_name: Model_name object>" and not rendering database query
Learning Django and running into a few issues in addition to the <QuerySet |<model_name: Model_name object>... issue. Read the Django tutorials, documentation, and a few other threads on SO, but apparently I am missing something. All my users are in the auth_user table. I also have a surveys which contains the name of surveys and survey id, and user_to_survey which links user id to the survey to the surveys they get. So the relation is auth_user -> user_to_survey -> surveys so that it ultimately gets the proper name that can be displayed in the template. This is how my files are setup. account/models.py from django.db import models from django.contrib.auth.models import User # Create your models here. class Surveys(models.Model): code = models.CharField(unique=True, blank=False, null=False, max_length=16) name = models.CharField(max_length=255, blank=False, null=False) short_name = models.CharField(max_length=128, null=False, blank=False) planning_date = models.DateField(blank=True, null=True) start_date = models.DateField(blank=True, null=True) webinar_date = models.DateField(blank=True, null=True) due_date = models.DateField(blank=True, null=True) invoicing_date = models.DateField(blank=True, null=True) soft_copy_date = models.DateField(blank=True, null=True) hard_copy_date = models.DateField(blank=True, null=True) data_effective_date = models.DateField(blank=True, null=True) stage = models.CharField(max_length=32, blank=True, null=True) updated = models.DateTimeField(blank=True, null=True) created = models.DateTimeField(blank=True, null=True) def __unicode__(self): return self.name class Meta: managed = True db_table = 'surveys' verbose_name_plural = 'Surveys' class UserToSurvey(models.Model): user = models.ForeignKey(User, to_field='id') … -
"Remove query strings from static resources" (django)
I get the error "Remove query strings from static resources" on pingdom. This is because of Fontawesome. What can I do here?