Saturday, February 8, 2014

How to use djblets (I get error)

Hello, I am trying to use djblets but I have this error:

Error during template rendering

In template /usr/lib/python2.6/site-packages/djblets/util/templates/js/jquery.html, error at line 1
Invalid block tag: 'static'


1    <script type="text/javascript" src="{% static "djblets/js/jquery-1.8.2.min.js" %}"></script>


settings.py:
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    'django.contrib.admindocs',
    'cpvru',
    'south',
    'djblets.auth',
    'djblets.datagrid',
    'djblets.extensions',
    'djblets.feedview',
    'djblets.gravatars',
    'djblets.log',
    'djblets.pipeline',
    'djblets.siteconfig',
    'djblets.testing',
    'djblets.util',
    'djblets.webapi',  
)


views.py:
from django.http import HttpResponse
from django.shortcuts import render
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

from cpvru.models import Miembro
from cpvru.datagrids import UserDataGrid

from djblets.datagrid.grids import Column, DataGrid

def index(request, template_name='datagrid/datagrid.html'):
    return UserDataGrid(request).render_to_response(template_name)

datagrids.py:
from django.contrib.auth.models import User
from djblets.datagrid.grids import Column, DataGrid

class UserDataGrid(DataGrid):
    username = Column("Username", sortable=True)
    first_name = Column("First Name", sortable=True)
    last_name = Column("Last Name", sortable=True)

    def __init__(self, request):
        DataGrid.__init__(self, request, User.objects.filter(is_active=True), "Users")
        self.default_sort = ['username']
        self.default_columns = ['username', 'first_name', 'last_name']


I think I am missing importing something?

Thanks you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53ea232b-efb5-4deb-a65a-fe6235a3c620%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment