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 button should add an in-
line image off the user's hdd. When a user chooses to send off the
email I need all the images added in this way to be uploaded onto my
server.

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 already filled in on the email form.

I'm a bit of a nube in terms of both Django and javascript so I hope
it's not a silly request, I hope someone will at least be able to
point me in the right direction.

Thanks

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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" will expose some binaries for earlier
versions.  I usually work on mac, but for my windows box at work I
reverted to an earlier version of python just to get mysql (and PIL)
working

On Oct 12, 10:19 pm, Everett  wrote:
> I'm running Django on Windows. When I edited the settings.py file for
> the MySql database I'm running in an XAMPP package, the Django
> development server throws a bunch of unhandled exceptions. It starts
> out like this:
>
> Unhandled exception in thread started by  0x01F69E70>
> Traceback (most recent call last):
> File "D:\Python27\lib\site-packages\django\core\managment\base.py",
> line 249 in validate
>
> Is this because of how I'm running the MySQL database? Or the
> information in the settings.py file is off? Cause when I take all the
> database settings out of the settings.py file the development server
> runs fine.
>
> Database settings:
>
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'djangodb',
> 'USER': 'admin',
> 'PASSWORD': ' ',
> 'HOST': 'localhost',
> 'PORT': ' ',
>
> Any ideas?

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
> wrote:
> > On 13 ?.?. 2010, at 10:19, Everett wrote:
> >
> > > I'm running Django on Windows. When I edited the settings.py file for
> > > the MySql database I'm running in an XAMPP package, the Django
> > > development server throws a bunch of unhandled exceptions. It starts
> > > out like this:
> >
> > 
> >
> > The most useful error message will be the last entry in the traceback
> rather than the start of it. Please provide that message and we may have
> more to go on.
> >
> > > Is this because of how I'm running the MySQL database? Or the
> > > information in the settings.py file is off? Cause when I take all the
> > > database settings out of the settings.py file the development server
> > > runs fine.
> >
> > If there are no DB settings then obviously Django doesn't try to talk to
> the DB, so yes that does suggest the problem is in the Django-DB
> interaction.
> >
> > 
> >
> > > Any ideas?
> >
> > The first idea that pops into my head is that you may not have Python's
> MySQL bindings installed (perhttp://
> docs.djangoproject.com/en/dev/topics/install/#get-your-databas...), which
> is available athttp://sourceforge.net/projects/mysql-python/
> >
> > If do already have that package installed then we'll just have to see the
> most recent call that threw an exception...
> >
> > Best wishes,
> > Jonathan
>
> 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 install the MySQL-
> python files. I tried getting easy_install to download it, wouldn't
> work. I tried to get it to use the compressed version, still didn't
> work. I'm guessing it's not working cause the easy_install needs an
> egg file, yet there doesn't seem to be one in any of the directories.
>
> As for the errors at the bottom of the thrown exceptions:
>
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" %e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: No module named MySQLdb
>
> does that help?
>
> Thanks
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 constructor gets built, and everything works great.

I've added a field to the formset, but Django seems perfectly happy to
totally ignore whatever initial data I want to supply for this
'virtual' field that I've added.  It seems that I've got absolutely no
mechanism for setting a dynamically-generated value as a pre-computed
field value.

My situation is that I want to represent an many-to-many relationship
on this 'virtual' field, which doesn't actually exist on my model.
When the form is submitted, I can easily intercept the values sent and
do what I will with them.  However, when the page refreshes after a
submission, I cannot for the life of me inject this data back into the
form.  As of right now, my select-multiple widget is quite blank, no
matter what I do.

Help?  I've literally been at this for hours off and on.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 to have the CSRF Middleware in settings.py - still no joy.

On the Issues tab of the dango-forum project, the author/s state that this
is a known problem with no plans to rectify as Django 1.2 is not supported.

What would be an ideal way to handle this problem? The rest of the app seems
like just what I need.

-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 modifies existing ones.  Therefore the queryset I pass into
> the formset constructor gets built, and everything works great.
>
> I've added a field to the formset, but Django seems perfectly happy to
> totally ignore whatever initial data I want to supply for this
> 'virtual' field that I've added.  It seems that I've got absolutely no
> mechanism for setting a dynamically-generated value as a pre-computed
> field value.
>
> My situation is that I want to represent an many-to-many relationship
> on this 'virtual' field, which doesn't actually exist on my model.
> When the form is submitted, I can easily intercept the values sent and
> do what I will with them.  However, when the page refreshes after a
> submission, I cannot for the life of me inject this data back into the
> form.  As of right now, my select-multiple widget is quite blank, no
> matter what I do.
>
> Help?  I've literally been at this for hours off and on.

Can you show some code? It would help to understand what you're doing.
--
DR.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 @csrf_protect tags to the forms of the pages concerned and also made 
> sure to have the CSRF Middleware in settings.py - still no joy.
> 
> On the Issues tab of the dango-forum project, the author/s state that this is 
> a known problem with no plans to rectify as Django 1.2 is not supported.
> 
> What would be an ideal way to handle this problem? The rest of the app seems 
> like just what I need.

It's not ideal, but it's certainly simplest: *remove* the CSRF middleware from 
settings.py. No middleware, no CSRF errors.

This is what I did where I had a similar problem, though admittedly I'm not 
worried about CSRF due to the two-factor authentication system used for access 
to the  site in question...

Hopefully someone with more experience than I can give you an alternative 
option, but just in case...
Jonathan

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 anyone
> can let me know how this can be achieved. The button should add an in-
> line image off the user's hdd. When a user chooses to send off the
> email I need all the images added in this way to be uploaded onto my
> server.

It sounds to me like what you're asking about is on the tinyMCE side of things, 
not Django's, and if so, this looks like what you're looking for:

http://tinymce.moxiecode.com/examples_im/example_01.php 

> 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 already filled in on the email form.

For non-images looks like you want this:

http://tinymce.moxiecode.com/examples_fm/example_01.php

> I'm a bit of a nube in terms of both Django and javascript so I hope
> it's not a silly request, I hope someone will at least be able to
> point me in the right direction.

On the server-side, once you've received the HTTP request with the uploaded 
file, you'll want to use the Django features described here:
http://docs.djangoproject.com/en/dev/topics/http/file-uploads/

Good luck!
Jonathan

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 the admin.
> I added @csrf_protect tags to the forms of the pages concerned and also made
> sure to have the CSRF Middleware in settings.py - still no joy.
>
> On the Issues tab of the dango-forum project, the author/s state that this
> is a known problem with no plans to rectify as Django 1.2 is not supported.
>
> What would be an ideal way to handle this problem? The rest of the app seems
> like just what I need.

In almost all cases, updating to provide CSRF requires exactly one
thing - that you find every  tag in your templates, and you put
a {% csrf_token %} right after it.

If the authors of the app are saying that they're not going to update
to support Django 1.2, and you think that the app is otherwise
worthwhile, I would suggest preparing a patch for them and submitting
it for their consideration. They've got an open ticket logging that
this is a known problem [1], and to my reading, it's a matter that is
on the plan to be resolved, it just hasn't been resolved *yet*. If you
provide the patch, that might accelerate matters.

[1] http://code.google.com/p/django-forum/issues/detail?id=91

Yours,
Russ Magee %-)

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.


