Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TemplateSyntaxError: widget_tweaks is not a valid library django

I am new to django and I am trying to trying to implement a form that uses widget-tweaks.

I did install widget tweaks (I am using Ubuntu 14.04)

sudo pip install django-widget-tweaks

My settings file looks like this:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'core',
'addattr',
'widget_tweaks',
)

The html looks like this:

{% extends "base/theme.html" %}
{% load widget_tweaks %}
{% block main_content %}
...more code...

The class in the views and the linking in the url works perfectly fine.

But every time when I try to load the html it says:

widget_tweaks' is not a valid tag library: Template library widget_tweaks not found, tried django.templatetags.widget_tweaks,django.contrib.admin.templatetags.widget_tweaks,django.contrib.staticfiles.templatetags.widget_tweaks

Can anyone help? Thanks in advance

like image 707
Tom Avatar asked Mar 16 '23 23:03

Tom


1 Answers

check your app settings add :

'widget_tweaks',

to your INSTALLED_APPS

like image 129
M. Gara Avatar answered Apr 07 '23 10:04

M. Gara