Re: How to find the version of Django?

2009-04-11 Thread Alex Gaynor
On Sun, Apr 12, 2009 at 2:38 AM, ydjango wrote: > > How do I find which version of django I have on my server? > > > import django; print django.VERSION That should have a tuple with the version info. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it."

How to find the version of Django?

2009-04-11 Thread ydjango
How do I find which version of django I have on my 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-users@googlegroups.com To unsubscribe from t

deletion of "distant" related objects

2009-04-11 Thread Margie
I am having some trouble with the deletion of related objects that are multiple levels away from the object being deleted. I've read a bunch of stuff written on deletion of related objects, but nothing on this particular problem - hoping someone can help. Say I have a model like this: class Pu

Re: Help! PNG file upload error...

2009-04-11 Thread higer
Thanks for your suggestion. But Python 2.5 already has zlib moudle. To png file,I wrote lines of code to save it first on disk and then handled the saved copy,then that works. I do not why there is some differencies between png file and file of other formats.The following is my code:

Re: unknown column in field list

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 18:56 -0700, nixon66 wrote: > I have a legacy database that I used inspectdb to create the models. > I cleaned up the models, set primary keys, foriegn keys etc. But when > I tried to create a view I get an "unknown column activity.fp_id_id > in field list". I'm not sure wh

unknown column in field list

2009-04-11 Thread nixon66
Forgot to add the view I'm using. def country_detail(request, country): c = Country.objects.get(slug=country) lobbyists = Activity.objects.filter(country=c) return render_to_response('country/country_detail.html', {'country':c, 'lobbyists':lobbyists}) --~--~-~--~~

Re: unknown column in field list

2009-04-11 Thread nixon66
oh, forgot to add the view I'm using. Here is the view. def country_detail(request, country): c = Country.objects.get(slug=country) lobbyists = Activity.objects.filter(country=c) return render_to_response('country/country_detail.html', {'country':c, 'lobbyists':lobbyists}) On Apr 11

unknown column in field list

2009-04-11 Thread nixon66
I have a legacy database that I used inspectdb to create the models. I cleaned up the models, set primary keys, foriegn keys etc. But when I tried to create a view I get an "unknown column activity.fp_id_id in field list". I'm not sure why its appending an extra id to the end of a foriegnkey fie

Re: UnpickleableError when sessions are saved

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 9:45 PM, Iqbal Abdullah wrote: > > Hi guys, > > In one of our views, we're getting the error below: > > Traceback (most recent call last): > File "/usr/lib/python2.5/site-packages/django/core/servers/ > basehttp.py", line 278, in run >self.result = application(self.env

UnpickleableError when sessions are saved