I set Apache's error log level to debug and it's not showing any
useful information. I'm thinking this must be caused by a permission
issue in ubuntu's file system where the public can't do something but
I can. But I don't know which files' permission to change. Does any
one know any candidates? What file would admin access? Where would
admin try to create/write a file? Thanks in advance!!!




-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 to administer such a database using current
inline implementation. I've found some information how to solve the
usability issue, by collapsing the body of all inlines:

http://stackoverflow.com/questions/2788143/django-admin-how-to-make-inlines-collapsible

however IMO it's too heavy to render everything on every page load. I
think the best solution would be to develop the administration view,
containing buttons (like "Many2many relationship 1", "m2m relationship
2" etc) that would dynamically load the inline via AJAX/AHAH upon the
button click.

Maybe someone has already faced this problem? I can't believe I'm the
only one :-)

Good luck,
Justinas

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 ?.?. 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 @csrf_protect tags to the forms of the pages concerned and also
> made sure to have the CSRF Middleware in settings.py - still no joy.
>
> On the Issues tab of the dango-forum project, the author/s state that this
> is a known problem with no plans to rectify as Django 1.2 is not supported.
>
> What would be an ideal way to handle this problem? The rest of the app
> seems like just what I need.
>
>
> It's not ideal, but it's certainly simplest: *remove* the CSRF middleware
> from settings.py. No middleware, no CSRF errors.
>
> This is what I did where I had a similar problem, though admittedly I'm not
> worried about CSRF due to the two-factor authentication system used for
> access to the  site in question...
>
> Hopefully someone with more experience than I can give you an alternative
> option, but just in case...
> Jonathan
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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?

Yes, you have to do input validation to prevent attacks against others being 
launched from your site, but if it's using two-factor authentication no-one can 
launch such attacks against a site from elsewhere (unless they steal a hardware 
token in which case there are bigger issues to worry about).

In your case though, I'd just follow Russ's suggestion - it doesn't sound very 
hard to patch if that's all you need to add...

Good luck!
Jonathan

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 look into it and see what gives, no word from the author thus far.

