Re: Django, CherryPy and threading

2007-08-28 Thread Graham Dumpleton
On Aug 29, 11:51 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 8/28/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > ... > > > Most importantly, you should rigorously test your application to > > ensure that it is truly safe to use in a multithreaded web server. > > Areas which I would

django under 2.5

2007-08-28 Thread Alvaro Mouriño
Hi list, I have been running django under python 2.4 but now I'm considering switching to 2.5. Are there any known compatibility issues? Or is it just straightforward? Thanks, AlvAro "You can't change the world, but you can change your mind." Software Libre: El conocimiento no puede tener

Re: UnicodeDecodeError with memcache

2007-08-28 Thread Jeremy Dunck
On 8/28/07, patrickk <[EMAIL PROTECTED]> wrote: > > additional information: > I just checked the default encoding > > >>> import sys > >>> sys.getdefaultencoding() > 'ascii' > > should that be something different (like utf-8)? > btw: all our data (database) and scripts are encoded with utf-8.

Re: UnicodeDecodeError with memcache

2007-08-28 Thread Jeremy Dunck
On 8/27/07, patrickk <[EMAIL PROTECTED]> wrote: > > With using the cache_page decorator, I´m getting a Unicode Error on my > page: > > UnicodeDecodeError at /spezialprogramme/ > 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in > range(128) > patrickk, please give your whole

Re: UnicodeDecodeError with memcache

2007-08-28 Thread Iapain
What middleware you are using .. any external middleware? On Aug 28, 12:27 pm, patrickk <[EMAIL PROTECTED]> wrote: > why prefer latin1 over utf-8 (in settings.py)? > > On 28 Aug., 09:12, Iapain <[EMAIL PROTECTED]> wrote: > > > > >>> import sys > > > >>> sys.getdefaultencoding() > > > > 'ascii' >

Re: Choices cannot be marked for translation?

2007-08-28 Thread Kenneth Gonsalves
On 28-Aug-07, at 9:55 PM, Chris Hoeppner wrote: >> when i upgraded to the latest svn head, I found that all the places >> in admin that had drop downs for choices were blank. I had always >> marked my choices for translation like so: >> >> article_type = ( >> ("NW", _("News")), >>

Re: Django, CherryPy and threading

2007-08-28 Thread Jeremy Dunck
On 8/28/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: ... > Most importantly, you should rigorously test your application to > ensure that it is truly safe to use in a multithreaded web server. > Areas which I would suggest you look at closely are use of session > objects as these from memory

Do you like playing games?

2007-08-28 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL

Re: Django suddenly loses DJANGO_SETTINGS_MODULE running locally

2007-08-28 Thread Rob Hudson
I didn't dig deeper last night because I was "getting things done" and it was easier to just export the environment and move on. Looking harder at the traceback I noticed it was getting hung up on my putting stuff in the project's __init__.py file which was importing things from Django. It

Re: Django suddenly loses DJANGO_SETTINGS_MODULE running locally

2007-08-28 Thread Graham Dumpleton
The OP isn't talking about Apache but using inbuilt Django server using manage.py. :-) The OP should really post the full traceback and messages there are getting so it can be seen whether they are interpreting it correctly. Information in the details may also be helpful to people in working out

Re: Django, CherryPy and threading

2007-08-28 Thread Graham Dumpleton
On Aug 29, 1:39 am, Justin Johnson <[EMAIL PROTECTED]> wrote: > I've managed to get Django working nicely with CherryPy using WSGI. > Previously I've deployed Django with Apache and ModPython where each > requested is serviced by a separate Python instance. How you think mod_python works is

Re: Django Development Position

2007-08-28 Thread Chris Hoeppner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > I forgot to mention that this position is located in New York, NY and > applicants must be US citizens with no criminal history. What a shame. You were talking just about me, but I don't meet the US citizen thing. We'll talk when you think about

Re: QuerySet & memory

2007-08-28 Thread Jeremy Dunck
On 8/28/07, Tomas Kopecek <[EMAIL PROTECTED]> wrote: ... > For me it could be more appropriate to change iterator() to do some > slicing for me (by explicit LIMIT clause), maybe a small patch for our > application. I understand, that changing it in general would be a bad > design decision. Ick.

Re: Django Development Position

2007-08-28 Thread David Sonenberg
I forgot to mention that this position is located in New York, NY and applicants must be US citizens with no criminal history. On Aug 28, 4:25 pm, David Sonenberg <[EMAIL PROTECTED]> wrote: > The Developer will primarily be responsible for performing development > tasks relating to the firm's

Error adding DateField - 'unicode' object has no attribute 'strftime'

2007-08-28 Thread Greg
Hello, I have the following code in my models.py file class Orders(models.Model): timestamp = models.DateField() ... etc / I have the following in my view.py function from datetime import datetime o = Orders() o.timestamp = datetime.now() ... etc o.save()

Django Development Position

2007-08-28 Thread David Sonenberg
The Developer will primarily be responsible for performing development tasks relating to the firm's intranet system including bug fixes, documentation, and feature development. The Developer will also be responsible for managing smaller projects to support internal systems, external web sites,

Re: Django, CherryPy and threading

2007-08-28 Thread Joseph Heck
You get to decide the version of "safe" - i've done something similiar with a little REST queuing app and run it up to fairly significant loads without issue. -joe On 8/28/07, Justin Johnson <[EMAIL PROTECTED]> wrote: > > > I've managed to get Django working nicely with CherryPy using WSGI. >

Re: Image manipulation

2007-08-28 Thread Chris Hoeppner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 SlavaSh escribió: > I need to add dynamic text to animated GIF images. > What is a best way to do it? > > Thanks. Using the PIL (Python Imaging Library) :) -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with

