Show HTML in Labels for Model Choice Fields

2010-12-30 Thread Adi
Hi I have a situation like this class AppearanceThemesForm(forms.Form): page_theme = forms.ModelChoiceField(widget=forms.RadioSelect(attrs={'title':'Select the appropriate theme for your pages.'}), queryset=Theme.objects.filter(section="1"),

Sorry -- Re: Django not seeing AuthenticationMiddleware for some reason ...

2010-12-30 Thread Stephen Waterbury
Sorry for the repeats! I was already a member of the group from another email address, but Google kept sending me bounce messages even after I joined from this address and resent -- then all 3 copies came at once ... oops. :( Steve -- You received this message because you are subscribed to

Django not seeing AuthenticationMiddleware for some reason ...

2010-12-30 Thread Stephen Waterbury
I am baffled, and it's probably something simple I'm missing ... I just need to send a message for help and then I'll see it ... (maybe ... ;) My set up: * apache2 on Ubuntu 10.04 * mod_wsgi 3.3, compiled with python 2.6.5 (the system python) (but Ubuntu's mod_wsgi package was apparently not

Re: Caught NoReverseMatch while rendering:Reverse for 'index' with arguments '()' and keyword arguments '{}' not found.

2010-12-30 Thread Bartolomé Sánchez
Message error tells that you are trying to reach "index" url, which doesn't exists. Maybe you are calling "index" url instead of "login". 2010/12/30 aaron > Any idea what this means? > > The URL entry is as per the django tutorial as: > > (r'^login/$',

Caught NoReverseMatch while rendering:Reverse for 'index' with arguments '()' and keyword arguments '{}' not found.

2010-12-30 Thread aaron
Any idea what this means? The URL entry is as per the django tutorial as: (r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'registration/login.html'}), And in my settings.py file I specify LOGIN_URL = 'login/' cheers, A -- You received this message because you are

Re: ModelForm validation in 1.2.3

2010-12-30 Thread Burhan
The question is how do I get the modelform to only check for form validity, and not model validity (like it did before). I don't see what your link has to do with that. On Dec 30, 7:32 pm, Ferran wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > On 30/12/10 17:25,

Re: django using wrong python???

2010-12-30 Thread Graham Dumpleton
Are you having this problem with Django development server, or with a production type hosting setup such as mod_wsgi? Need to know which. Graham On Friday, December 31, 2010 1:34:22 AM UTC+11, yelbuke wrote: > > Hi, > > I'm on centos and have two pythons 2.5 and 2.6. > > I tried in models.py:

ModelForm and checkbox from choices

2010-12-30 Thread robos85
In my model i have that part: ... STATUSES_CHOICES = ( (0, _(u'one')), (1, _(u'two')), (2, _(u'three')) ) ... status = models.SmallIntegerField(default=0, choices=STATUSES_CHOICES, null=True, blank=True) then in my form based on that model I wanto to make

Re: Attempting to save instance with null ID?

2010-12-30 Thread W. Craig Trader
Jonathan ... The problem is in the difference in SQLite and Oracle. Unlike MySQL, PostgresQL, and SQLIte, Oracle doesn't have auto-generated primary keys. To make up for that, Django on Oracle uses a trigger for each Django-managed table that recognizes a NULL primary key on insert, and

Re: User authentication in Django

2010-12-30 Thread aaron
According to the docs you just need to add {% csrf_token %} to each form. sorry for the noise. On Dec 30, 5:15 pm, aaron wrote: > okay, so I added a url directing accounts/login requests to a view > which in turn directs it to the login.html template suggested at > >

Re: ModelForm validation

2010-12-30 Thread Axel Bock
Ah :) . I should have thought of that ... pretty stupid of me :) Thanks for the clarification, I'll try that, makes perfect sense! /Axel. 2010/12/30 derek > Alex > > And I seem to have been equally unclear :} > > I agree that cleaned_data is only available after

Re: De-coupling settings.py from project

2010-12-30 Thread Christophe Pettus
On Dec 30, 2010, at 8:50 AM, eblume wrote: > Is there a way to specify settings like STATIC_URL or FIXTURES_DIRS > per-application rather than per-site? Even better - is there a > mechanism to use a settings.py file in the application rather than in > the site? I think that your overall goal is