On Thu, Oct 14, 2010 at 12:46 PM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> 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 the admin.
> > I added @csrf_protect tags to the forms of the pages concerned and also
> made
> > sure to have the CSRF Middleware in settings.py - still no joy.
> >
> > On the Issues tab of the dango-forum project, the author/s state that
> this
> > is a known problem with no plans to rectify as Django 1.2 is not
> supported.
> >
> > What would be an ideal way to handle this problem? The rest of the app
> seems
> > like just what I need.
>
> In almost all cases, updating to provide CSRF requires exactly one
> thing - that you find every  tag in your templates, and you put
> a {% csrf_token %} right after it.
>
> If the authors of the app are saying that they're not going to update
> to support Django 1.2, and you think that the app is otherwise
> worthwhile, I would suggest preparing a patch for them and submitting
> it for their consideration. They've got an open ticket logging that
> this is a known problem [1], and to my reading, it's a matter that is
> on the plan to be resolved, it just hasn't been resolved *yet*. If you
> provide the patch, that might accelerate matters.
>
> [1] http://code.google.com/p/django-forum/issues/detail?id=91
>
> Yours,
> Russ Magee %-)
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 e-mail server to send out e-mails to our customers (order
> > notifications, password resets etc.)
> > This costs a fraction of a cent per e-mail - so all the details are in
> > settings.py.
>
> > Today, something happened that caused Django to send thousands of
> > error messages to my email account.
> > I love this feature, but today I ended up paying quite a lot for
> > identical error messages.
>
> > Is there any way at all to specify different e-mail server settings
> > for error messages?
>
> In 1.2 stable -- It's possible, but a little complex; you need to
> define your own 500 error handler, duplicating the logic of the
> default handler, but mailing using your preferred server.
>
> In trunk -- yes. In trunk, 500 error emails are now handled as a log
> handler, which makes it easier to write and install custom behavior.
>
> Yours,
> Russ Magee %-)

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 delivery of messages.  The broker
> simply passes messages around.  Celeryd processes join a message broker
> (RabbitMQ) and pull messages from any number of "queues."  A default queue
> is used if no queue names are specified.  A celeryd worker can be configured
> to pull from any number of queues.
>
> The reliable nature of AMQP based message buses/brokers is that when you
> submit a message into the message broker, you are guaranteed it will not be
> lost, and if a worker is available, it will be delivered.  The asynchronous
> part is that if you submit a message into the broker and there are no
> workers to handle the message, it will queue, reliably with other messages.
>  Once a worker comes online messages will begin being handled.
>
> There is no reason to require the broker to live on a separate machine.  It
> is common in our environment to run a RabbitMQ server process on a server,
> and on that same server configure celeryd worker processes to use localhost
> to connect to the message broker.
>
> To create rabbitmq users I think root permissions are required.  However, I
> do not this root is required for rabbitMQ to be run.  As long as celery has
> the right username/password/server information, and has appropriate
> permissions to run you your task code, you should be able to run celery as
> any non-root user.
>
> In terms of my explanation of celery, it basically describes the data schema
> that is submitted in the AMQP messages which are reliably and asynchronously
> delivered.  For instance, the task function, and all of the submitted
> arguments are contained in the message, and celeryd unpacks these message,
> with this format, and call the task function indicated with those arguments.
>  The return results are serialized and stored in the results database that
> celeryd is configured to work with.  In the case of django-celery these
> settings are found in the django settings.py file, but with celery on its
> own it is in celeryconfig.py  These results can be checked on later by
> task-id which can be easily stored in a plain django model.  We have built
> several analytics and research compute clusters using celery and
> django-celery.
>
> Best,
> Brian
>
>
>
> On Wed, Oct 13, 2010 at 5:07 PM, ringemup  wrote:
> > Thank you for taking the time to explain that, Shawn -- it makes
> > everything a LOT clearer.
>
> > If you could spare the time, I'm curious about a couple of aspects of
> > the architecture:
>
> > - What is the purpose of having a separate broker and daemon?
> > - How does the broker know when to pass the task back to Celery?
> > - Is there a reason other than resource usage for the broker to live
> > on a different machine?
>
> > Also, can this all be run in a shared hosting environment, or are root
> > permissions needed to install Celery and RabbitMQ?
>
> > On Oct 13, 4:43 pm, Shawn Milochik  wrote:
> > > On Oct 13, 2010, at 4:11 PM, ringemup wrote:
>
> > > >> It's surprisingly easy to get set up with nothing more than the
> > tutorial/into for django-celery. If anyone has problems with it I'd be happy
> > to try to assist.
>
> > > > Thanks, I might take you up on that.
>
> > > >> Although getting everything working is fairly easy, in my opinion the
> > docs aren't too clear on how the big picture really works for first-timers.
>
> > > > Yeah, that's a big reason I never tried to use it.  Would you be
> > > > willing to share a high-level overview with us?
>
> > > > Thanks!
>
> > > Okay, so here's how it works, as I understand it. I hope Brian will jump
> > in and correct where necessary.
>
> > > So, as I see it there are three moving parts.
>
> > > 1. Your application.
>
> > >     A. Your application will have, somewhere, some configuration
> > information which allows it to connect to the message broker.
> > >     B. It will also have one or more files containing callable code
> > (probably functions), which are decorated with a Celery decorator. These are
> > referred to as "tasks".
> > >     C. It will have other code which will call these decorated functions
> > when you want things to run asynchronously (in your views, for example).
>
> > > 2. The broker (traditionally RabbitMQ).
>
> > >     A. The broker probably lives on another machine, and runs as a
> > service.
> > >     B. The broker knows nothing about your code or applications.
> > >     C. The broker simply receives messages, holds onto them, and passes
> > them on when requested.
>
> > > 3. The Celery Daemon (the simplest use-case)
>
> > >     A. The Celery daemon is a separate process running on the same
> > machine as your application.
> > >     B. The Celery daemon uses the same config info (probably the same
> > config file) as your ap

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? I've seen similar solutions but none that really hit
on this point.

