Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
ImportError: No module named 'saver'
i'am getting error while running data_save project in django like: import saver ImportError: No module named 'saver' -
Found in pip freeze but cannot put in INSTALLED_APPS Django
I am beginner in Django. I need to install https://django-import-export.readthedocs.io/en/latest/installation.html and I have already done in my localhost. Then, in server, I install that with pip and when I check with pip freeze, I saw django-import-export==0.5.1 too. -bash-4.2$ pip3.4 freeze diff-match-patch==20121119 Django==1.8 django-filter==0.7 django-import-export==0.5.1 django-oauth2-provider==0.2.6.1 django-pagination==1.0.7 djangorestframework==3.4.6 Problem is when I pu import_export in INSTALLED_APPS, it say The server encountered an internal error or misconfiguration and was unable to complete your request. I have enabled debug as True but I can't detail error. How shall I do? INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'push_notifications', 'import_export', ) -
Django rest framework: How to change error response format globally
All the error messages return from django default validators ends with a dot (.). Is there anyway to remove that last dot from all messages globally. Or, If someone help me to find a way to catch these error returning function, I can trim the last dot if exists in that section. Sample error messages. { "email": [ "This field may not be blank." ] } { "email": [ "Enter a valid email address." ] } -
Upload image with Django CBV CreateView
I am trying to create a user profile after registering a user. In this profile, I need to upload an image. But I keep getting a KeyError when validating the image. After several hours of googling and trying different solutions, I am now stuck. Can someone please show me what I am doing wrong? Thanks in advance. models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) slug = models.SlugField(default='', editable=False) picture = models.ImageField('Profile picture', upload_to='profile_pics/%Y-%m-%d/', null=True, blank=True) bio = models.CharField("Short Bio", max_length=200, blank=True, null=True) email_verified = models.BooleanField("Email verified", default=False) views.py from .models import Profile from .forms import ProfileForm class CreateProfile(FormView): model = Profile template_name = 'profiles/profile_form.html' form_class = ProfileForm fields = ['picture', 'bio'] def get_success_url(self): return reverse('profiles:detail', kwargs={'slug': self.slug}) def form_valid(self, form): profile = form.save(commit=False) image = form.cleaned_data['image'] obj.user = self.request.user profile.save() return HttpResponseRedirect(self.get_success_url()) forms.py from .models import Profile class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ['picture', 'bio',] Traceback: File "/home/xxxxxxxxxx/xxxxxxxx/xxxxxxx/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner 42. response = get_response(request) File "/home/xxxxxxxxxx/xxxxxxxx/xxxxxxx/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/home/xxxxxxxxxx/xxxxxxxx/xxxxxxx/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/xxxxxxxxxx/xxxxxxxx/xxxxxxx/lib/python3.5/site-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/home/xxxxxxxxxx/xxxxxxxx/xxxxxxx/lib/python3.5/site-packages/django/views/generic/base.py" in dispatch 88. return handler(request, *args, **kwargs) File "/home/xxxxxxxxxx/xxxxxxxx/xxxxxxx/lib/python3.5/site-packages/django/views/generic/edit.py" in post 183. return … -
How to assign one variable to another in Django temlpate
What I want to achieve is very simple, and I have tried few different things but none of them are working for me. I am using Django version 1.10 and python 3.4 (not sure if it matters) This is what I want to do, variable_a = variable_b or variable_b = variable_a Failed Attempt #1: {% variable_a = variable_b %} Failed Attempt #2: {% with varibale_b as variable_a %} {% endwith %} Failed Attempt #3: {{ variable_a|default:variable_b }} Failed Attempt #4: Filter: @register.assignment_tag def define(variable_a=None): return variable_a template: {% define variable_b as variable_a %} -
Django OneToOne Profile/User relationship not saving
I'm trying to set up a Django blogging app to use a one to one relation from User's to a Profile model in order to capture mode information than the default Django User model. The problem Im having is that my Profile model isn't saving, and my profile table remains unchanged despite successfully signing up a User. Here's my view where this happens: @transaction.atomic def profile_new(request): if request.method == "POST": user_form = UserForm(request.POST) profile_form = ProfileForm(request.POST) if user_form.is_valid() and profile_form.is_valid(): user = user_form.save(commit=False) profile = profile_form.save(commit=False) user.username = user.email user.set_password(user.password) user.save() profile.user = user profile.save() return redirect('profile_detail', pk=user.pk) else: messages.error(request, ('Please correct the error below.')) else: user_form = UserForm() profile_form = ProfileForm() return render(request, 'accounts/update.html', { 'user_form': user_form, 'profile_form': profile_form }) Pretty straightforward, runs with no errors at all, it just never actually saves the Profile object. heres the forms: from django import forms from .models import User, Profile class UserForm(forms.ModelForm): """confirm_password = forms.CharField()""" class Meta: model = User fields = ('first_name', 'last_name', 'email', 'password') class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ('bio', 'birth_date', 'avatar', 'location') And the model for Profile: from django.db import models from django.contrib.auth.models import User class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) bio = … -
Use of multi-select field linked to other table
I have two models one model first model has field as below emp_skill_os = MultiSelectField(choices=[[item.skill_os, item.skill_os] for item in SkillsOs.objects.all()]) values are taken from other model SkillsOs Now the problem is sync is not happening automatically unless do manually now the problem is emp_skill_os data is not updated until i do migration -
Staticfiles not a registered tag and staticfiles not loading
My staticfiles will not load no matter what and I'm at the point where I've looked through stackoverflow and read documentation for five hours so I need help. Here's my URL for urls.py urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', include('notebook.urls')) ] from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns += staticfiles_urlpatterns() Meanwhile this is my settings for my project and I'm egregiously been trying to figure out why my staticfiles have not loaded. I'm not running this in a virtualenv so those related issues have been addressed I've looked over the Django documentation to try and find where in my setting the reason the staticfiles are not loading and I after hours of that and staackoverflow not a single answer has availed. This is my settings file for the project """ Django settings for onesky project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # Static file directory TEMPLATE_DIR = os.path.join(BASE_DIR, "templates") # Static files for multiple directories … -
Docker-Compose Workflow, docker-compose down?
I am learning docker have a working docker-compose implementation with django/postgresql. Everything is working as expected. My question is what is considered "best practice" with data persistence and the risk to the data. Here is my full docker-compose.yml: version: '2' services: db: image: postgres volumes: - postgresql:/var/lib/postgresql ports: - "5432:5432" env_file: .env web: build: . command: python run_server.py volumes: - .:/project ports: - "8000:8000" depends_on: - db volumes: postgresql: the run_server.py script simply checks to makes sure the database can be connected to and then runs python manage.py runserver. So if I stop my containers and restart them the data persists. My concern lies in the docker-compose down command. This command deletes the database. Is this intended? It seems like it would be very easy to run this and accidentally do a lot of damage. Is there a way so that the database persists even if these containers are removed? -
AttributeError calling custom manager method in migration
I'm using Django 1.10.3, and in a migration step I encounter an error when I use RunPython() to call a custom manager method. Any ideas what I'm doing incorrectly? The error message is: AttributeError: 'Manager' object has no attribute 'current_event' My model and manager: class EventManager(models.Manager): use_in_migrations = True def current_event(self): try: the_event = self.filter( event_date__gte=date.today() ).earliest( field_name='event_date' ) except ObjectDoesNotExist: the_event = None return the_event class Event(models.Model): event_date = models.DateField() objects = EventManager() My migration: def update_ratings_event(apps, schema_editor): Rating = apps.get_model('league', 'Rating') Event = apps.get_model('league', 'Event') recent_event = Event.objects.current_event() for a_rating in Rating.objects.all(): a_rating.event = recent_event a_rating.save() class Migration(migrations.Migration): dependencies = [ ('league', '0009_auto_20170401_1106'), ] operations = [ migrations.RunPython(update_ratings_event), ] And this is the traceback: File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/core/management/base.py", line 345, in execute output = self.handle(*args, **options) File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 204, in handle fake_initial=fake_initial, File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/db/migrations/executor.py", line 115, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/db/migrations/executor.py", line 244, in apply_migration state = migration.apply(state, schema_editor) File "/home/mriley/.virtualenvs/League/lib/python3.5/site-packages/django/db/migrations/migration.py", line … -
(Help) Want to customize the django rest framework Browsable API page
[Issue] I want to customize the django rest framework Browsable API page to have the same look and feel as the rest of my web application. [Installed Software] Python 3.6 django 1.10.6 django rest framework 3.6.2 markdown 2.6.8 [What I have tried] I have tried to follow the instructions in the link: http://www.django-rest-framework.org/topics/browsable-api/ However, I seem to be missing some key things. I created my own template as per the instructions, but the it didnt indicate how I can actually call the template. I came across this article: http://www.django-rest-framework.org/topics/html-and-forms/ Here I can see where I define the renderer class and I can explicitly call the template I created. The problem is I am getting a reverse error on rest_framework. In the login.html file I simply have: {% extends "rest_framework/login_base.html" %} {% block branding %} <h3 style="margin: 0 0 20px;">Some New Title</h3> {% endblock %} -
how to do unit testing for this?
def login_user(request): if request.method == "POST": username = request.POST['username'] #this is my first field to be tested password = request.POST['password'] #this is my second field to be tested user = authenticate(username=username, password=password) if user is not None: if user.is_active: login(request, user) playlists = Playlist.objects.filter(user=request.user) return render(request, 'index.html', {'playlists': playlists}) else: return render(request, 'login.html', {'error_message': 'Invalid login'}) return render(request, 'login.html') how can i do testing to this code in django and what all i need to install in order to test it -
Static files are loading only to one inherited template
I'm learning django and I have problem with static files. Structure of my templates: base.html category - category_detail.html - list_content.html category_detail.html is extending base.html and list_content.html is extending category_detail.html (hovewer, extending base.html is not working as well). category_detail.html {% extends 'base.html' %} {% block title %} {{ category_name }} {% endblock %} {% block description %} {{ category_description }} {% endblock %} {% block content %} <div class="col-md-10 text-center"> <a href="{% url 'charts:category_error_list' category_name %}" id="list-button" class="btn btn-success btn-lg active" role="button" aria-pressed="true">Error list</a> <a href="#graphs" id="graph-button" class="btn btn-info btn-lg" role="button" aria-pressed="true">Graphs</a></div> {% endblock %} list_content.html {% extends 'category/category_detail.html' %} {% load staticfiles %} {% block content %} <h1 class="page-header">Some content </h1> {% endblock %} (Because of length of base.html I will not add code of template. Important thing to note is that category_detail has already static files) settings.py - Templates TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['analizer/charts/templates/charts'], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'analizer.charts.context_processors.menu_information' ], }, }, ] WSGI_APPLICATION = 'analizer.wsgi.application' Static - setting.py STATIC_ROOT = os.path.join(BASE_DIR, 'charts/static') STATIC_URL = '/static/' My problem is that category_detail.html has already loaded static files but list_content.html is not loading any static files. Extending base.html is not helping - … -
Django - Collecting data with aria-selected="true"
I am using the jQuery Bootgrid in my template like the following: <table id="meds" class="table table-condensed table-hover table-striped" data-selection="true" data-multi-select="true" data-row-select="true" data-keep-selection="true"> <thead> <tr> <th data-column-id="id" data-type="numeric" data-identifier="true">ID</th> <th data-column-id="nom" data-sortable="true" data-filterable="true">Nom</th> [...] </tr> </thead> <tbody> {% for med in meds %} <tr> <td>{{ med.id }}</td> <td>{{ med.nom }}</td> [...] </tr> {% endfor %} </tbody> </table> Upon selecting the ids their rows have the attribute aria-selected turn into true instead of the default false. How can I collect the data with the attribute ari-selected="true" and send it into a view? -
how to call and print out all the separated dataframe after using groupby function in python?
Hello, i was very new to python and i face some problem on how to print out all the separated dataframe in html pages. I can get all the separated table in cmd but when i transfer to html pages it only show me the last dataframe in cmd. For example i used this coding... for name, group in df.groupby('type'): print(name) print(group) and my output in cmd is Drag type company name 4 Drag 1st John 5 Drag 1st Jason 6 Drag 2nd Ryan 7 Drag 2nd Sun [4 rows x 3 columns] Nightha type company name 0 Nightha 1st Minh 1 Nightha 1st Cobson 2 Nightha 2nd Aling 3 Nightha 2nd Vivian [4 rows x 3 columns] Scou type company name 8 Scou 1st Sing 9 Scou 1st Pong 10 Scou 2nd kelly 11 Scou 2nd amy [4 rows x 3 columns] And after i transfer to django html pages it show me only the last table which is Scou only... Scou type company name 8 Scou 1st Sing 9 Scou 1st Pong 10 Scou 2nd kelly 11 Scou 2nd amy Any one have idea to print out all the table in html pages?(Django) -
Django template extends doens`t open a file
I`m trying to extend one html file from other, but it simply shows me only base.html result. Here is my project folders: -diploma -catalogue -migrations -templates -catalogue base.html header.html _init__.py admin.py apps.py models.py tests.py urls.py views.py -diploma __init__.py settings.py urls.py wsgi.py settings.py ... BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) INSTALLED_APPS = [ 'catalogue', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] ... TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')] , 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] urls.py from django.conf.urls import url from catalogue import views urlpatterns = [ url(r'^$', views.index, name='index'), ] views.py from django.shortcuts import render def index(request): return render(request, 'catalogue/base.html') base.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> {% block content %} {% endblock %} </body> </html> header.html {% extends 'catalogue/base.html' %} {% block content %} <h1>Hello</h1> {% endblock %} Really, trying to find the issue, but can`t figure out. Only effect cghanges made in base.html -
Django - change form field to readonly when value in view is set to any value
In my view.py I have a variable - for example 'email'. In my forms.py I have an email field - for example: email = forms.EmailField(label="Email adress") I would like to change this to: email = forms.EmailField(label="Email adress", widget=forms.TextInput(attrs={'readonly': 'readonly'})) when email variable from my view.py is filled (from None to any value). By default email is set to None. How can I achieve that? -
Timestamp value from pcap file (django)
I am using django framework & trying to fetch Timestamp value from a pcap file. I am unpacking bits like: unpacked = struct.unpack ( '@ I H H i I I I I I I I' , raw_data[:40] ) timestamp = time.strftime ( '%Y-%m-%d %H:%M:%S' , time.localtime ( unpacked ) ) but getting error for 'timestamp' Error: TypeError: an integer is required (got type tuple) Full code is here: https://github.com/manishkk/pcap-parser/blob/master/webapp/views.py Please help me in solving this issue. Thanks -
Django count group by date from datetime
I'm trying to count the dates users register from a DateTime field. In the database this is stored as '2016-10-31 20:49:38' but I'm only interested in the date '2016-10-31'. The raw SQL query is: select DATE(registered_at) registered_date,count(registered_at) from User where course='Course 1' group by registered_date; It is possible using 'extra' but I've read this is deprecated and should not be done. It works like this though: User.objects.all() .filter(course='Course 1') .extra(select={'registered_date': "DATE(registered_at)"}) .values('registered_date') .annotate(**{'total': Count('registered_at')}) Is it possible to do without using extra? I tried to add it as part of the count annotation and this did not work as Date() is not recognised: User.objects.all() .filter(course='Course 1') .values('registered_at') .annotate(**{'total': Count(Date('registered_at'))}) I read that TruncDate can be used so I tried this but it returned the datetime fields with a count of 0 for each one. User.objects.all() .filter(course='Course 1') .values('registered_at') .annotate(**{'total': Count(TruncDate('registered_at'))}) This is because values can't have TruncDate inside so I tried an additional annotation: User.objects.all() .filter(course='Course 1') .annotate(registered_date=TruncDate('registered_at')) .values('registered_date') .annotate(**{'total': Count('registered_date')}) This does not work as registered_date is None so it returns If the values is set to 'registered_at' then I get a KeyError on 'registered_at'. When I changed this to: User.objects.all() .filter(course='Course 1') .annotate(registered_date=TruncDate('registered_at')) .values('registered_date') .annotate(**{'total': Count('registered_at')}) I get … -
Foreign constraint failed add record sqlite3 using many to many relationship
My models: class TestSkill(models.Model): name = models.CharField(max_length=255) value = models.CharField(max_length=255) class Girl(models.Model): skills = models.ManyToManyField(TestSkill) this has created following sql statement: CREATE TABLE "my_app_girl_skills" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "girl_id" integer NOT NULL REFERENCES "my_app_girl" ("id"), "testskill_id" integer NOT NULL REFERENCES "my_app_testskill" ("id")) -
Django: How to amend a model being created?
class Timeline(models.Model): name = models.CharField(blank=False, max_length=256) # ... class User(models.Model): main_timeline = models.OneToOneField('Timeline', related_name='holder_user', null=False) # ... When creating a user, I want a new timeline to be created automatically and assigned to main_timeline field. So far, the best solution I have is not to use User.objects.create() directly but instead wrap it into another method. Are there other solutions? -
django many to many relationship foreign constraint failed add record sqlite3
My models: class TestSkill(models.Model): name = models.CharField(max_length=255) value = models.CharField(max_length=255) class Girl(models.Model): skills = models.ManyToManyField(TestSkill) this has created following sql statement: CREATE TABLE "my_app_girl_skills" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "girl_id" integer NOT NULL REFERENCES "my_app_girl" ("id"), "testskill_id" integer NOT NULL REFERENCES "my_app_testskill" ("id")) I try to manually create a row in sqllite browser And when I press add - I get following error: Error adding record: FOREIGN KEY constraint failed (INSERT INTO 'my_app_girl_skills(id,girl_id,testskill_id) VALUES(1,0,0);) What do I do? -
Global Dictionary Between Two Files
I have tried lots of things here but a bit stuck. I have two python files. ---------------------------------- # file_one.py from file_two import add_value # Generate some value and pass it over to file_two by calling the function add_value print add_value("somevalue") ---------------------------------- #file_two.py myDictionary = {} def add_value(payload): global myDictionary # Insert payload with a timestamp in to myDictionary myDictionary[payload] = '{:%Y-%m-%d %H:%M:%S}'.format(datetime.now()) return myDictionary def some_other_function(): print myDictionary When I print the Dictionary in file_two.py using another function I only ever get {}. I've tried all kinds of different methods of setting the Dictionary up and not using global etc but I can't get any information out in file_two. file_one works fine and prints the myDictionary with the correct values. So I suppose my question is two part. How do I get access to the Dictionary in file_two and where is the data being stored if not in file_two! Thanks Edit 1 Some background. file_two is a Django view.py so some_other_function is a browser request. The idea is I will pass the information from the dictionary to the browser to be displayed along with database information. Could that be the issue? Something to do with the Django package? I am … -
Using Django template inheritance with ngroute - where does `<div ng-view>` go if I want to override blocks outside of `<div ng-view>`?
This is my base.html: <!DOCTYPE html> <html{% block html %}{% endblock%}> {% load static from staticfiles %} <head> <meta charset="utf-8"> <title>{% block title %}Base{% endblock %}</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="{% static 'js/jquery-1.11.3.min.js' %}"></script> <script src="{% static 'js/angular.js' %}"></script> <script src="{% static 'js/angular-route.js' %}"></script> <base href="/"> {% block head %}{% endblock %} </head> <noscript> <!-- If JS is disabled, the CSS below will run, causing everything inside "bodyContainer" to no appear and causing the "noscriptmsg" to appear. --> <style type="text/css"> .bodyContainer {display:none;} .noscriptmsg {display: block;} </style> </noscript> <div class="noscriptmsg"> <p>Please enable your browser's JavaScript in order to view this website.</p> </div> {% block body %} <span class='cerrorMessage' ng-bind="ctrl.cerrorMessages"></span> {% endblock %} </html> This is an example of a template which inherits base.html (call it home.html): {% extends "base.html" %} {% load static from staticfiles %} {% block html %} ng-app="AuthenticationApp"{% endblock %} {% block head %} <link rel="stylesheet" type="text/css" href="{% static 'css/home.css' %}"> <script src="{% static 'js/home.js' %}"></script> {% endblock %} {% block body %} <body ng-controller="MainCtrl as ctrl" class="bodyContainer"> <div class="container"> <div class="row"> {{ block.super }} </div> <div class="row"> <form ng-submit="ctrl.change()" class="form-horizontal" name="myForm"></form> </div> </div> </body> {% endblock %} The html block is to set the ng-app which … -
Error when using pip install: "Could not find a version that satisfies the requirement <package-name>"
I'm trying to install django-trumbowyg https://github.com/sandino/django-trumbowyg to my app When I did pip install django-trumbowyg, it returned this error: Could not find a version that satisfies the requirement django-trumbowyg (from versions: ) No matching distribution found for django-trumbowyg Does anyone know what this means? And how I can fix it?