2009-04-11 Thread Iqbal Abdullah
Hi guys, In one of our views, we're getting the error below: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.5/site-packages/d

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 17:40 -0700, adelein wrote: > Hi Zain, > > The thing is that I was able to access the main page before I changed > the urls.py file, so I think that means that the port isnt being > blocked. Something to do with the urls.py file is messed up : ( Then go back and try things

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Hi Zain, The thing is that I was able to access the main page before I changed the urls.py file, so I think that means that the port isnt being blocked. Something to do with the urls.py file is messed up : ( Thanks On Apr 11, 5:35 pm, Zain Memon wrote: > Since no messages are shown in the log

Re: Admin in frontend

2009-04-11 Thread Marcello Parra
OK Malcom Thanks again... I will play some more with it. Marcello On 4/11/09, Malcolm Tredinnick wrote: > > On Sat, 2009-04-11 at 21:10 -0300, Marcello Parra wrote: >> Hello Malcom, >> >> Thanks for your help... >> I think of a frontend as the user part of the site... where I will >> provid

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Zain Memon
Since no messages are shown in the log, the connection is most likely being blocked somewhere upstream. Check that you've allowed port 8001 through any firewalls or routers you have set up. Zain On Sat, Apr 11, 2009 at 5:23 PM, adelein wrote: > > This is the server output: > > > [r...@bellatrix

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
This is the server output: [r...@bellatrix djangoblog]# python manage.py runserver 93.186.171.54:8001 Validating models... 0 errors found Django version 1.1 beta 1 SVN-10504, using settings 'djangoblog.settings' Development server is running at http://93.186.171.54:8001/ Quit the server with CO

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Yes, and I see no errors there. Still the admin page does not load at all. I cant find any similar problems through google. On Apr 11, 5:17 pm, Malcolm Tredinnick wrote: > On Sat, 2009-04-11 at 17:09 -0700, adelein wrote: > > > Hi, > > > Sorry, I meant to say urls.py of course. So, given I did p

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 17:09 -0700, adelein wrote: > > Hi, > > Sorry, I meant to say urls.py of course. So, given I did put the code > in the right file, the problem still remains. If you're following the tutorial, then you will be running the development server. So all "server log" style output

Re: Admin in frontend

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 21:10 -0300, Marcello Parra wrote: > Hello Malcom, > > Thanks for your help... > I think of a frontend as the user part of the site... where I will > provide users pages with proper layout and the admin site, is the one > provided by django admin where I would manage some ta

Re: Admin in frontend

2009-04-11 Thread Marcello Parra
Hello Malcom, Thanks for your help... I think of a frontend as the user part of the site... where I will provide users pages with proper layout and the admin site, is the one provided by django admin where I would manage some tables, with default django layout... You must consider that I very ne

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Hi, Sorry, I meant to say urls.py of course. So, given I did put the code in the right file, the problem still remains. -Adelein On Apr 11, 1:58 pm, Daniel Roseman wrote: > On Apr 11, 8:42 pm, adelein wrote: > > > > > Hi, > > > Myhttp://localhost:8000/adminpageis hanging in the django serv

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 7:24 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Sat, 2009-04-11 at 19:23 -0400, Alex Gaynor wrote: > [...] > > > > > > Even if your application is exclusively for your own usage, it's not > > uncommon for the pointy haired boss to come in with requests

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 19:23 -0400, Alex Gaynor wrote: [...] > > > Even if your application is exclusively for your own usage, it's not > uncommon for the pointy haired boss to come in with requests to change > a URL hierarchy, and there's no reason to create more work for > yourself. Wh

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 7:21 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Sat, 2009-04-11 at 17:49 -0500, James Bennett wrote: > > On Sat, Apr 11, 2009 at 5:13 PM, codecowboy wrote: > > > I've followed some examples from around the Django community and that > > > is why I use

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 17:49 -0500, James Bennett wrote: > On Sat, Apr 11, 2009 at 5:13 PM, codecowboy wrote: > > I've followed some examples from around the Django community and that > > is why I use the reverse() method at all. What is the point of using > > the reverse() method? > > Well, the

Re: Template filter with plural tag [Solved]

2009-04-11 Thread Kless
Thanks! It works as charm. On 11 abr, 22:54, Malcolm Tredinnick wrote: > Indeed, this is possible. You need to use a number for the counting > portion of the blocktrans-plural combination, so that gettext can use > the number to determine the plural form. The trick is that you use the > same va

Re: how to use email instead of username for user authentication?

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 07:52 -0700, pkenjora wrote: > Malcom, Well, I'm not "Malcom" (sic), but I'll reply anyway. >Google, FaceBook, and LinkedIn have been using email authentication > for how long now? With the default constraints you've put on Django a > developer would have to "work arou

Re: Template filter with plural tag

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 12:40 -0700, Kless wrote: > I would to pluralize into a translation block [1] but I also want to > apply the 'apnumber' template filter [2] > --- > {% load humanize %} > {% load i18n %} > > {% blocktrans count list|apnumber as number %} > There is {{ number }} object

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread James Bennett
On Sat, Apr 11, 2009 at 5:13 PM, codecowboy wrote: > I've followed some examples from around the Django community and that > is why I use the reverse() method at all.  What is the point of using > the reverse() method? Well, there's a problem you'll run into fairly often. Suppose, for example,

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Mike Ramirez
On Saturday 11 April 2009 03:13:18 pm codecowboy wrote: > What is the point of using the reverse() method? > I'm answering this because I want to make sure that my idea of it is the same as the rest of the community and would definately like feedback on it. Using this example: urlpatterns = pa

Re: Admin in frontend

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 11:51 -0300, Marcello Parra wrote: > Hello, > > I'm planning a site with django. > It need to have some functionalities that are very similar to Django's > admin (like CRUD in some tables, with validations, etc...). But I > would not like to have two sections (frontend and a

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread codecowboy
I've followed some examples from around the Django community and that is why I use the reverse() method at all. What is the point of using the reverse() method? On Apr 11, 5:03 pm, Daniel Roseman wrote: > On Apr 11, 7:57 pm, codecowboy wrote: > > > > > Every time that a load a form on my site,

Re: Port in use Error

2009-04-11 Thread rajeev
Hi, I'm in the exact same situation " Validating models... 0 errors found Django version 1.0.2 final, using settings 'mylu.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Error: That port is already in use. " but the solution above doesn't solv

Re: Cannot call a custom model method in my view

2009-04-11 Thread codecowboy
Thank you Daniel. I got it working. That link that you gave me helped me to figure it out. I'm curious though, is there ever a reason in Django to define a method in a model class or would I always use a custom manager method? I'm going to post my code here for anyone who has the same question

Re: Tutorial - include question

2009-04-11 Thread Johann Spies
2009/4/11 Alex Gaynor : > mysite/urls.py needs to have the full urlpatterns = thing like the > polls/urls.py has so it would look like: > > from django.conf.urls.defaults import * > > admin.autodiscover() > > urlpatterns = patterns('', > (r'^polls/', include('mysite.polls.urls')), > ) Thanks

Re: how to use email instead of username for user authentication?

2009-04-11 Thread Karen Tracey
On Sat, Apr 11, 2009 at 10:52 AM, pkenjora wrote: > > You are correct, username authentication has always been around. > However, the explicit banning and obfuscating of email authentication > in the default module has not. That is the part that worries me, that > is where things are going wron

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Daniel Roseman
On Apr 11, 7:57 pm, codecowboy wrote: > Every time that a load a form on my site, I see the following errors. > If I reload the page, they go away and everything works just fine. > Does anyone know why?  Thank you in advance. > > TemplateSyntaxError at /eaccounts/register/ > > Caught an exception

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Daniel Roseman
On Apr 11, 8:42 pm, adelein wrote: > Hi, > > Myhttp://localhost:8000/adminpage is hanging in the django server > and I get "Error 320 (net::ERR_INVALID_RESPONSE): Unknown error." > after a while. > > I am running on fedora 7. > > I am following the django tutorial and I am using the latest svn >

Re: Cannot call a custom model method in my view

2009-04-11 Thread Daniel Roseman
On Apr 11, 9:25 pm, codecowboy wrote: > I've read some other posts regarding this issue as well as the > following article:http://www.b-list.org/weblog/2007/nov/03/working-models/. > I cannot seem to get this thing to work.  Thank you in advance for any > help.  Here is my code. > > -- vi

Re: Tutorial - include question

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 4:16 PM, Johann Spies wrote: > > Working through the tutorial everything went well until I came to the > section "Decoupling the URLconfs" where > the "include" option for urls in a subdirectory is not working as > advertised. > > What did I do wrong? > > > In mysite/urls.p

Tutorial - include question

2009-04-11 Thread Johann Spies
Working through the tutorial everything went well until I came to the section "Decoupling the URLconfs" where the "include" option for urls in a subdirectory is not working as advertised. What did I do wrong? In mysite/urls.py I have: == from django.conf

Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Hi, My http://localhost:8000/admin page is hanging in the django server and I get "Error 320 (net::ERR_INVALID_RESPONSE): Unknown error." after a while. I am running on fedora 7. I am following the django tutorial and I am using the latest svn django version. After I set this in the settings.p

Cannot call a custom model method in my view

2009-04-11 Thread codecowboy
I've read some other posts regarding this issue as well as the following article: http://www.b-list.org/weblog/2007/nov/03/working-models/. I cannot seem to get this thing to work. Thank you in advance for any help. Here is my code. -- view -- from django.db.models import get_mo

Re: Admin Inlines astray

2009-04-11 Thread Andy Wilson
fixed after trying all sorts of approaches I finally got it to work by chmod'ing o+r to the files under the django/contrib/admin directory. Most of them already had read permissions but I could see that a few didn't. a On Sat, 2009-04-11 at 19:58 +0100, Andy Wilson wrote: > ps. I used the 'song

Template filter with plural tag

2009-04-11 Thread Kless
I would to pluralize into a translation block [1] but I also want to apply the 'apnumber' template filter [2] --- {% load humanize %} {% load i18n %} {% blocktrans count list|apnumber as number %} There is {{ number }} object. {% plural %} There are {{ number }} objects. {% endblocktrans

Re: "python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-11 Thread George
There is an explanation below, having to do with management dependencies and dates the versions and packages became available. But for the record, the solution is to install the py-sqlite3 package in addition to py-djangoi (with sqlite enabled). --George On Sat 11 Apr 2009 at 08:25:04 PM +0200,

Re: Generic relations swamp

2009-04-11 Thread zayatzz
I realise im kind of spamming here, but does nobody really has encountered similar problem? Alan. On Apr 11, 12:07 am, zayatzz wrote: > Ok, I did some search on web and i took closer look at the > errormessage. : > > Request information > GET > > No GET data > POST > Variable        Value > pol

Re: Multiple sites, single application in Django

2009-04-11 Thread creecode
Hello Russell, I can't say this is best practice but my approach to a similar goal has been to create projects for each website. These projects/websites are unrelated to each other as far as content goes but all install a common set of apps, some off the shelf, some custom. I have sites install

Re: Admin Inlines astray

2009-04-11 Thread Andy Wilson
ps. I used the 'song' and 'recording' models as an example, in fact I have several apps that use inlines, and on the one installation they are missing in every case. No errors are thrown and I can see nothing relevant in the logs. On Sat, 2009-04-11 at 19:50 +0100, Andy Wilson wrote: > has anyon

every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread codecowboy
Every time that a load a form on my site, I see the following errors. If I reload the page, they go away and everything works just fine. Does anyone know why? Thank you in advance. TemplateSyntaxError at /eaccounts/register/ Caught an exception while rendering: Tried edit in module conferences.

Admin Inlines astray

2009-04-11 Thread Andy Wilson
has anyone any idea why the inlines might go missing? I have a model 'song' and a model 'recording'. I've created a recordingInline class, and in the modelAdmin I set: inlines = [recordingInline] this all works fine on my Ubuntu installation running python 2.5.2 and django 1.0.2, but on another

Re: "python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-11 Thread George
Hi Karen, On Apr 8, 2:33 am, Karen Tracey wrote: > On Tue, Apr 7, 2009 at 8:39 PM, George wrote: > > > I'm pretty sure this shouldn't happen; but the error is no doubt my > > fault. Maybe something about the doc doesn't apply to my system? I > > have pkgsrc python2.5 and Django 1.0.2 > > What s

Fewer columns in admin popups

2009-04-11 Thread Dave Benjamin
Hello, In the Django admin site, I find myself going back and forth between adding more columns to list_display to enhance the list view and then removing them when I realize that they make the list view too big for the popup version displayed when clicking on the add button or the raw_id_fields

Re: Generic relations and unit tests.

2009-04-11 Thread Stavros
I agree with you on this, but it is often impractical due to the volume of the data required. I have this data already in my database, I shouldn't have to spend a few days moving it to the tests file... Fixtures are a quick way to import your data to the test DB without having to recreate everythi

Re: Registration form and Profile form is not saving

2009-04-11 Thread Daniel Roseman
On Apr 11, 3:55 pm, Praveen wrote: > Hi all, i am really fed up and have tried number of way. Please read > my last line which really describe where i am facing problem. > First Attempt. > Problem:Data is saving for register and contact but for profile i get > error > ValueError > Exception Va

Multiple sites, single application in Django

2009-04-11 Thread Russell McConnachie
Hello, I am new to Django, I've been reading over the Django "Sites" Model framework but I still have not come up with a creative way to design a site which hosts multiple sites - providing different html layouts, style sheets. I am looking for someone to kind of explain to me some best practices

Registration form and Profile form is not saving

2009-04-11 Thread Praveen
Hi all, i am really fed up and have tried number of way. Please read my last line which really describe where i am facing problem. First Attempt. models.py - class UserProfile(models.Model): user = models.ForeignKey(User, unique=True, verbose_name=_ ('user')) gender = models.Ch

Re: how to use email instead of username for user authentication?

2009-04-11 Thread pkenjora
Malcom, Google, FaceBook, and LinkedIn have been using email authentication for how long now? With the default constraints you've put on Django a developer would have to "work around" the out of the box code to make the project behave like the big 3 names on the web. In this light it sounds

Admin in frontend

2009-04-11 Thread Marcello Parra
Hello, I'm planning a site with django. It need to have some functionalities that are very similar to Django's admin (like CRUD in some tables, with validations, etc...). But I would not like to have two sections (frontend and admin) in it So, my question is: is there a way to use already ma

[ANN] Falcon - powering innovation

2009-04-11 Thread Kless
If anybody is interesed in new technologies, you'll love this new language called Falcon [1], which has been open sourced ago little time. Falcon is a scripting engine ready to empower mission-critical multithreaded applications. It provides six integrated programming paradigms: procedural, objec

Re: PyTwitter Module

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 06:09 -0700, nitr...@gmail.com wrote: > I'm using the pytwitter module written by Niall Sheridan http://www.evil.ie/ [...] There doesn't seem to be anything Django related in this post. Please help us keep things on-topic here -- it's high enough volume already. Regards, Ma

Schema-less models

2009-04-11 Thread Dmitry Kuchin
In the project I'm working on it makes a lot of sense to store pretty much everything in 1-2 models, as there are a lot of common operations being done on any object or property - moderation, versioning, etc. I wanted to have something similar to this approach: http://bret.appspot.com/entry/how-fr

PyTwitter Module

2009-04-11 Thread nitr...@gmail.com
I'm using the pytwitter module written by Niall Sheridan http://www.evil.ie/ I understand the logic within this module that it basically calls the url that the twitter api uses, I'm trying to call the statuses/mentions method from the api. statuses/mentions Returns the 20 most recent mentions

Re: Default mimetype

2009-04-11 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 23:40 -0700, Roman Timushev wrote: > Hello, > > My application serves content with different mimetypes: 'application/ > xhtml+xml', 'application/xml', 'application/json'. Specifying mimetype > for every view is not DRY. Is it possible to define default mimetype > for url gro

Re: Easy way to create pretty pages with nav?

2009-04-11 Thread Konrad Martin
Hi I think a 'problem' of Django is that it is produced by programmers and doesn`t mention that programming is the minor important part of a successfull site. Far more important is content and the visual way content is presented in a brain catching way to the customer. Both isn`t comprised in

Re: Foreign Key query question

2009-04-11 Thread nikita kozlovsky
On Apr 11, 12:32 pm, Malcolm Tredinnick wrote: > That's definitely a small bug, then. I've opened ticket #10790 so that > it gets fixed eventually. Since it's not a functionality bug (the answer > is still correct), it will be fixed after 1.1 now, but we will fix it. I > understand why it's occ

Re: Default mimetype

2009-04-11 Thread Alex Koshelev
There is no such capabilities. Write your own set of decorators that will be path response object with needed mimetype - almost DRY solution. On Sat, Apr 11, 2009 at 10:40 AM, Roman Timushev wrote: > > Hello, > > My application serves content with different mimetypes: 'application/ > xhtml+xml'

Re: Modifying the User model

2009-04-11 Thread Davide
That's the workaround we were about to implement. But what I was searching for, was a more consistent way to modify the **model** itself (which will be reflected into the database structure and consequently in the forms), not the way Django handles the forms. I think Django choice isn't so silly,

Default mimetype

2009-04-11 Thread Roman Timushev
Hello, My application serves content with different mimetypes: 'application/ xhtml+xml', 'application/xml', 'application/json'. Specifying mimetype for every view is not DRY. Is it possible to define default mimetype for url groups? Roman --~--~-~--~~~---~--~~ Yo

Re: Foreign Key query question

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 01:02 -0700, nikita kozlovsky wrote: > On Apr 11, 3:11 am, Malcolm Tredinnick > wrote: > > > > Django's SQL is going exactly what you suspect and not using any outer > > join here. Using a simplified version of the original two models: > > > > class Student(models.

Re: How to keep the translations for the templates from different applications separately?

2009-04-11 Thread Valery
for those who is interested, the issue is solved: http://groups.google.com/group/pinax-users/browse_thread/thread/58d45dab96840ee5/0f62760ab5223b2e regards valery On Apr 7, 8:27 pm, Valery wrote: > Hi > > no answers... does it mean that it is impossible in Django to separate > the template tran

Re: Foreign Key query question

2009-04-11 Thread nikita kozlovsky
On Apr 11, 3:11 am, Malcolm Tredinnick wrote: > Django's SQL is going exactly what you suspect and not using any outer > join here. Using a simplified version of the original two models: > >         class Student(models.Model): >            ... > >         class Message(models.Model): >