Thanks for your help.
Patrick

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Barratt <
jonathan.barr...@knifeict.com> wrote:

> 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 anyone
> > can let me know how this can be achieved. The button should add an in-
> > line image off the user's hdd. When a user chooses to send off the
> > email I need all the images added in this way to be uploaded onto my
> > server.
>
> It sounds to me like what you're asking about is on the tinyMCE side of
> things, not Django's, and if so, this looks like what you're looking for:
>
> http://tinymce.moxiecode.com/examples_im/example_01.php
>
> > 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 already filled in on the email form.
>
> For non-images looks like you want this:
>
> http://tinymce.moxiecode.com/examples_fm/example_01.php
>
> > I'm a bit of a nube in terms of both Django and javascript so I hope
> > it's not a silly request, I hope someone will at least be able to
> > point me in the right direction.
>
> On the server-side, once you've received the HTTP request with the uploaded
> file, you'll want to use the Django features described here:
> http://docs.djangoproject.com/en/dev/topics/http/file-uploads/
>
> Good luck!
> Jonathan
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
  |
  |
 V
response


Simple, clear, I think nothing is missing. Maybe urls.py should be between
views and response too. Credits to refreegrata !

Thanks

Roberto

On Wed, Oct 13, 2010 at 8:57 AM, Kenneth Gonsalves wrote:

> On Wed, 2010-10-13 at 04:51 -0700, refreegrata wrote:
> > I have some questions.
> >
> > difference between : views in mtv and controllers in mvc,
> > difference between : templates in mtv and views in mvc,
> >
> > I read the documentation for Django, but still not clear to me.
>
> my diagram:
>
> request --> url --> view --> model --> view --> template -->url --> view
> --> model --> view --> url --> view ...
> --
> regards
> Kenneth Gonsalves
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
design.  maybe there's some commonality that could be abstracted with
table inheritance, or generic relationships.

-- 
Javier

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 already filled in on the email form.

I have implemented this in my project using django-tinymce, swfupload
and jquery. It was definitely one of the hardest features to
implement. If you want to go this route I can tell you one issue I ran
into was flash and cookies. This caused problems with authentication
(my upload service requires auth) and CSRF, but there was a simple fix
I found by googling to add some middleware. Here is one link with some
guidelines:

http://stackoverflow.com/questions/612734/code-samples-for-django-swfupload

I'm not 100% sold on swfupload and I did some research on other flash
based options, but I got so invested in swfupload I didn't have time
to try others.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 - it's
really complex scientific database. I see some perspective for
generalization, but this is out of scope of this problem and project
phase :-)

On 14 Spa, 17:39, Javier Guerra Giraldez  wrote:
> 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
> design.  maybe there's some commonality that could be abstracted with
> table inheritance, or generic relationships.
>
> --
> Javier

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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):
register_date = models.DateTimeField(auto_now_add=True)
cancel_date = models.DateTimeField(null=True, blank=True)


I'm wondering if is possible to achieve that using "annotate", something
like that:
(this not work)
order.objects.annotate(diff=SUB('cancel_date','register_date')).filter(diff__gt=period_threshold)


or maybe django provides another kind of tool to achieve what i want ?
I'll appreciate any kind of orientation :)

thanks!!


-- 
Marc

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 custom FileField class, is there anyway to
> > pass an optional "delete" flag to a custom file system storage?
>
> Not AFAIK.
>
> > I have a case where I want to delete the FileField record, but not the file.
>
> If it were me, I would just save a copy of the file to a different directory, 
> or rename it without going through Django, and then call delete on the 
> original object.
>
> But I Am A Django Noob, so others may have better suggestions for you...
> Jonathan
>
>
>
>
>
> > --
> > 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 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Value:

duplicate key value violates unique constraint "django_admin_log_pkey"

Is there any way to correct this?

Thanks

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 save yourself some disk I\O...

> 
> On Oct 13, 2:13 am, Jonathan Barratt 
> wrote:
>> On 12 ต.ค. 2010, at 22:42,Stodgewrote:
>> 
>>> Short of creating my own custom FileField class, is there anyway to
>>> pass an optional "delete" flag to a custom file system storage?
>> 
>> Not AFAIK.
>> 
>>> I have a case where I want to delete the FileField record, but not the file.
>> 
>> If it were me, I would just save a copy of the file to a different 
>> directory, or rename it without going through Django, and then call delete 
>> on the original object.
>> 
>> But I Am A Django Noob, so others may have better suggestions for you...
>> Jonathan
>> 
>> 
>> 
>> 
>> 
>>> --
>>> 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 
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/django-users?hl=en.
> 
> -- 
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Order model looks like this:
> 
> class order(models.Model):
> register_date = models.DateTimeField(auto_now_add=True)
> cancel_date = models.DateTimeField(null=True, blank=True)
> 
> 
> I'm wondering if is possible to achieve that using "annotate", something like 
> that:
> (this not work) 
> order.objects.annotate(diff=SUB('cancel_date','register_date')).filter(diff__gt=period_threshold)
> 
> 
> or maybe django provides another kind of tool to achieve what i want ? 