Image manipulation

2007-08-28 Thread SlavaSh
I need to add dynamic text to animated GIF images. What is a best way to do it? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: second query question

2007-08-28 Thread Tim Chase
> class Property(models.Model): > > thing = models.ForeignKey(Thing) > property_type = models.ForeignKey(PropertyType) > value = models.CharField(...) > ... > > I want to find, for a given PropertyType, all the Things that are > lacking any Property of that type. > >

What's this mean? 'module' object has no attribute 'TagField'

2007-08-28 Thread Austin Govella
Trying to install django-tagging. I put a copy of the tagging directory in my project folder: MyProject/ App1/ App2/ Tagging/ I ran tagging's setup.py from a separate directory outside of my project folder. Syncdb created tag and tagged_item tables. I added TagField to a model: tag

Re: second query question

2007-08-28 Thread r_f_d
I believe it would be: Thing.objects.all().exclude(property__property_type__exact = type).distinct() -rfd On Aug 28, 12:24 pm, James Tauber <[EMAIL PROTECTED]> wrote: > There's another query I want to do that I can't seem to wrap my head > around at the moment: > > Say I have a model where

Re: QuerySet & memory

2007-08-28 Thread Tomas Kopecek
James Bennett napsal(a): > On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: >> QuerySet.iterator does what you want. > > I was going to follow up with a documentation link, but it appears we > lost the documentation for QuerySet.iterator at some point. Opened a > ticket > > In any case,

second query question

2007-08-28 Thread James Tauber
There's another query I want to do that I can't seem to wrap my head around at the moment: Say I have a model where Things have Properties each of a particular PropertyType. So class Property(models.Model): thing = models.ForeignKey(Thing) property_type =

Re: What's this mean? 'module' object has no attribute 'TagField'

2007-08-28 Thread jake
hi austin, Austin Govella wrote: > tag = models.TagField() > > When I saved the model, the server validated the models and gives me > an error: > * 'module' object has no attribute 'TagField' you're just addressing TagField at the wrong module; it's not part of django's 'models' module but

What's this mean? 'module' object has no attribute 'TagField'

2007-08-28 Thread Austin Govella
Trying to install django-tagging. I put a copy of the tagging directory in my project folder: MyProject/ App1/ App2/ Tagging/ I ran tagging's setup.py from a separate directory outside of my project folder. Syncdb created tag and tagged_item tables. I added TagField to a model: tag

Re: Lighttpd advice please

2007-08-28 Thread mamcxyz
The best can be get vmware, download that version of linux and play locally. Trust me, for newbiews this can be very hard... also that version of linux is hard to setup than a debian one. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: dynamic links

2007-08-28 Thread jake
hi rufman, Rufman wrote: > def get_absolute_url(self): > return > urlresolvers.reverse('pyOrganize.pyworkbook.views.bullet.viewBullets', > kwargs={'day_id': self.fk_day, > 'rubric_id': self.fk_rubric}) just a guess - if self.fk_day is a ForeignKey

Re: Choices cannot be marked for translation?

