Re: Why does django use mysqldb over mysql-connector?

2014-11-03 Thread lzanuz
Hi all, I notice that python-mysql-connector(1) is almost 30% slow that MySQLdb(2), but MySQLdb until now not support python3. Anyone have news when MySQLdb will support python 3 or know another connector for mysql? It's a litte confused at this time, because we have django1.7.X that support

Re: Multiple site package directories for Python and question about apache configuration

2014-11-03 Thread Aliane Abdelouahab
On linux, python installs libs in diffferents places: for example in open suse, when you install it the first time, and you choose python and some third party libraries, and then when you will do setup.py for a library you download, they will be in different locations! http://stackoverflow.com/a

Re: Multiple site package directories for Python and question about apache configuration

2014-11-03 Thread robert brook
I overlooked mentioning that the path command returned 2 different locations for the 3 modules. Not sure why one package got installed in the lib64 path. They were all installed with the setup.py install command. On Monday, November 3, 2014 3:18:06 PM UTC-5, robert brook wrote: > > I am buildin

Multiple site package directories for Python and question about apache configuration

2014-11-03 Thread robert brook
I am building the web application on a linux red hat machine. I was trying to pull the path for the site packages for the 3 modules that I have installed so that I can specify the path in the apache config file Can I specify 2 paths in Apache? Thanks >>> import django >>> print (django.__pa

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Aliane Abdelouahab
you can make for example a custom template that you call inside the except. Le lundi 3 novembre 2014 19:59:33 UTC+1, Daniel Grace a écrit : > > Thanks for the information Aliane and Steven, although I still don't know > what to do when handling exceptions in say form_valid of a CBV. How to > re

Re: django-pipeline unable to serve assets

2014-11-03 Thread Marcela Campo
Replying to my own post... I finally realized what I was missing. Going back to the basics I realized I am trying this in dev with runserver instead of through nginx + gunicorn, so basically there was nothing serving the assets. It is working now. On Monday, November 3, 2014 3:25:49 PM UTC-3, M

Re: Multiple versions of python on linux server

2014-11-03 Thread John
On 03/11/14 15:46, robert brook wrote: > This is the first time that I am having apache configured to run django > > I plan on using mod_wsgi on apache and linux using 2 servers, the > apache server and the application server. > > The linux (red hat 6) / django server had python 2.6 installed for

How to handle exceptions if RequestContext fails?

2014-11-03 Thread Daniel Grace
Say I have the following code: logger = logging.getLogger(__name__) def render_error(scr_msg, err_msg, context): logger.debug(err_msg) return render_to_response('error.html', {'message': scr_msg}, context) ... def some_view(): try: context = RequestContext(request) ...

Re: How to handle exceptions in RequestContext?

2014-11-03 Thread Carl Meyer
Hi Daniel, On 11/03/2014 11:53 AM, Daniel Grace wrote: > Say I have the following code: > > try: > context_dict = {} > context = RequestContext(request) > ... > except Exception as e: > return render_to_response('error.html', context_dict, context) > > ...then how do I handle the

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Daniel Grace
Thanks for the information Aliane and Steven, although I still don't know what to do when handling exceptions in say form_valid of a CBV. How to render the error in this case? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fro

How to handle exceptions in RequestContext?

2014-11-03 Thread Daniel Grace
Say I have the following code: try: context_dict = {} context = RequestContext(request) ... except Exception as e: return render_to_response('error.html', context_dict, context) ...then how do I handle the exception without a context? Should I use the render function instead of

django-pipeline unable to serve assets

2014-11-03 Thread Marcela Campo
Hi, I am running into some issues configuring django-pipeline. It is compressing and creating the asset groups as expected when running collectstatic but then I get a 404 error when trying to load them in the app. I've been playing around with paths and settings and I cannot figure out why. Us

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Larry Martell
On Mon, Nov 3, 2014 at 12:42 PM, Leandro Zanuz wrote: > > You can download it on mysql official website: > > http://dev.mysql.com/downloads/connector/python/ Yes, I know that. I am looking for mysqlclient > > > 2014-11-03 15:10 GMT-02:00 Larry Martell : >> >> On Mon, Nov 3, 2014 at 11:13 AM, w

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Larry Martell
On Mon, Nov 3, 2014 at 12:42 PM, Leandro Zanuz wrote: > > You can download it on mysql official website: > > http://dev.mysql.com/downloads/connector/python/ Y > > > 2014-11-03 15:10 GMT-02:00 Larry Martell : >> >> On Mon, Nov 3, 2014 at 11:13 AM, wrote: >> > >> > Yes, mysql-python-connector wo

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Leandro Zanuz
On Debian/Ubuntu I use: apt-get install libmysqld-dev libmysqlclient-dev 2014-11-03 15:17 GMT-02:00 Larry Martell : > On Mon, Nov 3, 2014 at 12:10 PM, Larry Martell > wrote: > > On Mon, Nov 3, 2014 at 11:13 AM, wrote: > >> > >> Yes, mysql-python-connector works fine with python3.4.2. > >> > >

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Leandro Zanuz
You can download it on mysql official website: http://dev.mysql.com/downloads/connector/python/ 2014-11-03 15:10 GMT-02:00 Larry Martell : > On Mon, Nov 3, 2014 at 11:13 AM, wrote: > > > > Yes, mysql-python-connector works fine with python3.4.2. > > > > I'm using it and no problems until now.

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Larry Martell
On Mon, Nov 3, 2014 at 12:10 PM, Larry Martell wrote: > On Mon, Nov 3, 2014 at 11:13 AM, wrote: >> >> Yes, mysql-python-connector works fine with python3.4.2. >> >> I'm using it and no problems until now. > > Thanks for the reply. Do you know where I can download it from? Oh, wait - you're talk

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Larry Martell
On Mon, Nov 3, 2014 at 11:13 AM, wrote: > > Yes, mysql-python-connector works fine with python3.4.2. > > I'm using it and no problems until now. Thanks for the reply. Do you know where I can download it from? > > > Em segunda-feira, 3 de novembro de 2014 13h55min25s UTC-2, > larry@gmail.com

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread lzanuz
Yes, mysql-python-connector works fine with python3.4.2. I'm using it and no problems until now. Em segunda-feira, 3 de novembro de 2014 13h55min25s UTC-2, larry@gmail.com escreveu: > > So it seems MySQLdb doesn't support python3, and I see this on the django > site: > > mysqlclient is a

Re: Multiple versions of python on linux server

2014-11-03 Thread robert brook
I understand the difference between a virtual machine and a virtual environment (of which I can have 0 - many environments on one virtual machine). Since I do not have conflicts in packages and am only using python 33 for the django packages, the 2 environments act as if they were 2 virtual m

Re: Multiple versions of python on linux server

2014-11-03 Thread Tim Chase
On 2014-11-03 08:07, robert brook wrote: > I do not have the luxury to create a virtual environment because of > the constraints of this organization. Just making sure that you're aware of the difference between a virtual environment and a virtual machine. A virtual machine is a full abstraction

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Larry Martell
On Mon, Nov 3, 2014 at 10:59 AM, Andreas Kuhne wrote: > > 2014-11-03 16:54 GMT+01:00 Larry Martell : >> >> So it seems MySQLdb doesn't support python3, and I see this on the django >> site: >> >> mysqlclient is a fork of MySQLdb which notably supports Python 3 and >> can be used as a drop-in repla

[Job] CTO and Django developer required

2014-11-03 Thread Steven Davidson
Hello all, We are looking for two experienced Django developers, one of whom will also be the company CTO. The jobs (in London, UK) offer many interesting opportunities including the analysis of large datasets, natural language processing and developing scalable web solutions. More details a

Re: Multiple versions of python on linux server

2014-11-03 Thread robert brook
Thanks I think this is the correct track. I do not have the luxury to create a virtual environment because of the constraints of this organization. But I see from the documentation link that you sent me that I can define something along these lines "Once the baseline Python environment has be

Re: django1.7, python3.4 and MySQL

2014-11-03 Thread Andreas Kuhne
2014-11-03 16:54 GMT+01:00 Larry Martell : > So it seems MySQLdb doesn't support python3, and I see this on the django > site: > > mysqlclient is a fork of MySQLdb which notably supports Python 3 and > can be used as a drop-in replacement for MySQLdb. At the time of this > writing, this is the rec

Re: Multiple versions of python on linux server

2014-11-03 Thread Andreas Kuhne
2014-11-03 16:46 GMT+01:00 robert brook : > This is the first time that I am having apache configured to run django > > I plan on using mod_wsgi on apache and linux using 2 servers, the apache > server and the application server. > > The linux (red hat 6) / django server had python 2.6 installed

django1.7, python3.4 and MySQL

2014-11-03 Thread Larry Martell
So it seems MySQLdb doesn't support python3, and I see this on the django site: mysqlclient is a fork of MySQLdb which notably supports Python 3 and can be used as a drop-in replacement for MySQLdb. At the time of this writing, this is the recommended choice for using MySQL with Django. mysqlclie

Multiple versions of python on linux server

2014-11-03 Thread robert brook
This is the first time that I am having apache configured to run django I plan on using mod_wsgi on apache and linux using 2 servers, the apache server and the application server. The linux (red hat 6) / django server had python 2.6 installed for admin purposes out of the box.. Go figure, 2.6

Re: Model Manager QuerySet over-ride class not working as expected

2014-11-03 Thread rmschne
Collin, Thanks ... no I'm not saying that as I did do any assert statements. When I add that to the main calling programme, it fails with an "Assertion Error". Having not used assert statements before, I'm not sure what that means. Can you help? What I am saying is that when from the callin

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Steven Cummings
It sounded like you wanted to show something to the user, but don't keep the info from yourself as well (with respect to monitoring the site). So use the django messages framework to tell them something when wrong (not the exception details), or if you can't even render the attempted workflow then

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Daniel Grace
OK, say if I have a function based view then how do I handle the exception? try: context = RequestContext(request) context_dict = {} ... return render_to_response('my_file.html', context_dict, context) except Exception as e: # what to do here? What about class based views (in

Re: Working with requests app

2014-11-03 Thread Jorge Andrés Vergara Ebratt
I checked, it's sending the POST data, but what I need is to redirect the user to the external site WITH the post data... So I think I'm going with the form + hidden fields solution On Mon Nov 03 2014 at 8:13:08 AM Collin Anderson wrote: > Hello, > > >> "This is impossible to redirect a user to

Re: Working with requests app

2014-11-03 Thread Collin Anderson
Hello, > "This is impossible to redirect a user to external site with post. > urllib and urllib2 can only help to fetch data, but not to redirect a > user." You can't do a 301 or 302 http redirect, but I don't think that's what you're trying to do. Anyone knows if that's really the case? I

Re: Working with requests app

2014-11-03 Thread Jorge Andrés Vergara Ebratt
Nope, no good. I was looking to see if there was something like this posted in the group before and there was, I found this answer from 2009: "This is impossible to redirect a user to external site with post. urllib and urllib2 can only help to fetch data, but not to redirect a user." Anyone kno

Re: Model Manager QuerySet over-ride class not working as expected

2014-11-03 Thread rmschne
Daniel, Gosh. Tail between legs. Clearly, my eyes aren't what they used to be. Not, and should have been, using my Retina screen for this work! Well spotted. Yes this is real code (edited down). Yes, I have "g" in the real code rather than a "q". When I fixed that (global fixing 62 errors), all

Re: Model Manager QuerySet over-ride class not working as expected

2014-11-03 Thread Daniel Roseman
On Sunday, 2 November 2014 18:12:10 UTC, rmschne wrote: > > I've upgraded to Django 1.7.1 > > Following the upgrade most (haven't tested all, but for all tested this > true) the over-rided queryset is not functioning. > > when the code calls > qs=Member.Active_objects.all() > > then all member

Re: How not to explicly write very very big json object when rendering page in django template ?

2014-11-03 Thread Matlau Issu
Thank you for your help. I need all the data. Le lundi 3 novembre 2014 00:41:43 UTC+1, Vijay Khemlani a écrit : > > Do you really need all the data in that dictionary for the page? You could > request the necessary parts by AJAX after the page has loaded. > > On Sun, Nov 2, 2014 at 6:59 PM, Matla

Re: Model Manager QuerySet over-ride class not working as expected

2014-11-03 Thread rmschne
Colin, Thanks... no, I'm saying anything about an "assert" statement as I did not use it. I'm saying that : when I call the main class object ("class Member"), the return is all records in the database (as expected). : when I call the custom subclass object (class MemberActive), I expect a fi