Unless I'm misunderstanding what you're looking for, I think this might suit 
your needs:

in your model:
> class order(models.Model):
...
def get_active_period(self):
return self.cancel_date - self.register_date
active_period = property(get_active_period)
(you may want to add some checking that cancel_date is not null, or that 
active_period is not negative but you get the idea)

Then where you need to access that queryset use:

order.objects.filter(active_period__gt=period_threshold)

But others with more Django experience than I may give you better advice...

Good luck!
Jonathan

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 discussed at DjangoCon; this behavior of FileField could be
legitimately be considered a bug, since there's no guarantee that two
FileFields aren't pointing to the same file, or (as in your case) that
deleting a FileField record actually means that the underlying file
should be deleted. Deleting data by default is an inherently dangerous
practice, and it probably shouldn't be the default behavior of file
fields.

I haven't gone searching the ticket database to see if this has been
raised before, but if it hasn't, this issue should be logged and
looked at.

Yours,
Russ Magee %-)

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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:   1.2 beta 1
> Exception Type:   IntegrityError
> Exception Value:
> 
> duplicate key value violates unique constraint "django_admin_log_pkey"
> 
> Is there any way to correct this?

Sounds to me like your DB update has reset the sequence 
"django_admin_log_id_seq" used by postgres to get the next  value for the 
"auto-increment"-type id field used by django_admin_log. 

I would manually reset the sequence via the following:

First get the id value of the last admin entry:

select id from "django_admin_log" order by id desc limit 1;

Then set the next value of the ID sequence to that + 1 via:

select setval('django_admin_log_id_seq', LASTID+1);

(replacing LASTID+1 with the result of the first query +1 obviously...)

The other option would be to "delete * from 'django_admin_log';" so that the 
old ids are gone and you can start over from 1 - but then you lose your whole 
admin history which seems sub-optimal.

Haven't run into the problem myself though, so this is just a guess, and from a 
Django newbie so...

Hope it helps!
Jonathan

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 mean: (order.cancel_date - order.register_date )
>
> My Order model looks like this:
>
> class order(models.Model):
> register_date = models.DateTimeField(auto_now_add=True)
> cancel_date = models.DateTimeField(null=True, blank=True)
>
>
> I'm wondering if is possible to achieve that using "annotate", something
> like that:
> (this not work)
>
> order.objects.annotate(diff=SUB('cancel_date','register_date')).filter(diff__gt=period_threshold)
>
>
> or maybe django provides another kind of tool to achieve what i want ?
>
>
> Unless I'm misunderstanding what you're looking for, I think this might
> suit your needs:
>
> in your model:
>
> class order(models.Model):
>
> ...
> def get_active_period(self): return self.cancel_date -
> self.register_date active_period = property(get_active_period)
> (you may want to add some checking that cancel_date is not null, or that
> active_period is not negative but you get the idea)
>
> Then where you need to access that queryset use:
>
> order.objects.filter(active_period__gt=period_threshold)
>

Hi Jonathan!,
Thank you very much for your answer, it's a pretty good solution :)



-- 
Marc

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 mean: (order.cancel_date - order.register_date )
>
> My Order model looks like this:
>
> class order(models.Model):
> register_date = models.DateTimeField(auto_now_add=True)
> cancel_date = models.DateTimeField(null=True, blank=True)
>
>
> I'm wondering if is possible to achieve that using "annotate", something
> like that:
> (this not work)
>
> order.objects.annotate(diff=SUB('cancel_date','register_date')).filter(diff__gt=period_threshold)
>
>
> or maybe django provides another kind of tool to achieve what i want ?
>
>
> Unless I'm misunderstanding what you're looking for, I think this might
> suit your needs:
>
> in your model:
>
> class order(models.Model):
>
> ...
> def get_active_period(self): return self.cancel_date -
> self.register_date active_period = property(get_active_period)
> (you may want to add some checking that cancel_date is not null, or that
> active_period is not negative but you get the idea)
>
> Then where you need to access that queryset use:
>
> order.objects.filter(active_period__gt=period_threshold)
>
>
jops ;(, unfortunately the Manager doesn't know what "active_period" is.

This is my order model now:

class order(models.Model):
[...]
def get_active_period(self):
if self.cancel_date:
return self.cancel_date-self.register_date
else:
return datetime.datetime.now()-self.register_date

active_period = property(get_active_period)

objects = models.Manager()
pending_of_bill = pending_of_billManager()


And this is my manager:

class pending_of_billManager(models.Manager):
def get_query_set(self):
[...]
return super(pending_of_billManager,
self).get_query_set().filter(active_period__gt=threshold)

This Works:
>>> order.objects.get(pk=1).active_period
datetime.timedelta(0, 8347, 24949)

but this doesn't:
>>> order.pending_of_bill.all()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/dist-packages/django/db/models/manager.py", line
117, in all
return self.get_query_set()
  File "/home/ucp/trunk/ucp/../ucp/order/models.py", line 15, in
get_query_set
return super(pending_of_billManager,
self).get_query_set().filter(active_period__gt=threshold)
  File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line
549, in filter
return self._filter_or_exclude(False, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line
567, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
  File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
line 1128, in add_q
can_reuse=used_aliases)
  File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
line 1026, in add_filter
negate=negate, process_extras=process_extras)
  File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
