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
7
votes
1 answer

Foreign key as required field on Django 1.5 configurable user model, createsuperuser says: AttributeError: 'NoneType' object has no attribute '_state'

Using the new Configurable user model from Django 1.5 (1, 5, 0, 'beta', 2) I get this error while running manage.py createsuperuser trying to set a foreign key of a required field: AttributeError: 'NoneType' object has no attribute '_state' Since…
chirale
  • 1,659
  • 16
  • 20
6
votes
4 answers

Add custom html to choicefield label in django

I am struggling with a requirement now, I want to add an image to choice field label and I really dont have a clue how to do it. I am using django form wizard to render the form. Here is the image which shows what I want to achieve : And here is…
Maverick
  • 2,738
  • 24
  • 91
  • 157
6
votes
5 answers

Template Directory Path

I'm new to python. I'm using python 2.7.1 with django 1.5.1. When I put this code: TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] in my settings.py, the terminal shows the following error: File "/home/pipo/Desktop/mysite/mysite/settings.py",…
enadun
  • 3,107
  • 3
  • 31
  • 34
6
votes
2 answers

Python/Django 1.5 DatabaseWrapper thread error

Throwing the following DatabaseError in Django 1.5.1 (and 1.5.0) and mysql when I runserver and attempt to load a local version of the web app: DatabaseError at / DatabaseWrapper objects created in a thread can only be used in that same thread.…
daroo
  • 342
  • 4
  • 8
6
votes
2 answers

Can't perform data migrations using django 1.5 Custom user class

I have many applications with historic south initial migrations, which i wanted to convert to django 1.5 applicable. So i swapped out all orm['auth.User'] references in migration files with custom ones, but when i try to run those migrations i get…
tejinderss
  • 1,612
  • 17
  • 20
6
votes
4 answers

Custom user model in django does not allow setting password in admin

I have created a custom user model which I am successfully using within my app. The problem is that within the Admin, on the user edit screen, I get a display of the present password hash, instead of the very useful interface for setting the…
Krystian Cybulski
  • 10,789
  • 12
  • 67
  • 98
5
votes
1 answer

Access denied for user 'root'@'localhost' using password: NO

There are similar questions out there to this one, but I am not finding anything that is solving my issue. I am working on a django project and made a database change and want to migrate the database change to production. So I run python manage.py…
Matt Cremeens
  • 4,951
  • 7
  • 38
  • 67
5
votes
2 answers

Django Query sort case-insensitive using Model method with PostgreSQL

I'm really new to django, python and postgres... I can't seem to find the answer on how to order_by being case insensitive while using Model as the query method, only if you use direct SQL queries. Model @classmethod def get_channel_list(cls,…
Andrew
  • 4,443
  • 5
  • 33
  • 75
5
votes
3 answers

how to go to previous step without validating the form using form wizard

I have a multi step form which is built using sessionwizardview of django form wizard, I have added next and previous buttons, but the problem is, if I am in a step and when I click previous, it asks for the form to be filled up first and then could…
Maverick
  • 2,738
  • 24
  • 91
  • 157
5
votes
6 answers

Django ModelForm not saving data to database

A Django beginner here having a lot of trouble getting forms working. Yes I've worked through the tutorial and browsed the web a lot - what I have is mix of what I'm finding here and at other sites. I'm using Python 2.7 and Django 1.5. (although…
winwaed
  • 7,645
  • 6
  • 36
  • 81
5
votes
4 answers

Django Group By Weekday?

I'm using Django 1.5.1, Python 3.3.x, and can't use raw queries for this. Is there a way to get a QuerySet grouped by weekday, for a QuerySet that uses a date __range filter? I'm trying to group results by weekday, for a query that ranges between…
Zamphatta
  • 4,634
  • 8
  • 30
  • 34
5
votes
1 answer

django 1.5 update ALLOWED_HOSTS failing SuspiciousOperation

I have updated to django 1.5 and am getting the following message: SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): localhost:8000 I have tried localhost, 127.0.0.1, localhost:8000 in ALLOWED_HOSTS. I have also…
Mathew
  • 379
  • 2
  • 12
5
votes
1 answer

Django locale enabled app always returns 404 when debug is off

I've been developing an app that uses i18n/locale as url prefix in the root/landing page. I tried to deploy my application earlier for testing purposes with DEBUG=True and everything was working perfectly. If attempting to access domain.com it would…
Mo J. Mughrabi
  • 6,747
  • 16
  • 85
  • 143
5
votes
1 answer

Django Model is saved, but returns None

I have a simple model with a Model Manager: class CompanyReviewManager(models.Manager): def get_votes_for_company(self, company): try: return CompanyReview.objects.filter(user = user).count() except…
neurix
  • 4,126
  • 6
  • 46
  • 71
5
votes
2 answers

Django 1.5: Understanding of AbstractBaseUser and permissions

I created an user app MyUser which is an extension of AbstractBaseUser. I was under the impression that the model MyUser will replace the standard Auth.User, as long as it is mentioned in settings.py AUTH_PROFILE_MODULE = 'profile.MyUser' My trouble…
neurix
  • 4,126
  • 6
  • 46
  • 71