Re: User authentication in Django

2010-12-30 Thread aaron
Okay, that problem is fixed. I just added the /accounts/login to the url file. New problem: my login page is giving me: CSRF verification failed. Request aborted This is the html from login.html {% block content %} {% if form.errors %} Sorry, that's not a valid username or password

Re: User authentication in Django

2010-12-30 Thread aaron
okay, so I added a url directing accounts/login requests to a view which in turn directs it to the login.html template suggested at http://docs.djangoproject.com/en/dev/topics/auth/ Which is: {% extends "base.html" %} {% load url from future %} {% block content %} {% if form.errors %} Your

De-coupling settings.py from project

2010-12-30 Thread eblume
I'm new to Django and trying to create an office intranet web service. Because I value pragmatic programming, I want to take the time to 'do it right' and so I'm spending as much time as possible de-coupling the 'django application' from the 'django project' (or 'django site' - these seem to be

User authentication in Django

2010-12-30 Thread aaron
Hi guys, I'm attempting to follow the very simple setup for user authentication in Django as detailed in the documentation here: http://docs.djangoproject.com/en/dev/topics/auth/ I've got a database synced, the apps installed as detailed, but when I attempt to access a password protected url it

Re: ModelForm validation in 1.2.3

2010-12-30 Thread Ferran
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 30/12/10 17:25, Burhan wrote: > In 1.2.3, this logic always fails because "is_clean()" fails if an > existing customer enter's their email address. How can I do the same > using django 1.2.3? http://docs.python.org/tutorial/errors.html

ModelForm validation in 1.2.3

2010-12-30 Thread Burhan
Hello: In 1.2 ModelForm validation was changed so that not only does it check the form validation, but it does validation of the model as well. I have a model that has custom validation for one of its fields, which should be unique in the table. Now I have a front end form, created by

Attempting to save instance with null ID?

2010-12-30 Thread Jonathan Hayward
I'm migrating from SQLite to Oracle, and I'm getting an error thrown on the line disn_requisition.save() claiming that it has a null ID. I have not attempted to manually set or fiddle with id fields on any model, although I do read them. Any insight on what I need to do to address this?

Re: django using wrong python???

2010-12-30 Thread Alvaro Mouriño
2010/12/30 ozgur yilmaz : > I have Centos, and it comes with python2.4(sorry, not 2.5). I installed > python2.6 and django is under: I work with CentOS too but installing different python versions in parallel seemed like a lot of unnecessary work to maintain. So I developed

Re: Linux password authentication for django

2010-12-30 Thread Marc Aymerich
On Thu, Dec 30, 2010 at 4:41 PM, Marc Aymerich wrote: > > > On Thu, Dec 30, 2010 at 4:24 PM, Marc Aymerich wrote: > >> >> >> On Thu, Dec 30, 2010 at 6:35 AM, Bill wrote: >> >>> Hi there, >>> >>> I want to know is there any

Re: ModelForm validation

2010-12-30 Thread derek
Alex And I seem to have been equally unclear :} I agree that cleaned_data is only available after is_valid() - the point being that your form *will* be valid if you have set the value for that field in a hidden input. I do not see that this can be a "security risk" - the default that you are

Re: Linux password authentication for django

2010-12-30 Thread Marc Aymerich
On Thu, Dec 30, 2010 at 4:24 PM, Marc Aymerich wrote: > > > On Thu, Dec 30, 2010 at 6:35 AM, Bill wrote: > >> Hi there, >> >> I want to know is there any authentication module base on Linux passwd/ >> shadow file for django? >> > >

Re: Linux password authentication for django

2010-12-30 Thread Marc Aymerich
On Thu, Dec 30, 2010 at 6:35 AM, Bill wrote: > Hi there, > > I want to know is there any authentication module base on Linux passwd/ > shadow file for django? > http://atlee.ca/software/pam/module-index.html import pam from django.contrib.auth.models import User class

Re: django using wrong python???