line 1191, in setup_joins
"Choices are: %s" % (name, ", ".join(names)))
FieldError: Cannot resolve keyword 'active_period' into field. Choices are:
amendment_invoice, amendment_quota, bill, cancel_date, comment,
contracted_pack, discount, entity, forward, htacces, htpasswd, id, included,
installed_app, mailman, name, order_disk, order_memory, order_swap, ovz,
pack, price, register_date, renew, service, size, system_group, system_user,
system_user_related, traffic, virtual_aliase, virtual_user,
virtual_user_related, virtualhost


What I'm missing ?? why super(pending_of_billManager, self).get_query_set()
doesn't know about active_period?
Thanks!

-- 
Marc

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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.  Although most of my database tables are InnoDB, the one that I'm
seeing this happen on is MyISAM (because I'm using full-text indexing on
it).  So the table is getting locked somehow, but I sure can't see how, when
there is nothing else in the processlist.

mysql> show processlist;
+-+-+-+---+-+--++--+
| Id  | User  | Host| db| Command | Time
| State  | Info
|
+-+-+-+---+-+--++--+
| 2755442 | narnett | localhost   | narnett_clar2 | Query   |0 |
NULL   | show processlist
  |
| 2764186 | narnett | localhost:54940 | narnett_clar2 | Query   |  547 |
Locked | UPDATE `fm_posting` SET `author_id` = 5860, `posted` = '2009-09-28
00:00:00', `body` = 'This is the  |
+-+-+-+---+-+--++--+

Anybody have suggestions for tracking this down?

Nick

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 for my django app Iam getting this error
> > when I try and save new data to the db:
>
> > Request Method: ? ?POST
> > Request URL: ? ? ?##
> > Django Version: ? ?1.2 beta 1
> > Exception Type: ? ?IntegrityError
> > Exception Value:
>
> > duplicate key value violates unique constraint "django_admin_log_pkey"
>
> > Is there any way to correct this?
>
> Sounds to me like your DB update has reset the sequence 
> "django_admin_log_id_seq" used by postgres to get the next ?value for the 
> "auto-increment"-type id field used by django_admin_log.
>
> I would manually reset the sequence via the following:
>
> First get the id value of the last admin entry:
>
> select id from "django_admin_log" order by id desc limit 1;
>
> Then set the next value of the ID sequence to that + 1 via:
>
> select setval('django_admin_log_id_seq', LASTID+1);
>
> (replacing LASTID+1 with the result of the first query +1 obviously...)
>
> The other option would be to "delete * from 'django_admin_log';" so that the 
> old ids are gone and you can start over from 1 - but then you lose your whole 
> admin history which seems sub-optimal.
>
> Haven't run into the problem myself though, so this is just a guess, and from 
> a Django newbie so...
>
> Hope it helps!
> Jonathan

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 verify and halt based on file size
> > DURING the upload?  
>
> Yes, but it would be through your web server software rather than your web 
> application itself. If you're using Apache you could use the LimitRequestBody 
> directive (http://httpd.apache.org/docs/1.3/mod/core.html#limitrequestbody).

Okay - yes, I'm using apache, so I'll read up on that.  Thx for the
pointer...

>
> hth,
> Jonathan

-Ross.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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):
>> register_date = models.DateTimeField(auto_now_add=True)
>> cancel_date = models.DateTimeField(null=True, blank=True)
>>
>>
>> I'm wondering if is possible to achieve that using "annotate", something
>> like that:
>> (this not work)
>>
>> order.objects.annotate(diff=SUB('cancel_date','register_date')).filter(diff__gt=period_threshold)
>>
>>
>> or maybe django provides another kind of tool to achieve what i want ?
>>
>>
>> Unless I'm misunderstanding what you're looking for, I think this might
>> suit your needs:
>>
>> in your model:
>>
>> class order(models.Model):
>>
>> ...
>> def get_active_period(self): return self.cancel_date -
>> self.register_date active_period = property(get_active_period)
>> (you may want to add some checking that cancel_date is not null, or that
>> active_period is not negative but you get the idea)
>>
>> Then where you need to access that queryset use:
>>
>> order.objects.filter(active_period__gt=period_threshold)
>>
>>
> jops ;(, unfortunately the Manager doesn't know what "active_period" is.
>
> This is my order model now:
>
> class order(models.Model):
> [...]
> def get_active_period(self):
> if self.cancel_date:
> return self.cancel_date-self.register_date
> else:
> return datetime.datetime.now()-self.register_date
>
> active_period = property(get_active_period)
>
> objects = models.Manager()
> pending_of_bill = pending_of_billManager()
>
>
> And this is my manager:
>
> class pending_of_billManager(models.Manager):
> def get_query_set(self):
> [...]
> return super(pending_of_billManager,
> self).get_query_set().filter(active_period__gt=threshold)
>
> This Works:
> >>> order.objects.get(pk=1).active_period
> datetime.timedelta(0, 8347, 24949)
>
> but this doesn't:
> >>> order.pending_of_bill.all()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/lib/python2.6/dist-packages/django/db/models/manager.py", line
> 117, in all
> return self.get_query_set()
>   File "/home/ucp/trunk/ucp/../ucp/order/models.py", line 15, in
> get_query_set
> return super(pending_of_billManager,
> self).get_query_set().filter(active_period__gt=threshold)
>   File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line
> 549, in filter
> return self._filter_or_exclude(False, *args, **kwargs)
>   File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line
> 567, in _filter_or_exclude
> clone.query.add_q(Q(*args, **kwargs))
>   File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
> line 1128, in add_q
> can_reuse=used_aliases)
>   File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
> line 1026, in add_filter
> negate=negate, process_extras=process_extras)
>   File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
> line 1191, in setup_joins
> "Choices are: %s" % (name, ", ".join(names)))
> FieldError: Cannot resolve keyword 'active_period' into field. Choices are:
> amendment_invoice, amendment_quota, bill, cancel_date, comment,
> contracted_pack, discount, entity, forward, htacces, htpasswd, id, included,
> installed_app, mailman, name, order_disk, order_memory, order_swap, ovz,
> pack, price, register_date, renew, service, size, system_group, system_user,
> system_user_related, traffic, virtual_aliase, virtual_user,
> virtual_user_related, virtualhost
>
>
> What I'm missing ?? why super(pending_of_billManager, self).get_query_set()
> doesn't know about active_period?
> Thanks!
>


