Re: Hosting many small Django websites

2010-10-14 Thread Kenneth Gonsalves
On Thu, 2010-10-14 at 13:45 -0700, Diederik van der Boor wrote: > I'm curious about using Django for many small web sites. Does this > require each site to run in a separate wsgi daemon process? If so, how > is it possible to keep memory usage shared? I am also interested in this - currently I

Re: python highlighting in text input field

2010-10-14 Thread pixelcowboy
Thanks, I guess this gets me halfway there! Still need to figure out the highlighting for python. On Oct 14, 12:34 pm, Antoni Aloy wrote: > Take a look at > > http://bitbucket.org/jezdez/django-dbtemplates/wiki/Home > > Hope it helps! > > 2010/10/14 pixelcowboy

Re: Hosting many small Django websites

2010-10-14 Thread Venkatraman S
On Fri, Oct 15, 2010 at 2:15 AM, Diederik van der Boor wrote: > > I'm curious about using Django for many small web sites. Does this > require each site to run in a separate wsgi daemon process? If so, how > is it possible to keep memory usage shared? > Not exactly sure when

Re: design problem..how to store web page's data for later comparison

2010-10-14 Thread Eric Chamberlain
You may want to store a hash of the page and use that for the comparison, then if the user wants to see the difference between the two pages, pull up the full page. On Oct 11, 2010, at 3:07 AM, jimgardener wrote: > hi > I am trying to write an application that checks a web page today and >

Re: Help with Manager.

2010-10-14 Thread Alec Shaner
You can't add a datetime to another datetime - you want to add a datetime.timedelta instance instead. Out of curiosity I just tested it on one of my models and it does work, e.g., MyModel.objects.filter(update_date__gt=F('entry_date')+timedelta(days=5)) On Thu, Oct 14, 2010 at 5:57 PM, Marc

Re: Hosting many small Django websites

2010-10-14 Thread Brian Bouterse
We host many of our django sites using a django deployer we wrote called Opus . Opus uses a separate wsgi daemon process for each site. Each wsgi process also runs a separate user, so linux would prevent the memory from being shared. In our case though we want

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
On Thu, Oct 14, 2010 at 10:08 PM, Alec Shaner wrote: > See this: > > http://ifacethoughts.net/2009/07/14/calculated-fields-in-django/ > > So perhaps the 'extra' query filter is what you need. > > Yep, I got a success using extra filter :) Thanks Alec for sharing this! by

Hosting many small Django websites

2010-10-14 Thread Diederik van der Boor
Hi, I'm curious about using Django for many small web sites. Does this require each site to run in a separate wsgi daemon process? If so, how is it possible to keep memory usage shared? Thanks in advance, Diederik -- You received this message because you are subscribed to the Google Groups

Creating a document library App...

2010-10-14 Thread Jason
Django makes it pretty straight forward to create a simple document library - especially if all of the "docs" are stored as text in the database. Searching for information seems to be the hard part here. Django-Sphynx looks like an awesome solution for searching database text. The problem I

Re: Help with Manager.

2010-10-14 Thread Alec Shaner
See this: http://ifacethoughts.net/2009/07/14/calculated-fields-in-django/ So perhaps the 'extra' query filter is what you need. 2010/10/14 Marc Aymerich : > > > 2010/10/14 Marc Aymerich >> >> >> 2010/10/14 Jonathan Barratt

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Marc Aymerich > > > 2010/10/14 Jonathan Barratt > >> On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: >> >> Hi, >> I'm trying to make a Manager for my model "order". I want that it returns >> all orders that their 'active period'* is

Re: python highlighting in text input field

2010-10-14 Thread Antoni Aloy
Take a look at http://bitbucket.org/jezdez/django-dbtemplates/wiki/Home Hope it helps! 2010/10/14 pixelcowboy : > Is there any way to do this? I want the admin to be able to edit > python templates from the admin. > > -- > You received this message because you are

Re: Halting large form-based file uploads