2007-08-28 Thread Chris Hoeppner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kenneth Gonsalves escribió: > hi, > > when i upgraded to the latest svn head, I found that all the places > in admin that had drop downs for choices were blank. I had always > marked my choices for translation like so: > > article_type = ( >

Re: Django suddenly loses DJANGO_SETTINGS_MODULE running locally

2007-08-28 Thread Rob Hudson
On Aug 28, 8:49 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > manage.py just tries to import the settings module directly; it > basically assumes that '.' is on your sys.path, that "settings" is the > name of your settings module, and that the current working directory > contains the settings

Re: Django suddenly loses DJANGO_SETTINGS_MODULE running locally

2007-08-28 Thread TheMaTrIx
This is why, eventhough its noted in the docs as optional, I add the pythonpath to my site in the apache vhosts file by default. Adding the path globally isn't really a good thing to do but adding it whenever your webserver starts the site its needed for, even if its already defined somewhere

Re: Django suddenly loses DJANGO_SETTINGS_MODULE running locally

2007-08-28 Thread Jeremy Dunck
On 8/28/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > Has anyone else noticed this? Isn't "./manage.py" supposed to set up > the settings module correctly? manage.py just tries to import the settings module directly; it basically assumes that '.' is on your sys.path, that "settings" is the name

Re: modpython and python2.5

2007-08-28 Thread TheMaTrIx
mod_python needs to be compiled against the python version your using. On windows mod_python even trows errors in the logfile (although it still functions) when you use the mod_python for python 2.5, while your using python 2.5.1. On Aug 28, 1:48 pm, Leandro Zanuz <[EMAIL PROTECTED]> wrote: >

Django, CherryPy and threading

2007-08-28 Thread Justin Johnson
I've managed to get Django working nicely with CherryPy using WSGI. Previously I've deployed Django with Apache and ModPython where each requested is serviced by a separate Python instance. This isn't the case with CherryPy though as it's thread based which leads me to the following

Django suddenly loses DJANGO_SETTINGS_MODULE running locally

2007-08-28 Thread Rob Hudson
I've had this happen a number of times previously and fixed it by exporting the environment variable, but last night I was running without and env variable using "./manage.py runserver", stopped the server after making some changes and it then complained about the missing environment variable.

Re: Thumbnails for ImageField in admin pages

2007-08-28 Thread daev
On 28, 18:05, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Is there any similar trick or should I modify admin > template for change form? Yes, you have to edit admin page template to do that --~--~-~--~~~---~--~~ You received this message because you are

Re: Thumbnails for ImageField in admin pages

2007-08-28 Thread Thomas Badran
Brilliant, thankyou. Tom On Tue, 2007-08-28 at 13:51 +, daev wrote: > Try this: > > image = models.ImageField() > > def image_thumbnail(self): > return "" % > self.get_image_url() > image_thumbnail.allow_tags = True > > class Admin: > list_display = ( "image_thumbnail", ) > > >

Re: Thumbnails for ImageField in admin pages

2007-08-28 Thread Jarek Zgoda
On 28 Sie, 15:51, daev <[EMAIL PROTECTED]> wrote: > Try this: > > image = models.ImageField() > > def image_thumbnail(self): > return "" % > self.get_image_url() > image_thumbnail.allow_tags = True > > class Admin: > list_display = ( "image_thumbnail", ) That works fine on objects list

Re: Thumbnails for ImageField in admin pages

2007-08-28 Thread daev
Try this: image = models.ImageField() def image_thumbnail(self): return "" % self.get_image_url() image_thumbnail.allow_tags = True class Admin: list_display = ( "image_thumbnail", ) --~--~-~--~~~---~--~~ You received this message because you are

Re: Thumbnails for ImageField in admin pages

2007-08-28 Thread Thomas Badran
Oh great suggestion, that file browser actually looks very useful for other purposes as well, i was trying to think of good way of providing 'static' page editing with images etc. and that looks to be a great help there. Thanks Tom On Tue, 2007-08-28 at 06:43 -0700, patrickk wrote: > One way

Re: Thumbnails for ImageField in admin pages

2007-08-28 Thread patrickk
One way is using the FileBrowser: http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki But I guess there are other possibilities (just search this forum ...) Patrick On 28 Aug., 15:35, Thomas Badran <[EMAIL PROTECTED]> wrote: > Is it possible to have thumbnails for images in the admin

Re: Lighttpd advice please

2007-08-28 Thread b3n
Thanks Nic, Yeah I've been reading the Django and Lighttpd docs but it's not getting any clearer, just the opposite =/ I'll keep reading... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Thumbnails for ImageField in admin pages

2007-08-28 Thread Thomas Badran
Is it possible to have thumbnails for images in the admin pages in 0.96 (ive read something that suggests this might be possible in svn)? I keep finding wonderful new tricks like the side by side javascript stuff for many to many fields etc. but cant seem to find a sensible way of doing this.

Re: Lighttpd advice please

2007-08-28 Thread Nic
b3n <[EMAIL PROTECTED]> writes: > I want to also install Lighttpd on this box - to act as a static media > server. Can / should I also use Lighttpd for Django? Or should the > Python/Django-ness be Apache based, leaving Lighttpd to deal with > media files only. You can use lighttpd to server

Re: Lighttpd advice please

2007-08-28 Thread b3n
Actually our server OS is: Red Hat Enterprise Linux ES 4 --~--~-~--~~~---~--~~ 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

Lighttpd advice please

2007-08-28 Thread b3n
We have a dedicated server at Rackspace running Apache 2 and Fedora Core 5. I want to start using Django/Python on this server. At the moment we only have about 10 client sites (PHP based) on the server . I want to also install Lighttpd on this box - to act as a static media server. Can /

Comment-framework: UnicodeError

2007-08-28 Thread patrickk
After not being able to use memcache (see http://groups.google.com/group/django-users/browse_thread/thread/be216ba920d3b6ad/), we´re now having problems with the Comment-Framework throwing a UnicodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128) It sometimes

Re: query where m2m field is to have values from one set but not another

2007-08-28 Thread Pigletto
> class Blah(models.Model): > ... > sources = models.ManyToManyField(Source) > > The query I want to perform is to find all the Blahs that come from > sources 1 or 2 but not sources 3 or 4. What if Blah comes from both 1 and 3? > The SQL I want to run is something like: > >

query where m2m field is to have values from one set but not another

2007-08-28 Thread James Tauber
I have a model where each Blah can come from one or more Sources. i.e. I have: class Blah(models.Model): ... sources = models.ManyToManyField(Source) The query I want to perform is to find all the Blahs that come from sources 1 or 2 but not sources 3 or 4. My first attempt was:

Re: modpython and python2.5

2007-08-28 Thread Leandro Zanuz
You'll need to recompile your apache/mod-python. When you compile the mod-python you'll need ro inform the python path that you want to use. Grupo Django escreveu: > This is not a django related problem, but I thought that maybe someone > could help me. > I have a Debian 4 server with apache2,

Choices cannot be marked for translation?

2007-08-28 Thread Kenneth Gonsalves
hi, when i upgraded to the latest svn head, I found that all the places in admin that had drop downs for choices were blank. I had always marked my choices for translation like so: article_type = ( ("NW", _("News")), ("FT",_("Features")), ) now, this doesnt work - when I remove the _(),

modpython and python2.5

2007-08-28 Thread Grupo Django
This is not a django related problem, but I thought that maybe someone could help me. I have a Debian 4 server with apache2, modpython 3.3., python2.4 and python2.5 PYthon 2.4 is required by Debian to solve some dependency problem, I have just installed python2.5 and made it the default

Re: Problem in current svn TRUNK

2007-08-28 Thread Michael Radziej
Hi, Though I cannot easily test with exactly your packages, I tested django trunk under Ubuntu (feisty) with postgresql-8.2.3-3, python-2.5.1~rc1-0ubuntu3, python-psycopg2-2.0.5.1-6ubuntu1, with a minimal model syncdb, and it worked. Michael -- noris network AG - Deutschherrnstraße 15-19 -

Re: problems with tutotial !?

2007-08-28 Thread Sheriff26
i have try'd to go to url: http://192.168.1.1:8800/admin/polls/poll/ and i recive this error: AttributeError at /admin/polls/poll/ 'NoneType' object has no attribute 'manager' Request Method: GET Request URL:http://192.168.1.1:8800/admin/polls/poll/ Exception Type:

Re: Problem in current svn TRUNK

2007-08-28 Thread Michael Radziej
On Tue, Aug 28, Michael Radziej wrote: > > On Mon, Aug 27, Peter Nixon wrote: > > > > > On Wed 11 Jul 2007, Michael Radziej wrote: > > > Hi, > > > > > > you're using the alpha version of SuSE ... well ... there might very well > > > be a problem very deep in one of the libraries. The alpha

Re: changing versions

2007-08-28 Thread Iapain
> So I ran svn update and checked out rev 6022, restarted apache and > unfortunately got an "Internal Server Error" visiting the website. Please look inside apache log > I dont think I am using the correct svn command... > > when im in the .../python2.5/site-packages/django directory, I use >

Re: problems with tutotial !?

2007-08-28 Thread Sheriff26
no! I don't arrive at that part of tutorial yet. and is very strange for me. I started from the beggining. When I change from: class Admin: pass in to class Admin: fields = ( (None, {'fields': ('pub_date', 'question')}), ) it dissapear from admin. If I change it

Re: Problem in current svn TRUNK

2007-08-28 Thread Michael Radziej
On Mon, Aug 27, Peter Nixon wrote: > > On Wed 11 Jul 2007, Michael Radziej wrote: > > Hi, > > > > you're using the alpha version of SuSE ... well ... there might very well > > be a problem very deep in one of the libraries. The alpha releases aren't > > very reliable. I'd suggest that you try

changing versions

2007-08-28 Thread Pawel Pilitowski
Hi, I had finally decided to see if the new svn version of django fixed an issue I was having (ticket 1796 - fixed in rev 5919). So I ran svn update and checked out rev 6022, restarted apache and unfortunately got an "Internal Server Error" visiting the website. So I starting to checkout

Re: problems with tutotial !?

2007-08-28 Thread arcr. .....
Hi Sheriff, Have you edit the view.py and urls.py? On 8/28/07, Sheriff26 <[EMAIL PROTECTED]> wrote: > > > Hi. > > I'm new here. I try to follow the tutorial, but I have some problems. > > When I changed from (tutorial part two): > > class Choice(models.Model): > poll =

problems with tutotial !?

2007-08-28 Thread Sheriff26
Hi. I'm new here. I try to follow the tutorial, but I have some problems. When I changed from (tutorial part two): class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) votes = models.IntegerField() TO class Choice(models.Model):

Re: dynamic links

2007-08-28 Thread Rufman
I tried both methods and what i found out was that im getting an empty link...how can that happen i.e how can i fix the problem? thx for your help On Aug 28, 8:13 am, Rufman <[EMAIL PROTECTED]> wrote: > >http://www.djangoproject.com/documentation/templates/#url > > I tried that already...but

Re: memcache: getting all cached keys?

2007-08-28 Thread patrickk
Answer to my own question after contacting the memcache mailing-list: http://www.socialtext.net/memcached/index.cgi?faq#can_i_iterate_the_items_of_the_memcached_server On 27 Aug., 14:34, patrickk <[EMAIL PROTECTED]> wrote: > I´ve just used Fredriks cache view (http://effbot.org/zone/django- >

Re: UnicodeDecodeError with memcache

2007-08-28 Thread patrickk
why prefer latin1 over utf-8 (in settings.py)? On 28 Aug., 09:12, Iapain <[EMAIL PROTECTED]> wrote: > > >>> import sys > > >>> sys.getdefaultencoding() > > > 'ascii' > > Try using utf-8, btw it shouldnt be a problem. Lastly try using > changing charset to latin1 in your settings.py .. I guess

Re: UnicodeDecodeError with memcache

2007-08-28 Thread Iapain
> >>> import sys > >>> sys.getdefaultencoding() > > 'ascii' Try using utf-8, btw it shouldnt be a problem. Lastly try using changing charset to latin1 in your settings.py .. I guess your website is not in english .. or it has some non-ascii char.

Re: UnicodeDecodeError with memcache

2007-08-28 Thread patrickk
additional information: I just checked the default encoding >>> import sys >>> sys.getdefaultencoding() 'ascii' should that be something different (like utf-8)? btw: all our data (database) and scripts are encoded with utf-8. thanks, patrick On 28 Aug., 08:21, patrickk <[EMAIL PROTECTED]>

Re: is 40 MB RAM enough?

2007-08-28 Thread Iapain
> could you run it and check the output. 14.28 MB --~--~-~--~~~---~--~~ 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 this

Re: UnicodeDecodeError with memcache

2007-08-28 Thread patrickk
I´m sorry for bothering again, but our site has to be online soon and I ´m currently not able to use the cache_page decorator (which makes me a bit nervous). I did some research on smart_str, but I don´t know how and where to use it and I also don´t see why this should solve the problem. any

Re: dynamic links

2007-08-28 Thread Rufman
> > http://www.djangoproject.com/documentation/templates/#url I tried that already...but its not working for me...or i just don't know whats happening. I always get a link to the current page. i.e the page links to itself. i can't seem to find more documentation to the url tag, so that i could