Seems that we can't use a property as a queryset 'filter', in other words we
can't use property like this:
 order.objects.filter(active_time__gt=whatever)



-- 
Marc

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
>>>
>>> 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 Order model looks like this:
>>> class order(models.Model):
>>>     register_date = models.DateTimeField(auto_now_add=True)
>>>     cancel_date = models.DateTimeField(null=True, blank=True)
>>>
>>> I'm wondering if is possible to achieve that using "annotate", something
>>> like that:
>>> (this not work)
>>>
>>> order.objects.annotate(diff=SUB('cancel_date','register_date')).filter(diff__gt=period_threshold)
>>>
>>> or maybe django provides another kind of tool to achieve what i want ?
>>>
>>> Unless I'm misunderstanding what you're looking for, I think this might
>>> suit your needs:
>>> in your model:
>>>
>>> class order(models.Model):
>>>
>>> ...
>>>     def get_active_period(self): return self.cancel_date -
>>> self.register_date active_period = property(get_active_period)
>>> (you may want to add some checking that cancel_date is not null, or that
>>> active_period is not negative but you get the idea)
>>> Then where you need to access that queryset use:
>>> order.objects.filter(active_period__gt=period_threshold)
>>
>> jops ;(, unfortunately the Manager doesn't know what "active_period" is.
>> This is my order model now:
>> class order(models.Model):
>>     [...]
>>     def get_active_period(self):
>>         if self.cancel_date:
>>             return self.cancel_date-self.register_date
>>         else:
>>             return datetime.datetime.now()-self.register_date
>>
>>     active_period = property(get_active_period)
>>     objects = models.Manager()
>>     pending_of_bill = pending_of_billManager()
>>
>> And this is my manager:
>> class pending_of_billManager(models.Manager):
>>     def get_query_set(self):
>>         [...]
>>         return super(pending_of_billManager,
>> self).get_query_set().filter(active_period__gt=threshold)
>> This Works:
>> >>> order.objects.get(pk=1).active_period
>> datetime.timedelta(0, 8347, 24949)
>> but this doesn't:
>> >>> order.pending_of_bill.all()
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "/usr/lib/python2.6/dist-packages/django/db/models/manager.py",
>> line 117, in all
>>     return self.get_query_set()
>>   File "/home/ucp/trunk/ucp/../ucp/order/models.py", line 15, in
>> get_query_set
>>     return super(pending_of_billManager,
>> self).get_query_set().filter(active_period__gt=threshold)
>>   File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line
>> 549, in filter
>>     return self._filter_or_exclude(False, *args, **kwargs)
>>   File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line
>> 567, in _filter_or_exclude
>>     clone.query.add_q(Q(*args, **kwargs))
>>   File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
>> line 1128, in add_q
>>     can_reuse=used_aliases)
>>   File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
>> line 1026, in add_filter
>>     negate=negate, process_extras=process_extras)
>>   File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py",
>> line 1191, in setup_joins
>>     "Choices are: %s" % (name, ", ".join(names)))
>> FieldError: Cannot resolve keyword 'active_period' into field. Choices
>> are: amendment_invoice, amendment_quota, bill, cancel_date, comment,
>> contracted_pack, discount, entity, forward, htacces, htpasswd, id, included,
>> installed_app, mailman, name, order_disk, order_memory, order_swap, ovz,
>> pack, price, register_date, renew, service, size, system_group, system_user,
>> system_user_related, traffic, virtual_aliase, virtual_user,
>> virtual_user_related, virtualhost
>>
>> What I'm missing ?? why super(pending_of_billManager,
>> self).get_query_set() doesn't know about active_period?
>> Thanks!
>
> Seems that we can't use a property as a queryset 'filter', in other words we
> can't use property like this:
>  order.objects.filter(active_time__gt=whatever)
>
>
> --
> Marc
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@g

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 have though is that people want to upload Word,
Wordperfect, etc. docs. What's the recommended way of handling search
in this case?