2010-10-14 Thread Ross
On Oct 13, 11:16 pm, Jonathan Barratt wrote: > No need to worry, since Python features automatic memory management this will > be cleaned up as part of the normal garbage collection routines. Sounds great. Thx for the info. > > > 2. Is there any way for me to

python highlighting in text input field

2010-10-14 Thread pixelcowboy
Is there any way to do this? I want the admin to be able to edit python templates from the admin. -- 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

Re: duplicate key value violates unique constraint "django_admin_log_pkey"

2010-10-14 Thread global...@iamsandiego.com
Jonathan - Thank you - select setval('django_admin_log_id_seq', LASTID+1); - worked ! I can breathe again. On Oct 14, 9:23?am, Jonathan Barratt wrote: > On 14 ?.?. 2010, at 22:24, global...@iamsandiego.com wrote: > > > Hi Folks, > > > After updating a postgres db

MySQL locking problem

2010-10-14 Thread Nick Arnett
I am having a problem with locking on MySQL and can't quite figure out what's causing it. Although I have some scripts that do raw SQL, none of them are running, I see no other transactions in the process list, yet when I call save() on one of my objects, the transaction locks, seemingly forever.

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Jonathan Barratt > On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > > Hi, > I'm trying to make a Manager for my model "order". I want that it returns > all orders that their 'active period'* is greater than a certain threshold. > With "active period" I

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Jonathan Barratt > On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > > Hi, > I'm trying to make a Manager for my model "order". I want that it returns > all orders that their 'active period'* is greater than a certain threshold. > With "active period" I

Re: duplicate key value violates unique constraint "django_admin_log_pkey"

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 22:24, global...@iamsandiego.com wrote: > Hi Folks, > > After updating a postgres db for my django app Iam getting this error > when I try and save new data to the db: > > Request Method: POST > Request URL: http://10.50.253.200/admin/survey/gps/add/ > Django Version:

Re: Delete the FileField record but keep the file?

2010-10-14 Thread Russell Keith-Magee
On Tue, Oct 12, 2010 at 11:42 PM, Stodge wrote: > Short of creating my own custom FileField class, is there anyway to > pass an optional "delete" flag to a custom file system storage? I have > a case where I want to delete the FileField record, but not the file. This was

Re: Help with Manager.

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > Hi, > I'm trying to make a Manager for my model "order". I want that it returns all > orders that their 'active period'* is greater than a certain threshold. With > "active period" I mean: (order.cancel_date - order.register_date ) > > My

Re: Delete the FileField record but keep the file?

2010-10-14 Thread Jonathan Barratt
On 14 ต.ค. 2010, at 22:30, Stodge wrote: > That's basically all I've done unless I can find a cleaner solution. I > copy the files elsewhere, delete the records and then copy the files > back. Yeah, sorry I can't think of anything better than that - except maybe move\rename instead of copy to

duplicate key value violates unique constraint "django_admin_log_pkey"

2010-10-14 Thread global...@iamsandiego.com
Hi Folks, After updating a postgres db for my django app Iam getting this error when I try and save new data to the db: Request Method: POST Request URL:http://10.50.253.200/admin/survey/gps/add/ Django Version: 1.2 beta 1 Exception Type: IntegrityError Exception

Re: Delete the FileField record but keep the file?

2010-10-14 Thread Stodge
That's basically all I've done unless I can find a cleaner solution. I copy the files elsewhere, delete the records and then copy the files back. On Oct 13, 2:13?am, Jonathan Barratt wrote: > On 12 ?.?. 2010, at 22:42,Stodgewrote: > > > Short of creating my own

Help with Manager.

2010-10-14 Thread Marc Aymerich
Hi, I'm trying to make a Manager for my model "order". I want that it returns all orders that their 'active period'* is greater than a certain threshold. With "active period" I mean: (order.cancel_date - order.register_date ) My Order model looks like this: class order(models.Model):

