Re: Saving Oracle Connection across requests

2009-09-14 Thread Rafael Ferreira
If you are on 11g you can try to use this:
http://www.oracle.com/technology/tech/oci/pdf/oracledrcp11g.pdf

otherwise you can look for something like mysqlproxy for oracle (if such
thing exist).

The real question here tho is why do you care so much about reusing
connections? I can tell you that connection pooling is not all that is
cracked up to be.

- raf

On Mon, Sep 14, 2009 at 6:18 AM, lfrodrigues  wrote:

>
> Hello,
>
> I'm not sure this is possible but I would to save a oracle connection
> across several requests (like I do with a normal object)
>
> I would like to:
>
> if 'object' in request.session:
>  do stuff
> else:
>  import cx_Oracle
>  conn = cx_Oracle.connect(constring)
>  request.session['object'] = conn
>  do stuff
>
> Since this doesn't work I thought about a global variable on
> settings.py but that only works on de dev server. Apache uses multiple
> processes so the global variable has different values depending of the
> process.
>
> Any ideas how to keep a persistent connection across requests?
>
> 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-users@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: interaction of django with paypal

2009-08-30 Thread Rafael Ferreira
you could also use this (I haven't used it myself but looks promising):
http://github.com/johnboxall/django-paypal/tree/master

and it will handle the IPN for you.

- raf

On Sun, Aug 30, 2009 at 9:07 AM, orschiro  wrote:

>
> Hello guys,
>
> first thank you for your suggestions. I have to admit I'm pretty new
> to Django and coding itself, so please be patient with me. *g*
>
> From your the ideas I tried to implement the following one.
>
> > if (None == request.META.get('HTTP_REFERER')):
> > return HttpResponseRedirect(reverse(YOUR VIEW FUNCTION THAT
> > REDIRECT TO DOWNLOAD URL))
> > elif (-1 == request.META.get('HTTP_REFERER')
> > .find(reverse(YOUR VIEW FUNCTION THAT REDIRECT TO
> > DOWNLOAD URL))):
> > return HttpResponseRedirect(reverse(YOUR VIEW FUNCTION THAT
> > REDIRECT TO DOWNLOAD URL))
> > elif (request.method == 'POST'):
>
> But I think it would be better to show you my complete views.py
>
> http://pastebin.org/13392
>
> And for the sake of completeness my urls.py
>
> http://pastebin.org/13391
>
> After starting the development server I receive the error message:
>
> IndentationError at /
>
> ('unindent does not match any outer indentation level', ('/home/
> orschiro/projects/test/download/views.py', 13, 50, "\telif (-1 ==
> request.META.get('HTTP_REFERER')\n"))
>
> If this approach isn't working I may try your other suggestions but as
> I'm quite a newbie I'm happy about all detailed help I can get.
>
> Once again thanks for your help.
>
> orschiro
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django scalability with files

2009-08-27 Thread Rafael Ferreira
The queue idea is a good one, and you can use Gearman to do that really
easily. Another, even simpler, way to handle this is to use some kind of
shared NFS mount for the storage. All things being equal, scaling a filer or
SAN will be much easier than scaling your DB, specially if - like most
similar cases I've seen in the past - most of you db becomes blob data.

On Thu, Aug 27, 2009 at 8:32 AM, David De La Harpe Golden <
david.delaharpe.gol...@ichec.ie> wrote:

>
> Lewis Taylor wrote:
>
> > Is there a better solution django offers, and why are
> > blobs not supported. ideally i would have the image stored in DB and
> > that way there would never be sync issues.
> >
>
> FWIW (which given you're concerned about scaling mightn't be all that
> much), it's fairly straightforward to stash small to middling sized*
> binary stuff naively to a database rather than fs without even writing a
> full custom file storage backend: just base64 encode it to text (using a
> postgres bytea would be preferable, but BinaryField or whatever isn't in
> Django yet, so my get_internal_type returns "TextField").
>
> e.g. (...not efficient (watch it slurp the whole thing into memory),
> some might say pretty dumb):
> http://python.pastebin.com/d1c577e71
>
> * postgres text and bytea go up to 1GB IIRC.
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Logging mechanism in Django

2009-08-17 Thread Rafael Ferreira
the problem is that logging to a file is not going to work in a multiprocess
environment. I'm using the logging library configured to log to syslog with
fcgi and it is working out quite well.

On Mon, Aug 17, 2009 at 11:10 AM, Mike Ramirez  wrote:

> On Monday 17 August 2009 10:24:18 am Lokesh Maremalla wrote:
> > Hi,
> >
> > Included django-logging as described in the link.
> >
> > From the django-logging I can view the log messages on the screen at run
> > time. But, I am not sure on saving the log messages from django-logging.
> > Can I capture the log messages into my log file on a daily basis instead
> of
> > redirecting to screen.
> >
> > Regards,
> > Lokesh
> >
> you would set up the file access similar to using the python logging module
> [1]
>
> import logging
> logging.FileHandler('myfile')
>
>
>
> Mike
>
> [1]
>
> http://www.mechanicalcat.net/richard/log/Python/Simple_usage_of_Python_s_logging_module
>
> This is also linked on django-logging's overview page.
>
> --
> "Hard work now leads to less work full stop"
>
>- Alan Cox
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---