Is it possible to get all of the text out of the documents during the
creation of the object for the purpose of indexing? Or would this be a
bad idea?

Is implementing something like Xapian the way to go? It sounds like it
would greatly expand the scope of the project.


Any thoughts on how to go about this would be great. Also, if
something like Xapian is needed, does that greatly limit where I might
be able to host this?

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 the way, just right now I found the way to reference field on filter and
operates with it. It can be achieved using instances of F()

http://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model

it could be more 'elegant' than using an extra filter, all I need is
something like that:

order.objects.filter(Q(cancel_date__isnull=False,
cancel_date__lt=F('register_date') + Threshold)
| Q(cancel_date__isnull=True, register_date__gt=Threshold) )

but i couldn't get working this part: "F('register_date')+Threshold"
,(threshold is a datetime.datetime object, and also 'register_date' field.
Anyone knows the correct way to use instances of F() with date field?



-- 
Marc

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 to run code from many different sources and if they all ran as the same
user, then one django project could monkey patch another one which creates
all kinds of interesting security issues.

Brian

On Thu, Oct 14, 2010 at 4:45 PM, Diederik van der Boor wrote:

> 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
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Brian Bouterse
ITng Services

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Aymerich  wrote:
>
>
> 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 the way, just right now I found the way to reference field on filter and
> operates with it. It can be achieved using instances of F()
>  http://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model
> it could be more 'elegant' than using an extra filter, all I need is
> something like that:
> order.objects.filter(Q(cancel_date__isnull=False,
> cancel_date__lt=F('register_date') + Threshold)
> | Q(cancel_date__isnull=True, register_date__gt=Threshold) )
> but i couldn't get working this part: "F('register_date')+Threshold"
> ,(threshold is a datetime.datetime object, and also 'register_date' field.
> Anyone knows the correct way to use instances of F() with date field?
>
> --
> Marc
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
> again checks it after somedays and compares them.For this purpose I
> need to store the page data on these 2 occassions in my program  .
> 
> How can I do this?I can get the page data of current moment as a
> string using urllib.urlopen and store it in a variable, say
> current_page_data.But ,how do I store yesterday's data so that I can
> compare the two?Do I need to store it as a field in database?(I am not
> very familiar with database programming..I am using postgres for web
> app development with django.So I don't know if storing such a large
> string like that is possible).
> 
> I considered writing the data to a file..but suppose a lot of users
> want to do the comparison of 2 versions of many pages..?I would be
> creating so many files =usercount * number_of_url_by_each_user  .If
> the time duration between 2 comparisons was some seconds/minutes then
> I can just use 2 local variables andmay not need persistence.But ,to
> compare data of yesterday and today  I may need some such mechanism..
> I guess this may be  a common problem and there may some solution for
> this.
> Can someone comment/suggest how this can be done?
> thanks
> jim
> 
> -- 
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 you have to manage the linux box, but if you have to
manage many small sites, i would recommend GAE.
Best for deploying and managing(non sysad work) them without any hassles.

-V-
http://twitter.com/venkasub

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 :
>
> > 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 group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Antoni Aloy López
> Blog:http://trespams.com
> Site:http://apsl.net

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 have one wsgi per site.
-- 
regards
Kenneth Gonsalves

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: python highlighting in text input field

2010-10-14 Thread Antoni Aloy
http://www.cdolivet.com/index.php?page=editArea&sess=106bb5f73b60725d9a1657c4b0e42ca4

This a javascript code editor. Perhaphs it would give you another 40%

2010/10/15 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 :
>>
>> > 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 group, send email to 
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/django-users?hl=en.
>>
>> --
>> Antoni Aloy López
>> Blog:http://trespams.com
>> Site:http://apsl.net
>
> --
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.