Re: m2m relationship management

2010-10-14 Thread Justinas Jaronis
In the first place, I have no access to the database design - the django application will be like frontend to already deployed database with loads of information. Furthermore I don't blame the architect for the design, because it's just impossible to store the required information somehow else -

Re: Rich email with attachments

2010-10-14 Thread Alec Shaner
On Thu, Oct 14, 2010 at 3:45 AM, Sheena wrote: > I also want to have the option to add any attachment. So I want to > have a button that when pressed allows the user to pick a file on > their hdd and have it uploaded immediately, without loosing anything > that's

Re: m2m relationship management

2010-10-14 Thread Javier Guerra Giraldez
On Thu, Oct 14, 2010 at 4:45 AM, Justinas Jaronis wrote: > There > are some objects that will have about 20+ m2m relationships not knowing anything about your system, it might be the best solution; but in the _vast_ majority of cases this is a signal of suboptimal

Re: mtv pattern(diagram)

2010-10-14 Thread Roberto Benitez
I don't know is not in this chain of messages but yesterday "refreegrata" shared the following graph and I agree with it: request | | V internal controller(urls.py) | | V || | views |<-->model |___|<--->template

Re: Rich email with attachments

2010-10-14 Thread Roberto Benitez
I don't know tinyMCE in detail. What I know is to send emails with media and style you need to include all css inside the email template and, instead of making relative reference to media urls, you have to use the whole absolute url. My 2 cents. Roberto On Thu, Oct 14, 2010 at 7:35 AM, Jonathan

ImageField, linking an already uploaded image with ImageField

2010-10-14 Thread reduxdj
I have an application that uses facebook's API, i'm grabbing the user's avatar image and storing it in my media folder. That's all good. What I want to do is associate the user's already uploaded image with the ImageField, without uploading the file. Is there a way do to do this with ImageField?

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-14 Thread ringemup
Thank you, Brian and Shawn, for the further explanations! On Oct 13, 11:45 pm, Brian Bouterse wrote: > RabbitMQ implements a standards based protocol called > AMQP, > which provides asynchronous, reliable

Re: Different E-mail Settings for Error Messages

2010-10-14 Thread Matt_313
Thank you Russell, worked great! Matt. On Oct 14, 12:22 am, Russell Keith-Magee wrote: > On Wed, Oct 13, 2010 at 11:59 PM, Matt_313 wrote: > > Hi, > > > I have a Django site that gets on average 6,000 visits a day. We use a > > white listed

Re: CSRF issue in django-forum

2010-10-14 Thread Sithembewena Lloyd Dube
Hi Russ, That's a great suggestion. I did add csrf tokens in all templates involved, but still got the problem. Thsi makes me wonder whethere or not there is somethign in django-forum's internals that causes the template system to throw a fit even with the tags and middleware available. Will

Re: CSRF issue in django-forum

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 18:06, Sithembewena Lloyd Dube wrote: > Hi Jonathan, > > Thanks for the tip. The rub with that is, we are using csrf tokens in the > rest of our views. While authentication may still take care of basic > security, removing csrf middleware would surely increase XSS risk?

Re: CSRF issue in django-forum

2010-10-14 Thread Sithembewena Lloyd Dube
Hi Jonathan, Thanks for the tip. The rub with that is, we are using csrf tokens in the rest of our views. While authentication may still take care of basic security, removing csrf middleware would surely increase XSS risk? 2010/10/14 Jonathan Barratt > On 14 ?.?.

Re: admin not working (likely permission issue)

2010-10-14 Thread Kenneth Gonsalves
On Wed, 2010-10-13 at 22:07 -0700, yearnestiac wrote: > I'm having trouble to get admin to work with Ubuntu/Apache modpython or wsgi or what? -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

m2m relationship management

2010-10-14 Thread Justinas Jaronis
I'm currently developing quite complex database on Django. It seems to be perfect for auto administrative interface etc, However because of the complexity (just the models.py classes are about 2000 lines; There are some objects that will have about 20+ m2m relationships) it's completely unusable