2010-12-30 Thread smallfish
you can try ln -s python2.6 to default python, and then modify the yum script to python2.4. -- blog: http://chenxiaoyu.org On Thu, Dec 30, 2010 at 10:53 PM, ozgur yilmaz wrote: > I have Centos, and it comes with python2.4(sorry, not 2.5). I installed > python2.6 and django

Re: django using wrong python???

2010-12-30 Thread ozgur yilmaz
I have Centos, and it comes with python2.4(sorry, not 2.5). I installed python2.6 and django is under: /usr/lib/python2.4/site-packages/django /usr/lib/python2.6/site-packages/django i defined alias in bash_profile, so when i give "python" command from shell, python2.6 works... 2010/12/30

Re: django using wrong python???

2010-12-30 Thread Robbington
Why/how have you two versions of Python installed? Where is Django installed? Rob -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email

django using wrong python???

2010-12-30 Thread ozgur yilmaz
Hi, I'm on centos and have two pythons 2.5 and 2.6. I tried in models.py: from fractions import Fraction and got the error: No module named fractions But when i use shell and type "from fractions import Fraction" it's OK, it uses python2.6 installation. How can i modify django installation

Re: django test framework with no models.py

2010-12-30 Thread Seth Gordon
On 12/27/2010 09:58 AM, Henrik Genssen wrote: > Hi, > > I wanted to write a test for an app, that does not have a models.py itself. > Doing so I get: > django.core.exceptions.ImproperlyConfigured: App with label service could not > be found > > if I create a models.py with just a "pass" in it

Re: django and eclipse

2010-12-30 Thread CrabbyPete
You have to set up the run environment. Make sure on run manage.py and the parameters are runserver x.x.x.x:000 where x.x.x.x is the server and :000 is the port you want to run from. After that it should not ask anything and run off your settings. On Dec 29, 7:38 pm, Emmanuel Mayssat

Re: database migration

2010-12-30 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > Hallöchen! > > Michael P. Soulier writes: > >> On 29/12/10 Torsten Bronger said: >> >>> I don't recommend that. If the database exceeds a certain size >>> (and "certain" is MBs, not GBs), this simply fails. >> >> Is there a bug report for this issue? I find

Re: database migration

2010-12-30 Thread Ferran
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 30/12/10 13:17, Torsten Bronger wrote: >> Is there a bug report for this issue? I find that very >> > disappointing. > http://1.2.3.12/bmi/stc.celeb.gate.cc/banner/pi/0120.gif What i found disappointing is sending a NSFW image to a django list

Re: database migration

2010-12-30 Thread Torsten Bronger
Hallöchen! Michael P. Soulier writes: > On 29/12/10 Torsten Bronger said: > >> I don't recommend that. If the database exceeds a certain size >> (and "certain" is MBs, not GBs), this simply fails. > > Is there a bug report for this issue? I find that very > disappointing.

Re: Linux password authentication for django

2010-12-30 Thread Michael P. Soulier
On 29/12/10 Bill said: > Hi there, > > I want to know is there any authentication module base on Linux passwd/ > shadow file for django? You want pam authentication. Look for django and pam. Mike signature.asc Description: Digital signature

OpenID Provider

2010-12-30 Thread antoniofcano
Hello, I'm trying to setting up an OpenID provider for an application that I wrote using Django. For this task I use the django_openid_provider (http://www.romke.net/django/openid_provider/) app. After installing, syncdb of the ddbb, associate an user with his openid... the truth moment comes

Re: django and eclipse

2010-12-30 Thread Rajendra Waghmare
To run Django server on specific IP and port you can use following command: python manage.py runserver : e.g. python manage.py runserver 11.12.13.145:5678 If you do not specify IP and the port it starts on localhost(127.0.0.1) and port 8000. If you are using command prompt and do not want to

Getting model instances from cursor fetches

2010-12-30 Thread Viktor Kojouharov
Hello, I have a stored procedure which creates a cursor for a query, and also returns the total count for the (unlimited) query. The query itself can be mapped to my model if ran through the raw method of the manager. However, I'm interested in using the procedure, rather than 2 separate