Questions tagged [django-1.5]

Django 1.5 is a version of the Django framework, released in February 2013. Please only use this tag if your question relates specifically to this version.

Django 1.5 is a version of the Django framework, released in February 2013. Please only use this tag if your question relates specifically to this version.

See the release notes for more details.

275 questions
3
votes
1 answer

django-pyodbc queries returning fields with ANSI Padding Status ON, how to strip out whitespace?

So I am querying an SQL Server DB which has many CHAR fields with ANSI Padding Status ON. This means that for a CHAR(10) field, the value may be "123" but I'm instead receiving "123......." (whitespace) in the result. Is there a best practice method…
DanH
  • 5,498
  • 4
  • 49
  • 72
3
votes
1 answer

Django custom assignment_tag does not get executed

I try to make my own assignment template tag in Django 1.6 (edit: I also tried it with 1.5.5 w/o success) but I can't get it to do anything. In templatetags/getattribute.py I have: from django import template import logging register =…
frixx
  • 143
  • 8
3
votes
1 answer

django signals module object has no attribute connect

I am trying to create a project for creating feeds/activity feeds of a user with the help of a blog. This is the signals.py: from django.db.models import signals from django.contrib.contenttypes.models import ContentType from django.dispatch import…
Aamu
  • 3,431
  • 7
  • 39
  • 61
3
votes
1 answer

Django 1.5 on Dreamhost - Static files not found, getting 404s

I'm sorry, I know that similar questions have been asked many times... I'm really sorry to ask again but I'm having so much trouble with this (I've spent hours and hours trying everything but I just don't feel like I'm making any progress) that I…
3
votes
1 answer

how to set a value for choicefield in django

I have a address form which has a choicefield of countries. I want to set a value before the form loads. How could I do that? Here is the form: from django import forms from django.utils.translation import gettext as _ from django_countries import…
Maverick
  • 2,738
  • 24
  • 91
  • 157
3
votes
1 answer

successfully imported class is None, but only inside method

I have code that looks like this in my Django app's models.py: from main.models import SmartPrefetchQuerySet class EventPrivacyManager(SoftDeletablePrivacyManager): def get_query_set_for_producer(self, producer): return…
Andrew Gorcester
  • 19,595
  • 7
  • 57
  • 73
3
votes
2 answers

Django: issue with unit-test ListView and assertContains

I am adapting the unit tests from the official Django 1.5 tutorial. I am trying to test an empty context on a ListView. I get the following error: AssertionError: Couldn't find 'No persons are available' in response. And this is my ListView…
Paul
  • 2,409
  • 2
  • 26
  • 29
3
votes
3 answers

Use email as username with django-registration

I am trying to use an email address as the username (using Django 1.5's custom user model) along with django-registration. The docs for version 1.0 of django-registration say:- the base view classes are deliberately user-model-agnostic. Simply…
bodger
  • 1,112
  • 6
  • 24
3
votes
1 answer

Choosing the right user inheritance method for django 1.5

I have a situation where I need to subclass a custom user model for a django 1.5 project (related question/background here: Subclassing AbstractUser in Django for two types of users ) I need an abstract user class SchoolPerson and a number of…
askvictor
  • 3,621
  • 4
  • 32
  • 45
3
votes
1 answer

Django - URL template tag breaks with subdomains

I use a custom middleware for mapping subdomains to applications' urls.py by assigning the relevant urls.py to the request.urlconf variable. This works fine, with the exception of the {% url %} template tag. I'm getting a NoReverseMatch and can't…
user1102018
  • 4,369
  • 6
  • 26
  • 33
3
votes
2 answers

Adding url parameters in template using generic views in Django 1.5

I'm in the process of learning Django and currently I'm on a project following the Polls Tutorial loosely. Now I'm trying to convert to generic views and this is where I'm running into problems: news/models.py [...] class News(models.Model): id =…
weeheavy
  • 253
  • 3
  • 18
3
votes
1 answer

Django Groups not updating when saving User

I'm trying to add users that belong to staff to the staff group on change. I've tried it with signals and by overloading save in the User model but neither of them seem to work. Does django has any limitations I'm not aware of when saving? Here are…
2
votes
0 answers

Django forms to restrict chinese characters

I am using a form wizard for step-by-step forms in our django application. Now the requirement is to restrict chinese characters in the form fields. I managed to get the regex but the problem is if I try to use that validator regex on email field it…
Maverick
  • 2,738
  • 24
  • 91
  • 157
2
votes
0 answers

django sorl.thumbnail, no module named thumbnail.models

After activating the debug on sorl.thumbnail I got this error Error importing module thumbnails.models: "No module named thumbnails.models" and looking down on line 38 for the error callback I found this: 36 {% for article in object_list %} 37 …
Madox
  • 665
  • 1
  • 6
  • 14
2
votes
1 answer

Update to Django 1.7 with pip

I updated from Django 1.5.8 to 1.7: pip install Django==1.7 Downloading/unpacking Django==1.7 Downloading Django-1.7-py2.py3-none-any.whl (7.4MB): 7.4MB downloaded Installing collected packages: Django Found existing installation: Django 1.5.8 …
Thankyou
  • 159
  • 1
  • 3
  • 11