AttributeError at /admin/ when logging into the default Admin site.

2010-09-02 Thread daniel.osterme...@gmail.com
Hi, Ive been running into a problem lately (not sure when it started) where I receive an AttributeError when logging into the admin site. The circumstances seem to be that I start the application, go to the admin site (and log in successfully), navigate around the rest of the application (which

Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Mike Dewhirst
On 3/09/2010 2:16pm, Jesse wrote: I have django and postgres working on the local django server. I had to install psycopg2-2.2.2.win32-py2.7 in order for that to work. I don't believe I have access to an earlier version of psycopg. Are you using postgres? Yes but a different stack - python

Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Jesse
I have django and postgres working on the local django server. I had to install psycopg2-2.2.2.win32-py2.7 in order for that to work. I don't believe I have access to an earlier version of psycopg. Are you using postgres? Jesse On Sep 2, 5:41 pm, Mike Dewhirst wrote: >

Re: fetching values from model

2010-09-02 Thread Pradnya
ok Thanks. How about using Register tags. It's in Django.template.Library. Is it a good practice to use simple_tag? I want to know the plus points and drawbacks of simple_tag. On Sep 2, 8:52 pm, Justin Myers wrote: > In theory, if the view passed that function to the

Re: Multiple authentication sources to one database

2010-09-02 Thread Jeff Bell
Auth backends fail down the list of middleware. So I'm thinking something like this. Maybe, the users that you authenticate using LDAP or AD, append something to their username, like _xyzuser. johndoe has LDAP/AD password and logs in. AD_AUTH_Middleware succeeds with original username and

django model filter

2010-09-02 Thread spearsear
Account.objects.filter(balance__lt=20) selects accounts with balance less than $20 Account.objects.filter(balance__lt=jeff.balance) selects accounts with balance less than the balance of jeff's account Now, How do I do this? accounts with balance whose absolute value is greater than the

Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Mike Dewhirst
On 3/09/2010 7:46am, Jesse wrote: Hello Graham, I have the c:/public/apache/apache_django_wsgi.conf working now, at least apache restarts. Do you know if mod_wsgi has a problem with these versions: python 2.7 and apache 2.2, and postgres 8.4, psycopg 2.2.2 My server error is:

Re: ForeignKey, Index conflict going from 1.0 to 1.2

2010-09-02 Thread HiTekElvis
That's a huge help in understanding the underlying concepts. Thank you very much. While attempting to answer my question, you actually led me to the answer myself. I was trying to generate an index with South and that was raising the error. Essentially, I was trying to apply an index to a

Re: what to do instead of adding to Query.extra_where ?

2010-09-02 Thread Steve Holden
On 9/2/2010 1:44 AM, Paul Winkler wrote: > Hah. That was a pretty long message relative to how quickly I found > the answer myself :-p > Sorry for the noise. > > For posterity, extra(where=...) is indeed the solution. I overlooked > the obvious: > the class I was trying to fix is itself a

Re: ForeignKey, Index conflict going from 1.0 to 1.2

2010-09-02 Thread Russell Keith-Magee
On Fri, Sep 3, 2010 at 6:03 AM, HiTekElvis wrote: > Have a db that was generated under 1.0.  Hence, foreign keys in MySQL > have been named [tablename]_[fieldname]_id. A slight correction - foreign key *indexes* will be named like that; the fields themselves don't include

ForeignKey, Index conflict going from 1.0 to 1.2

2010-09-02 Thread HiTekElvis
Have a db that was generated under 1.0. Hence, foreign keys in MySQL have been named [tablename]_[fieldname]_id. However, when upgrading to 1.2, I tried to create an index on that field and got an error, because 1.2 names its foreign keys [tablename]_[hash] and its index keys

Customizing the login generic view with a custom backend

2010-09-02 Thread Steven L Smith
I've written a custom backend for Django auth to hook into our Active Directory. It works great, but some users can't seem to figure out that "username" does not equal "email address". Since our AD is kind of borked, multiple users *might* have the same email addresses, so simply changing it to

Re: Template syntax

2010-09-02 Thread Bill Freeman
Don't use [] subscripting, use dot. The template engine tries using the thing after the dot in various ways, including as a dictionary key and as a list index. So, for example: {% ifequal param1_trunc.i "-" %} On Thu, Sep 2, 2010 at 5:11 PM, Bradley Hintze

Re: how to add a non-field text property to forms in a formset

2010-09-02 Thread bobhaugen
I am so dense sometimes... I had forgotten that initial data in a formset is a *list* of dictionaries. So I set up the initial data in a loop over the available products, and created a parallel list of product_descriptions in the same loop. Then set up the formset, and looped over formset.forms

Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Jesse
Hello Graham, I have the c:/public/apache/apache_django_wsgi.conf working now, at least apache restarts. Do you know if mod_wsgi has a problem with these versions: python 2.7 and apache 2.2, and postgres 8.4, psycopg 2.2.2 My server error is: TemplateSyntaxError: Caught ImproperlyConfigured

Re: How is this feature called?

2010-09-02 Thread John M
So the example you gave of "other peoples" looks like they have a related table for "Service Checks" and that table has two fields, one for check and the other for options, from what I can tell. HTH J On Sep 1, 7:03 am, norus wrote: > Hi all, > > I've decided to start

Re: How to display many-to-many field as a list of text input fields?

2010-09-02 Thread Steve Holden
On 9/2/2010 4:27 PM, adelein wrote: > When I display the ToolBoxEditForm it uses a multiple select field. > But what I want is a form that lets the user edit each tool he has in > the toolbox as a text field. I cant figure out how to do this with the > many-to-many field. > A many-to-many

Template syntax

2010-09-02 Thread Bradley Hintze
Hi, Django says that this is a TemplateSyntaxError. if param1_trunc[i][1] The i refers to an index of a for loop as shown: {% for i in pdb1_nums_len_dev6 %} {% ifequal param1_trunc[i] '-' %} {% else %} {% if param1_trunc[i][1] %} {% else %}

Re: how to add a non-field text property to forms in a formset

2010-09-02 Thread bobhaugen
Bill, thanks a ton for the conversation. I will try some variations of that set of ideas over the weekend and report back here with what works. And you are correct, I am not now creating the formset forms in a loop, but might try that as one variation. -Bob -- You received this message

Re: how to add a non-field text property to forms in a formset

2010-09-02 Thread Bill Freeman
Well, if you can iterate the forms of a formset in the template, you can do it in python. I guess the trick is whether there is a public interface for accessing the model instance of the current form during such an iteration, (I'm assuming here that the fields you do want to use a fields comes

Re: Multiple authentication sources to one database

2010-09-02 Thread Shawn Milochik
You can use multiple authentication backends in the same Django project. All you have to do is write/install a backend that supports your alternative method, and add it to AUTHENTICATION_BACKENDS in your settings file. The info here should help a lot:

How to display many-to-many field as a list of text input fields?

2010-09-02 Thread adelein
When I display the ToolBoxEditForm it uses a multiple select field. But what I want is a form that lets the user edit each tool he has in the toolbox as a text field. I cant figure out how to do this with the many-to-many field. class Tool(models.Model): tool_name =

Re: how to add a non-field text property to forms in a formset

2010-09-02 Thread bobhaugen
On Sep 2, 2:54 pm, Bill Freeman wrote: > Let's start by agreeing on common terminology.  "property" has >  a meaning in Python slightly different than its usage in some > other languages, and I don't think that's what you mean. > > I'm thinking that what you mean by "property"

Re: how to add a non-field text property to forms in a formset

2010-09-02 Thread Bill Freeman
Let's start by agreeing on common terminology. "property" has a meaning in Python slightly different than its usage in some other languages, and I don't think that's what you mean. I'm thinking that what you mean by "property" on the form is what Python calls an attribute of the instance of the

Re: urls permalink error

2010-09-02 Thread Kev
Patricia wrote: > > > Hi all! > > I have a page with some years. I want to click over the year, for > instance 2000, to see all the information. > I've build some permalinks in other pages to built the URL, now I > wanted to do the same thing, but the field I wanted to connect is not > the year,

Re: how to add a non-field text property to forms in a formset

2010-09-02 Thread bobhaugen
Bill, Thanks a lot for sticking with this question. On Sep 2, 1:44 pm, Bill Freeman wrote: > I guess that what I'm saying is that when you get fussy about rendering, you > need to write the html/css yourself.  Because you say you want read only for > these fields, don't use

Re: Multiple django projects

2010-09-02 Thread Piotr Zalewa
On 09/02/10 17:12, commonzenpython wrote: > hey, guys > is it possible to have multiple django projects in one server ? > You can also make them using different django versions check django + virtualenv on google zalun -- blog http://piotr.zalewa.info jobs http://webdev.zalewa.info twit

Re: how to add a non-field text property to forms in a formset

2010-09-02 Thread Bill Freeman
I guess that what I'm saying is that when you get fussy about rendering, you need to write the html/css yourself. Because you say you want read only for these fields, don't use the form field's rendering at all (or use a hidden field). Compose a div or span or whatever suits your fancy, and pass

django-dbindexer for advanced queries with NoSQL

2010-09-02 Thread Waldemar Kornewald
Hi, we've started a new open-source project which extends Django's querying capabilities on NoSQL databases (App Engine, MongoDB, etc.), so you can use filters like "__month" or "__iexact" even if they're not natively supported by the database. The advantage is that you don't need to deal with

Passing view extra info from urls.py

2010-09-02 Thread r_f_d
I have looked at the django documentation and searched the group archive for my answer, and believe I know how this is supposed to work, I just cannot figure out why it is not working for me. I want to pass an extra keyword parameter to my view that contains a filter value, but it is not getting

Re: Multiple django projects

2010-09-02 Thread creecode
Hello, Yes you can have many Django projects installed on one server. On Sep 2, 9:12 am, commonzenpython wrote: > hey, guys > is it possible to have multiple django projects in one server ? Toodle-lo.. creecode -- You received this message because

Re: Multiple django projects

2010-09-02 Thread Max Countryman
Absolutely! :) On Sep 2, 2010, at 12:12 PM, commonzenpython wrote: hey, guys is it possible to have multiple django projects in one server ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Alternative to passing request object to every object/function?

2010-09-02 Thread Scott Gould
Have a read through this article, Dan: http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/ On Sep 2, 11:19 am, Dan Klaffenbach wrote: > On 2 Sep., 16:48, Daniel Roseman wrote:> It's not > clear exactly what you want. Using RequestContext

Multiple django projects

2010-09-02 Thread commonzenpython
hey, guys is it possible to have multiple django projects in one server ? -- 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 to

Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Jesse
Thanks! I did see the hello using the corrected localhost/myapp, so I at least know that I have the right version of mod_wsgi. Now I'm back to my original problem. The apache server will not restart when I add the following line to the http.conf file: Include

Re: fetching values from model

2010-09-02 Thread Justin Myers
In theory, if the view passed that function to the template (or if it were available as a method on something else that was passed to the template), I suppose you could. That said, you wouldn't be able to pass it any arguments. Once again, the template is _not_ designed for programming logic.

Re: I don't understand the difference between these two views

2010-09-02 Thread Karim Gorjux
On Thu, Sep 2, 2010 at 17:46, Daniel Roseman wrote: > See here for an explanation: > http://docs.djangoproject.com/en/1.2/ref/templates/api/#subclassing-context-requestcontext > especially the "Note" box a screen or so down. Thanks! Now everything is clear -- Karim Gojux

Re: Alternative to passing request object to every object/function?

2010-09-02 Thread Dan Klaffenbach
On 2 Sep., 16:48, Daniel Roseman wrote: > It's not clear exactly what you want. Using RequestContext and the > request context processor will ensure that the request is present in > all your templates. Is that enough? No. I'll give an example: I use a custom Acl class

Re: Where and how should I write translations

2010-09-02 Thread Tom Evans
On Thu, Sep 2, 2010 at 2:15 PM, Martin Tiršel wrote: > I tried to create second .po file with manual translations, but had no luck > either :( `compilemessages` creates the second .mo file, but doesn't use it > in the app. Only django.mo is used, but all my translations in

Setting a default value for a select widget in a modelformset

2010-09-02 Thread Steve McConville
We have a modelformset created like this: DocumentFormSet = modelformset_factory(Document, extra=0, fields=('name', 'category') with a models.py like this: class Category(models.Model): name = CharField(max_length=100) # other stuff class Document(models.Model): name =

Re: Alternative to passing request object to every object/function?

2010-09-02 Thread Daniel Roseman
On Sep 2, 3:30 pm, Daniel Klaffenbach wrote: > Hi, > > I am developing a Django app which relies on information from the > request object a lot, especially request.user. I need this object (or > let's say at least 'REMOTE_USER') in many models and I was wondering > if

Re: I don't understand the difference between these two views

2010-09-02 Thread Daniel Roseman
On Sep 2, 2:45 pm, Karim Gorjux wrote: > Working on the Coltrane's Book :-) ... > > I create two views that do the same thing but the first one use the > generic view and the second a render to response. > I don't understand why because both works but the second besides

Re: Alternative to passing request object to every object/function?

2010-09-02 Thread Tom Evans
On Thu, Sep 2, 2010 at 3:30 PM, Daniel Klaffenbach wrote: > Hi, > > I am developing a Django app which relies on information from the > request object a lot, especially request.user. I need this object (or > let's say at least 'REMOTE_USER') in many models and I was

Alternative to passing request object to every object/function?

2010-09-02 Thread Daniel Klaffenbach
Hi, I am developing a Django app which relies on information from the request object a lot, especially request.user. I need this object (or let's say at least 'REMOTE_USER') in many models and I was wondering if there is another way to get the request object? In PHP there is something like

I don't understand the difference between these two views

2010-09-02 Thread Karim Gorjux
Working on the Coltrane's Book :-) ... I create two views that do the same thing but the first one use the generic view and the second a render to response. I don't understand why because both works but the second besides don't passe the category object, don't load the

Models, nulls and default values confusion

2010-09-02 Thread Sells, Fred
I've got several tables like the one below, where I initialize it with "template" values that I copy when I create a new record. INSERT INTO A VALUES (19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '&', '&'), (20, 0, 0,

Re: Where and how should I write translations

2010-09-02 Thread Martin Tiršel
I tried to create second .po file with manual translations, but had no luck either :( `compilemessages` creates the second .mo file, but doesn't use it in the app. Only django.mo is used, but all my translations in django.po file are commented out after I run `makemessages`. In the

Re: PIL on 10.6 = PAIN

2010-09-02 Thread lukaszb
Hi, I'd strongly advise to try homebrew instead of macports. You can find it here: http://github.com/mxcl/homebrew . After installation do: brew up && brew install jpeg and install PIL as usual. Since I needed freetype support I had to update PIL's setup.py FEETYPE_ROOT: FREETYPE_ROOT =

Re: django-registration + e-mail confirmation

2010-09-02 Thread tom84
Thank You very much. Tomek On 2 Wrz, 14:45, Federico Maggi wrote: > wrote: > > How to open port 25 in ubuntu? > >     If you google for "mail ubuntu" or "smtp ubuntu" there is a nice > community doc/wiki explaining you all the steps for

Re: django-registration + e-mail confirmation

2010-09-02 Thread Federico Maggi
wrote: > How to open port 25 in ubuntu? If you google for "mail ubuntu" or "smtp ubuntu" there is a nice community doc/wiki explaining you all the steps for setting up an SMTP server on Ububtu. Otherwise, for testing purposes, you could use the debug mail

Re: multiple oracle database queries in one request problem

2010-09-02 Thread Reinout van Rees
On 09/01/2010 11:54 PM, Reinout van Rees wrote: On 09/01/2010 02:00 PM, Reinout van Rees wrote: Hi, I'm deploying a site on windows with oracle (and I don't know either of them well). Simple apache+wsgi setup for now. I'll have to test it out tomorrow when I'm near the windows machine again,

Re: django-registration + e-mail confirmation

2010-09-02 Thread tom84
I scanned ports of my IP using network tools and seems that only 45784 and 47344 are open. How to open port 25 in ubuntu? thanks Tomek On 2 Wrz, 14:28, Federico Maggi wrote: > On 02/set/2010, at 14:10, tom84 wrote: > > > Unfortunately after

Re: django-registration + e-mail confirmation

2010-09-02 Thread Federico Maggi
On 02/set/2010, at 14:10, tom84 wrote: > Unfortunately after sending filled registration form I received 111 > error- connection refused. Looks lice you're trying to connect to a closed/filtered port (25). Have you tested the SMTP outside Django (e.g., using

Re: django,how to read data from database when db has large volume of data

2010-09-02 Thread girish shabadimath
oh,,,thanks a lot for d reply,,, On Thu, Sep 2, 2010 at 4:33 PM, Daniel Roseman wrote: > On Sep 2, 9:49 am, girish shabadimath > wrote: > > actually i wanted to access values from database and use those values in > url > > unittesting,,, > >

django-registration + e-mail confirmation

2010-09-02 Thread tom84
Hello. I installed django-registration from http://bitbucket.org/ubernostrum/django-registration/downloads. Unfortunately after sending filled registration form I received 111 error- connection refused. I found somewhere that it may be because of the wrong server configuration, so I set some

AttributeError at /admin/ logging into the default Admin site.

2010-09-02 Thread daniel.osterme...@gmail.com
Hi, Ive been running into a problem lately (not sure when it started) where I receive an AttributeError when logging into the admin site. The circumstances seem to be that I start the application, go to the admin site (and log in successfully), navigate around the rest of the application (which

Where and how should I write translations

2010-09-02 Thread Martin Tiršel
Hello, I can not find in Django documentation a word about translating variables or strings with variables. I have: ... {% trans question_category %} ... django-admin.py makemessages creates .po but without a mention about this template line ({% trans "some text" %} is ok). It is clear,

Re: Extracting json data for parsing from HTTP GET

2010-09-02 Thread irum
Thank you so much, it worked:)...Now I just have to play with parsing json that I think I can manage. Thanks again:) Irum On Sep 2, 1:11 pm, Daniel Roseman wrote: > On Sep 2, 10:37 am, irum wrote: > > > > > Hi, > > Thanks for your prompt reply. >

Re: django,how to read data from database when db has large volume of data

2010-09-02 Thread Daniel Roseman
On Sep 2, 9:49 am, girish shabadimath wrote: > actually i wanted to access values from database and use those values in url > unittesting,,, > > like: > response = self.client.get('def/defect/', {'*ID*':*id*}) > self.failUnlessEqual(response.status_code, 200) > > how to

Re: django,how to read data from database when db has large volume of data

2010-09-02 Thread girish shabadimath
buddy did i convince u..?,,,reply soon...solution to my problem,, On Thu, Sep 2, 2010 at 2:19 PM, girish shabadimath wrote: > actually i wanted to access values from database and use those values in > url unittesting,,, > > like: > response =

Re: django,how to read data from database when db has large volume of data

2010-09-02 Thread girish shabadimath
actually i wanted to access values from database and use those values in url unittesting,,, like: response = self.client.get('def/defect/', {'*ID*':*id*}) self.failUnlessEqual(response.status_code, 200) how to get id from database..?,,,and also i want this test to be done for each id in

Re: Extracting json data for parsing from HTTP GET

2010-09-02 Thread Daniel Roseman
On Sep 2, 10:37 am, irum wrote: > Hi, > Thanks for your prompt reply. > I have tried both the things but I get the same error. > With, > x = json.loads(p.read()) >            print x > > I get following error:  'HttpResponse' object has no attribute > 'read' > Also I get

Re: Extracting json data for parsing from HTTP GET

2010-09-02 Thread irum
Hi, Thanks for your prompt reply. I have tried both the things but I get the same error. With, x = json.loads(p.read()) print x I get following error: 'HttpResponse' object has no attribute 'read' Also I get same error with, json.dumps(p.read()), and same when I use loads and dumps as

Re: Extracting json data for parsing from HTTP GET

2010-09-02 Thread Daniel Roseman
On Sep 2, 9:57 am, irum wrote: > Hi, > I am having problems with extracting json data  for parsing from HTTP > GET request. > > What I am doing is that I am receiving json data over HTTP via GET. > After debugging much, I have realized that the data also has HTTP > headers

Extracting json data for parsing from HTTP GET

2010-09-02 Thread irum
Hi, I am having problems with extracting json data for parsing from HTTP GET request. What I am doing is that I am receiving json data over HTTP via GET. After debugging much, I have realized that the data also has HTTP headers and other information that serializer is not able to deserialize.

Re: deserializing json

2010-09-02 Thread irum
Hi, Sorry for late reply. I had to switch to another project so this work got delayed. Actually, what I am doing is that I am receiving json data over HTTP via GET. After debugging much, I have realized that the data also has HTTP headers and other information that serializer is not able to

Django + Plugins howto?

2010-09-02 Thread onorua
Hello, I'm creating the system, which will rely on plugins. For instance, I have main application with model: class User(models.Model): ContractNum = models.PositiveIntegerField(unique=True, blank=True, null=True ) LastName = models.CharField(max_length=50) FirstName =

Re: django,how to read data from database when db has large volume of data

2010-09-02 Thread Daniel Roseman
On Sep 2, 8:17 am, girishmss wrote: >          Hi folks,im working on django project,,is there a way to access db > without using fixtures,, as fixtures is not working in my project,,i > want to test urls of type: > >                    /abc/xyz/123 where '123' comes

Re: Can't login to admin site

2010-09-02 Thread vgarvardt
On Sep 2, 6:58 am, Karen Tracey wrote: > On Wed, Sep 1, 2010 at 1:23 PM, vgarvardt wrote: > > Django 1.2.1 > > > Created new project, set DB settings (postgresql_psycopg2), > > MEDIA_ROOT, MEDIA_URL, TEMPLATE_DIRS, added django.contrib.admin to > >

Re: Can't login to admin site

2010-09-02 Thread vgarvardt
On Sep 2, 6:58 am, Karen Tracey wrote: > On Wed, Sep 1, 2010 at 1:23 PM, vgarvardt wrote: > > Django 1.2.1 > > > Created new project, set DB settings (postgresql_psycopg2), > > MEDIA_ROOT, MEDIA_URL, TEMPLATE_DIRS, added django.contrib.admin to > >

django,how to read data from database when db has large volume of data

2010-09-02 Thread girishmss
Hi folks,im working on django project,,is there a way to access db without using fixtures,, as fixtures is not working in my project,,i want to test urls of type: /abc/xyz/123 where '123' comes from database., and that database contains lots of ids(

Re: _unicode_ method not working?

2010-09-02 Thread Kevan Stannard
Thanks Yangmin I did notice that changes are picked up automatically, but this particular case the change did not show up automatically. It is my first time writing a django app to perhaps I did something wrong. Thanks for the feedback though. On Sep 2, 5:04 pm, Yangmin Li

Re: _unicode_ method not working?

2010-09-02 Thread Yangmin Li
if you are django's built-in development server, it will reload the changes after you've saved the changes. On Thu, Sep 2, 2010 at 12:42 PM, Kevan Stannard wrote: > I had the same problem going through the tutorial just now. I quit the > interpreter and restarted it

Re: Chat application in Django

2010-09-02 Thread Ivan Uemlianin
Dear Shamail As well as the resources already mentioned, I mention a few on this comment on a similar thread in May: http://groups.google.com/group/django-users/browse_thread/thread/6032003efcf2c2df/0575d5b54ecd5254#0575d5b54ecd5254 Hotdot (django, orbited and twisted) is good for realtime

Re: _unicode_ method not working?

2010-09-02 Thread Kevan Stannard
I had the same problem going through the tutorial just now. I quit the interpreter and restarted it and it seemed to pick up the changes. Anyone know a better way to reload changes? Thanks On Sep 2, 4:28 am, Erskine wrote: > Hi, > > I've just started using Django and