Questions tagged [django-1.4]

Django 1.4 is a version of the Django framework, released in March 2012, with enhanced time zones support and various other improvements. Please only use this tag if your question relates specifically to this version.

Django 1.4 is a version of the Django framework, released in March 2012, with enhanced time zones support and various other improvements. Please only use this tag if your question relates specifically to this version.

See the release notes for more details.

227 questions
5
votes
2 answers

date_format Django 1.4 with correct timezone

Okay simple question (I think). I have a DateTime field (auto_add_now) and when output to a template {{ edited|date:"DATETIME_FORMAT" }} I get the expected result of "Sept. 16, 2012, 12:01 p.m." But unfortunately things are slightly more…
byoungb
  • 1,771
  • 20
  • 31
5
votes
4 answers

Django 1.4: Why is my context processor not working?

I recently upgraded a project from Django 1.3 to 1.4, and that seems to have broken my context processor. In myapp/myapp/processors.py: def currentPath(request): return {'current_path': request.get_full_path()} In myapp/myapp/settings.py: from…
Matthew Calabresi
  • 487
  • 2
  • 11
  • 20
5
votes
1 answer

Sporadic 403 "CSRF FAILURECSRF cookie not set" errors with django

We have a small site that is just starting to be exposed to the outside world. For the most part it is working very well but we are occasionally getting 403 errors with the message "CSRF FAILURECSRF cookie not set" from one of the forms. The form…
brandon
  • 427
  • 3
  • 12
5
votes
1 answer

Django: problems while loading custom filters in the base template file while using template inheritance

When doing the {% load custom_filters %} in the template, after {% extends "base.html" %} everything works fine, but when I move the load to the base.html template the filter gets a weird behaviour. This is my custom_filters.py: from django import…
olofom
  • 6,233
  • 11
  • 37
  • 50
4
votes
1 answer

Django 1.4 import error No module named apps

I am running a django app on Windows server 2008 R2(64 bit). The same app works fine on my other system which has windows 7 64 bit. I am actually trying to move the app to the other machine. I am using Python 2.7 and django 1.4. The manage.py…
4
votes
1 answer

Intermittent ImportError with Django package

I have the following import line in a Django 1.4 project running in Python 2.7.6: from django.contrib.gis.utils import GeoIP This line works just fine 100% of the time in production and in development, but this line fails with an ImportError in…
ryanmrubin
  • 728
  • 4
  • 11
4
votes
3 answers

Load Django "static" template tag library globally without explicitly loading it in every file

I want to use the static tag in templates like so: I've found that that requires me to put {% load static %} at the beginning of every template file. Since I'm using it everywhere, I would like it to be a…
phazei
  • 5,323
  • 5
  • 42
  • 46
4
votes
1 answer

Using the Django assignment_tag built-in tag the right way

I'm working on a project in Django. Earlier today, I discovered the new (Django >= 1.4) assignment_tag. I immediately decided that it was just what I needed EVERYWHERE and threw some logic into one that executed a very simple query against the…
chucksmash
  • 5,777
  • 1
  • 32
  • 41
4
votes
2 answers

Django: How to call class-based generic views in views.py?

I want to call class-based generic views in views.py Please see my code... urls.py from django.conf.urls import patterns, include, url from crm.views import * urlpatterns = patterns('', (r'^workDailyRecord/$', workDailyRecord), ) and my…
chobo
  • 4,830
  • 5
  • 23
  • 36
4
votes
1 answer

Django Admin - Custom clean method for a model with foreignkey field

Consider following models: class Arena(models.Model): crowd_capacity = models.PositiveInteger() # more fields here class Section(models.Model): name = models.CharField(max_length=10) crowd_capacity = models.PositiveInteger() arena =…
Neara
  • 3,693
  • 7
  • 29
  • 40
4
votes
3 answers

Django admin interface shows counts but no data

I'm using Django 1.4 and experiencing an unusual problem with hidden rows in my admin site. I can view individual models in my app, and they appear to be querying the database correctly when I click into each one; I can see the number of matches in…
user496650
4
votes
3 answers

Django 1.4 TimeField migration fails on PostgreSQL

I edited two fields on a model and changed them from IntegerFields to TimeFields: class Model(models.Model): start_time = models.TimeField() end_time = models.TimeField() I'm using these two fields to save a naive time, which is not related…
Yuval Adam
  • 161,610
  • 92
  • 305
  • 395
4
votes
1 answer

how to check a previous value on a django model

I've got a django model with a field that i want to be always greater than the previous one of the same model instance after an update, like this: class MyModel(models.Model): version = models.FloatField() prev_value = 0 def…
loki
  • 2,271
  • 5
  • 32
  • 46
3
votes
2 answers

Windows virtualenv not switching python for django

I managed to install virtualenv, install django-1.4-alpha-1 via pip install and am trying to start a django with it's manage.py runserver Eventhough I switched with virtualenv via activate (note the prefix in cmd screen bellow) to the right…
mreq
  • 6,414
  • 4
  • 37
  • 57
3
votes
1 answer

NoReverseMatch for '' in django URLs

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'^/?$',…
user123577
  • 121
  • 2
  • 12
1 2
3
15 16