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
8
votes
2 answers

New URL on django admin independent of the apps

I am using django 1.4 and Python 2.7. I just have a simple requirement where I have to add a new URL to the django admin app. I know how to add URLs which are for the custom apps but am unable figure out how to add URLs which are of the admin app.…
Sandip Agarwal
  • 1,890
  • 5
  • 28
  • 42
8
votes
1 answer

{% url %} gives me NoReverseMatch error while reverse() returns the url just fine. Why?

I don't know if this SO question is of the same problem that I am about to describe, but it does share the same symptoms. Unfortunately, it still remains unresolved as I am writing. So here is my problem. I am trying to add James Bennett's…
tamakisquare
  • 16,659
  • 26
  • 88
  • 129
8
votes
4 answers

Django1.4: Generic way to set language links in template to work with i18n_patterns?

I started to play with new i18n_patterns in Django 1.4. Basically, i want to have language links for each of my supported languages on all of my templates headers. I have implemented my header as a separate template that is being included in other…
8
votes
1 answer

Migrating to Django 1.4

I'm currently developing a website in Django v1.2.7. That's the version as per requirements, but I think I could change it without problems. I was thinking about using v1.3 (because of class-based views, etc), but the version 1.4 was released a few…
Oscar Mederos
  • 29,016
  • 22
  • 84
  • 124
7
votes
1 answer

ContentNotRenderedError after a django upgrade

Here's a middleware that I use: class StatsMiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): # get number of db queries before we do anything n = len(connection.queries) # time the…
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
7
votes
2 answers

Django QuerySet: filter by the value of another field

I have a model I wish to filter by its attribute a. The model also has another attribute b. I am trying to filter entries where a is 0 or a has the value of the b attribute (for each row, obviously). How can I filter by the value of another…
dabadaba
  • 9,064
  • 21
  • 85
  • 155
7
votes
2 answers

Django 1.4.1 error reporting don't send me an email

This question is probably a duplicated question and sorry about that. I'm using Django 1.4.1 and on production server I set DEBUG to False. Sometimes users get an Exception and server shows 500.html template but don't send an email configured in…
WBAR
  • 4,924
  • 7
  • 47
  • 81
7
votes
3 answers

Are Instance variables of class-based-views persistent?

I've just started using class-based views in django. But there's an issue that is confusing for me. I ran the following code snippet with django 1.4.1 with multithreaded development server. class TestView(TemplateView): template_name =…
user1603806
  • 141
  • 1
  • 3
7
votes
3 answers

How to use the built-in 'password_reset' view in Django?

I have set the following entry in the urls.py (r'^password_reset/$', 'django.contrib.auth.views.password_reset'), but once I go to http://127.0.0.1:8000/password_reset/ I get the error message: NoReverseMatch at /password_reset/ Reverse for…
Houman
  • 64,245
  • 87
  • 278
  • 460
7
votes
3 answers

Static folders structure in Django 1.4?

This is the new project structure (from the Django 1.4 release notes). myproject |-- manage.py |-- myproject | |-- __init__.py | |-- settings.py | |-- urls.py | `-- wsgi.py `-- polls |-- __init__.py |-- models.py |-- tests.py …
Sahat Yalkabov
  • 32,654
  • 43
  • 110
  • 175
6
votes
2 answers

How to set up Django models with two types of users with very different attributes

Note: I've since asked this question again given the updates to Django's user model since version 1.5. I'm rebuilding and making improvements to an already existing Django site and moving it over from Webfaction to Heroku, and from Amazon's SimpleDB…
jdotjdot
  • 16,134
  • 13
  • 66
  • 118
6
votes
5 answers

How to delete all data for one app in Django 1.4 now that reset is gone?

How do I delete all the data in the database for on Django app? In previous version manage.py reset APPNAME did the job, but that's been deprecated. What are we supposed to do now if we want to delete all the data from an app using the command…
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248
6
votes
2 answers

Testing only project in Django

When I try to run python manage.py test in my Django (1.4) project, I get the error: ERROR: test_site_profile_not_available…
5
votes
1 answer

How to update a user's `extra_data` after they have been associated with account?

I've successfully managed to use django-socialauth to associate an account (in this case, an instagram account) with an existing user account. I've also set up my pipeline to collect additional user details: def update_social_auth(backend, details,…
NT3RP
  • 15,262
  • 9
  • 61
  • 97
5
votes
3 answers

How to Dynamically Repeat Steps in Django Formwizard 1.4?

I'm trying to repeat a step in Django Formwizard (Django 1.4) conditionally based on a checkbox in the step. The form creates an object, and has a checkbox (hopefully) allowing them to repeat the step and create another object of the same model with…
Nick Gottlieb
  • 231
  • 2
  • 9
1
2
3
15 16