admin not working (likely permission issue)

2010-10-14 Thread yearnestiac
Hi everyone, I'm having trouble to get admin to work with Ubuntu/Apache. My admin works fine if I run it on the same host with django's developer server (python manage.py runserver). But I got this message when I deliver my website via Apache and try to request the admin page. Internal Server

Re: CSRF issue in django-forum

2010-10-14 Thread Russell Keith-Magee
On Thu, Oct 14, 2010 at 5:58 PM, Sithembewena Lloyd Dube wrote: > Hi all, > > I just installed django-forum (http://code.google.com/p/django-forum/) in my > Django 1.2.3. project and all went well (admin) until I got CSRF errors > while trying to load a new forum I created in

Re: Rich email with attachments

2010-10-14 Thread Jonathan Barratt
On 14 ต.ค. 2010, at 14:45, Sheena wrote: > Hi all > > I'm making a site in which users have access to a rich text editor > implemented with tinyMCE. What I want to do with the result is turn it > into an email and send it off. > > I want to include a non-standard button and I was wondering if

Re: CSRF issue in django-forum

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 16:58, Sithembewena Lloyd Dube wrote: > Hi all, > > I just installed django-forum (http://code.google.com/p/django-forum/) in my > Django 1.2.3. project and all went well (admin) until I got CSRF errors while > trying to load a new forum I created in the admin. > I added

Re: modelformset_factory, initial, and queryset

2010-10-14 Thread Daniel Roseman
On Oct 14, 10:32 am, Tim Valenta wrote: > This is driving me mad, so I must ask the community, in hopes of a > workaround: > > I've got a simple formset of models on a page, generated by > modelformset_factory.  This particular page will never create forms-- > it only

CSRF issue in django-forum

2010-10-14 Thread Sithembewena Lloyd Dube
Hi all, I just installed django-forum (http://code.google.com/p/django-forum/) in my Django 1.2.3. project and all went well (admin) until I got CSRF errors while trying to load a new forum I created in the admin. I added @csrf_protect tags to the forms of the pages concerned and also made sure

modelformset_factory, initial, and queryset

2010-10-14 Thread Tim Valenta
This is driving me mad, so I must ask the community, in hopes of a workaround: I've got a simple formset of models on a page, generated by modelformset_factory. This particular page will never create forms-- it only modifies existing ones. Therefore the queryset I pass into the formset

Re: Database Setup

2010-10-14 Thread Sithembewena Lloyd Dube
I recall having a similar problem. Get the MySQL bindings appropriate to your Python version below and install to your site-packages folder: http://sourceforge.net/projects/mysql-python/ 2010/10/13 Everett > > > On Oct 13, 2:34 am, Jonathan Barratt

Re: Database Setup

2010-10-14 Thread Greg Fuller
This can be a pain on windows, because there is usually no compiler for setup to build the "binary" version of the adaptor. The easiest course of action is to find a binary for the version of python you are running. I haven't seen any for 2.7 yet but searching for "python msqldb windows binary"

Rich email with attachments

2010-10-14 Thread Sheena
Hi all I'm making a site in which users have access to a rich text editor implemented with tinyMCE. What I want to do with the result is turn it into an email and send it off. I want to include a non-standard button and I was wondering if anyone can let me know how this can be achieved. The

Re: Database Setup

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 1:32, Everett wrote: > > Ok I was just assuming Python already had the MySQL bindings. > So I've downloaded the MySQL-python-1.2.3.tar.gz, I decompressed it, > read that I needed easy_install or setuptools. So I installed > setuptools/easy_install but for some reason it won't

aggregating models across databases

2010-10-14 Thread qMax
Hello. I still cannot figure out how to deal with the task: An entity is represented by several models in different databases. (for instance - one model tores system logins, another model - phones and emails, etc) There are rules to find out related models based on common field. I'd like to have