FAQ Database Discussion Community


How to use template within Django template?

python,html,django,templates,django-1.4
I have the django template like below: <a href="https://example.com/url{{ mylist.0.id }}" target="_blank"><h1 class="title">{{ mylist.0.title }}</h1></a> <p> {{ mylist.0.text|truncatewords:50 }}<br> ... (the actual template is quite big) It should be used 10 times on the same page, but 'external' html elements are different: <div class="row"> <div class="col-md-12 col-lg-12 block block-color-1"> *django...

Change of 'QuerySet' from Django 1.4 to 1.7

python,django,django-queryset,django-1.7,django-1.4
I'm trying to port an app from Django 1.4.15 -> 1.7.3 I've come to a problem where the app have a method in models.py def is_votable(self, user): ''' Decides if the user can vote for him/herself or not ''' if self.rated_by.all().__contains__(user): return False return True the problem I have is...

Django delete all cookies for all users

django,cookies,django-1.4
I have the django view to set the value in cookies 'no_show_dialog' when a user clicks 'Don't remind me anymore' in the modal dialog. Now i changed that dialog completely and want to reset that cookie for all users, so they will have to see it again at least once....

NoReverseMatch for '' in django URLs

python,django,django-1.7,django-1.4
NoReverseMatch at /login/ Reverse for '' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] I've located what I think is the error in urls.py urlpatterns = patterns('', url(r'^/?$', 'util.frontpage.frontpage', name='frontpage'), (r'^schedule/', include('schedule.urls')), (r'^user/', include('usermanagement.urls')), (r'^group/', include('groupmanagement.urls')), ) if settings.DEV_SERVER: urlpatterns += staticfiles_urlpatterns() urlpatterns += patterns('',(r'^login/$',...