Re: Django Python OSError No such file or directory but file exists

2017-08-07 Thread François Schiettecatte
See:


https://stackoverflow.com/questions/8953119/python-waiting-for-external-launched-process-finish

François

> On Aug 7, 2017, at 2:35 PM, Ronaldo Bahia  wrote:
> 
> How can I do that?
> 
> Ronaldo Bahia
> +55 11 3280 6971
> +55 11 963 622 581
> 
> Materiais gratuitos para o RH:
> - ROI - Melhorando Indicadores no RH
> - Manual do Recrutador Moderno
> 
> 2017-08-07 18:32 GMT-03:00 "Александр Христюхин (roboslone)" 
> :
> You can wait for subprocess to finish and not rely on time.sleep.
> 
>> On 7 Aug 2017, at 23:57, Ronaldo Bahia  wrote:
>> 
>> Turns out unoconv takes 2 seconds to perform the file conversion.
>> So after the file conversion, I had to set time.sleep(3) before upload a 
>> file to S3.
>> 
>> And after 1 week I got this working using variables.
>> 
>> Thanks
>> 
>> Ronaldo Bahia
>> +55 11 3280 6971
>> +55 11 963 622 581
>> 
>> Materiais gratuitos para o RH:
>> - ROI - Melhorando Indicadores no RH
>> - Manual do Recrutador Moderno
>> 
>> 2017-08-07 17:17 GMT-03:00 Ronaldo Bahia :
>> I don't know why but if I set the string ("cv.pdf"), it process just fine.
>> If I use a variable instead, it doesn't.
>> 
>> Here is the working code:
>> 
>> # convert to PDF
>> env = os.environ.copy()
>> env['HOME'] = '/tmp'
>> subprocess.Popen(["unoconv","-f", "pdf", "-o", "cv.pdf","%s" % 
>> (file_in)], env = env)
>> 
>> # Define S3 path
>> resume_path = 'resumes/%s/' % str(date.today())
>> 
>> # key is the S3 file name
>> key = '%s%s' % (resume_path, file_out)
>> 
>> # delete local file
>> subprocess.call("rm -f %s" % user_cv_file, shell=True)
>> 
>> # update the new file format
>> user_cv.resume = key
>> user_cv.save()
>> 
>> # S3 Connection
>> conn = S3Connection(settings.AWS_ACCESS_KEY_ID, 
>> settings.AWS_SECRET_ACCESS_KEY)
>> bucket_out = Bucket(conn, settings.AWS_STORAGE_BUCKET_NAME)
>> k_out = Key(bucket=bucket_out, name=user_cv.resume)
>> 
>> # Upload to S3
>> k_out.set_contents_from_filename('cv.pdf')
>> k_out.make_public()
>> 
>> # deleta o arquivo localmente
>> subprocess.call("rm -f cv.pdf", shell=True)
>> 
>> Ronaldo Bahia
>> +55 11 3280 6971
>> +55 11 963 622 581
>> 
>> Materiais gratuitos para o RH:
>> - ROI - Melhorando Indicadores no RH
>> - Manual do Recrutador Moderno
>> 
>> 2017-08-07 8:16 GMT-03:00 "Александр Христюхин (roboslone)" 
>> :
>> Well, yeah, you're using local path basically. And you should NEVER use 
>> .split('/')[-1] to determine file basename, take a look at os.path module 
>> instead.
>> 
>> But that's not the point. You should try to use absolute path, I believe it 
>> would do the trick.
>> 
>>> On 4 Aug 2017, at 17:49, Ronaldo Bahia  wrote:
>>> 
>>> the method is called in a def post() within a class view:
>>> 
>>> user_cv = CandidateCV.objects.get(user=request.user)
>>> user_cv_file = str(user_cv.resume).split('/')[-1]
>>> s3upload(user_cv_file)
>>> 
>>> The file is converted from doc to pdf in server project folder, where 
>>> manage.py is.
>>> So probably there is no absolute path.
>>> 
>>> How can I solve it?
>>> 
>>> Thanks
>>> Ronaldo Bahia
>>> +55 11 3280 6971
>>> +55 11 963 622 581
>>> 
>>> Materiais gratuitos para o RH:
>>> - ROI - Melhorando Indicadores no RH
>>> - Manual do Recrutador Moderno
>>> 
>>> 2017-08-03 1:36 GMT-03:00 "Александр Христюхин (roboslone)" 
>>> :
>>> Hi,
>>> 
>>> Are you sure s3file contains absolute path? I can't see where s3upload is 
>>> being called.
>>> 
>>> Also, you might wanna use os.remove instead of calling subprocess.
>>> You also might wanna check out PEP-8 and Sphinx for your docstrings.
>>> 
 On 2 Aug 2017, at 02:28, Ronaldo Bahia  wrote:
 
 Hi everyone, can you help me?
 Thanks in advance
 
 Thread: 
 https://stackoverflow.com/questions/45449102/django-python-oserror-no-such-file-or-directory-but-file-exists
 
 Code:
 
 
 
 down vote
 favorite
 I'm converting doc and docx files to pdf in the server using unoconv with 
 LibreOffice. And I need to upload to S3 the converted file.
 
 I can convert with success the files and I can see them in the server.
 
 But when I try to upload the pdf, I get the error. What am I missing?
 
 Thanks in advance
 
 This works just fine:
 
 import
  subprocess
 
 from boto.s3.connection import S3Connection, Bucket, Key
 
 
 
 def doc_to_pdf(user):
 
 
 '''
 Convert doc or docx to PDF.
 
 parameter user: is a request.user
 
 Usage:
 doc_to_pdf(self.request.user):
 '''
 
 
 user_cv 
 = 

Re: serving over either 80 or 443

2017-07-19 Thread François Schiettecatte
This tells you whether the request is secure or not:


https://docs.djangoproject.com/en/1.11/ref/request-response/#django.http.HttpRequest.is_secure

You could set a flag in the context you pass your templates.

And what about stripping 'https://0.0.0.0:443/‘ from the url, just use 
‘/static/file.css'

François


> On Jul 19, 2017, at 1:55 PM, Larry Martell  wrote:
> 
> This is probably not strictly a Django question, but I'm hoping
> someone here has had to solve this before.
> 
> We have a django app that is sometimes deployed in an environment with
> SSL and talks over port 443, and other times is deployed in a non-SSL
> environment and talks over port 80.  In our templates we serve CSS and
> JS files with this: href="https://0.0.0.0:443/...; When running over
> port 80 that does not work. Is there a way to tell in the template if
> we are using port 80 or 443 and adjust the href accordingly?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CACwCsY61p7F%3DH5BYR3tKnFpDE6mdW%2BSV_QsJVHY%3DvsZDa2Yk6Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/DF79CE98-280F-4AC0-B98F-328871055365%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Produces Python?

2017-03-25 Thread François Schiettecatte
The purpose of a framework is so that you don’t have to write it yourself.

François

> On Mar 25, 2017, at 9:46 PM, Ed Sutherland  wrote:
> 
> Wow. I had thought Django as an assistant to build python projects. If I need 
> the framework along with whatever language, it seems like immense code-bloat. 
> What, then, is the purpose of using frameworks?
> 
> 
> 
>  On Sat, 25 Mar 2017 23:30:45 -0400 Lachlan Musicman  
> wrote 
> 
> It will needs the Django as well. Think of them as layers - at the bottom is 
> the OS, then there is python. Django sits on Python. Your project sits on 
> Django. Can't remove a layer.
> cheers
> L.
> 
> --
> The most dangerous phrase in the language is, "We've always done it this way."
> 
> - Grace Hopper
> 
> On 26 March 2017 at 14:19, Ed Sutherland  wrote:
> 
> 
> 
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAGBeqiMJo1ER7TFH2%3DGTLtvO%3Ds8ETKEGpYsUFCpVFOD_k_h4dA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> Forgive me if this question is too basic, but I'm a relative newbie to 
> programming frameworks. As I understand it, a framework is built to abstract 
> common tasks within the native language (Python, PHP, Ruby, etc.) When 
> development using a framework is complete, will the production version of the 
> app still require the framework? For instance, would an app developed with 
> Django need only Python, or the entire programming framework? (I haven't seen 
> a suitable answer after searching.)
> 
> 
> 
> 
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/15b089fd407.b63a65c5111765.2626315058617697641%40tburgnews.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/15b08efd9bb.fb7e1aec112788.7061965930651567288%40tburgnews.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/43440416-1154-45FE-BBA5-DD8228EE557B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to integrate a python algorithm in a Django website

2017-02-15 Thread François Schiettecatte
David

You don’t say which platform you are on, I use linux so use cron for this, 
works very well.

François

> On Feb 15, 2017, at 10:51 AM, david ekchajzer  wrote:
> 
> Hello,
> 
> 
> I am a novice in web programming. Knowing well python I turned to Django. I 
> am on a project where I have to retrieve data from a form and then process 
> them every week. More precisely, I want to apply an algorithm (python) that 
> allows to classify people with different criteria in different lists and then 
> send those lists by mail. I want this 
> algorithm 
> to run each week. But I do not see how I could integrate this algorithm into 
> my site.
> 
> thank you in advance
> 
> Waiting to read you
> 
> 
> 
> 
> David
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/0baeebc4-46e5-447b-8499-ed19dd50e03a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39B62374-84C2-488A-BF31-0FEBAFA142DF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error since added SSL certificate

2016-12-26 Thread François Schiettecatte
Most likely a bot testing for vulnerabilities or badly coded crawlers.

I get them and I ignore them. Django requires a proper ‘Host’ HTTP header and 
it is doing its job rejecting the request if it is not there.

François

> On Dec 26, 2016, at 2:34 PM, James Hargreaves  
> wrote:
> 
> Merry Christmas everyone!
> 
> I eel recently added an SSL certificate to my domain where the application is 
> hosted with Django.
> 
> Since I setup the SSL certificate I've been receiving a lot of errors like 
> this:
> 
> SuspiciousOperation: Invalid HTTP_HOST header (you may need to set 
> ALLOWED_HOSTS): AAA.BBB.CCC.DDD
> 
> Where AAA.BBB.CCC.DDD is the IP address of my server - ie- I'm getting a lot 
> of requests direct to the IP of the server.
> 
> Can anyone suggest why these requests have been coming in? I can't see 
> anything in the request suggesting where these requests are coming from.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/6bc9859f-d452-4175-9a94-a17c7c837232%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D529B03A-B70E-450E-9243-AF8EF6FF5293%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using version control with django

2016-08-23 Thread François Schiettecatte
I would add a +1 for git, I started off with svn and switched to git, branching 
and merging is much easier which really helps when you want to test ideas.

François

> On Aug 23, 2016, at 5:22 PM, Gergely Polonkai  wrote:
> 
> Hello,
> 
> the fact you develop alone doesn't make SVN a better choice than Git, 
> Mercurial, or any other distributed version control. But as you already made 
> your choice, here are my two cents.
> 
> You should put all the stuff under trunk/, so it becomes trunk/manage.py, 
> trunk/crm/, etc. If you are developing for multiple customers, the branches 
> and tags directory may come in handy later. Also, it's nothing but naming 
> convention: you can call these directories dog/, Pete/, and ananas/. But 
> that’s more for a Subversion user list, not Django.
> 
> On the other hand, you definitely should choose a distributed version control 
> if you are working alone. For example, Git, Mercurial and Fossil repositories 
> are self contained, which means the whole development history is located 
> right where you work. If you decide to publish (or just backup) your work, 
> all you need to do is to add a new remote. With SVN, it's hard to publish 
> somewhere else than before (read: it’s a real PITA to migrate SVN history 
> from one server to another).
> 
> Best,
> Gergely
> 
> 
> On Tue, Aug 23, 2016, 21:42 Rich Shepard  wrote:
>I want to track django projects with subversion. (Single developer, local,
> so svn is better suited than the distributed git and mercurial.) I'd like
> advice on how to lay this out vis-a-vis the django layout.
> 
>Project overall root is ~/development/crm-project. This directory
> contains:
> 
> Makefile  README  crm-project/  docs/  manage.py*  requirements.txt
> 
>The top-level project directory is the same-named crm-project, and this
> contains:
> 
> __init__.py   __pycache__/  settings.py   urls.py
> __init__.pyc  crm/  settings.pyc  wsgi.py
> 
>The app directory is crm/.
> 
>So, where should I place trunk/, tags/, and branches/ be created? If
> they're in the overall project root (~/development/crm-project/) should I
> then move that directory's contents into the newly made trunk/ subdirectory?
> 
>I find nothing in my web searches for using svn with django. Perhaps my
> web foo is insufficient.
> 
> Rich
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CACczBUJ3apCi5pgsm%3D768HA3dU0-%3DL%2B8Q16fgTaMjKXttRMuTg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D5B83A74-F704-4722-A6E6-AACF7FE30D64%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use django.contrib.postgres.forms widgets in the admin site

2016-08-16 Thread François Schiettecatte
Go to the group web page at :

https://groups.google.com/group/django-users

Click on the My Settings icon (human figure and gear icon, top right) and click 
‘Leave this group’

François


> On Aug 16, 2016, at 6:28 AM, Elizabeth Mawer  
> wrote:
> 
> Hi
> 
> I accidentally got signed up with this group and actually don't want to 
> receive emails.
> How do I unsubscribe?
> At the bottom of this email it says: To unsubscribe from this group and stop 
> receiving emails from it, send an email to 
> django-users+unsubscr...@googlegroups.com.
> But when I have used that email it is invalid, so I continue to receive 
> dozens of emails?
> 
> Any ideas?
> 
> Thanks,
> Liz
> 
> 
> From: django-users@googlegroups.com  on behalf 
> of Jay Sheldon 
> Sent: 16 August 2016 08:55
> To: Django users
> Subject: How to use django.contrib.postgres.forms widgets in the admin site
>  
> Hi there,
> 
> I just recently updated my database to postgres, looking to play with the 
> django supported field types HStoreField and JSONField (reference: 
> https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/ )
> 
> I got the install working fine, but in my admin section - the widgets that 
> come with HStoreField is not appearing (reference: 
> https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/forms/ )
> 
> I cant see to figure out how to get the admin side to use the widget for 
> HStoreField.
> 
> Any ideas?
> 
> Thank you very much,
> Jay
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/ce96dfbc-765d-4fb8-9ea8-9c6b3fa5017c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/VI1PR07MB14708EEBB3B8CBB3C3DB6DEFC3130%40VI1PR07MB1470.eurprd07.prod.outlook.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B6918EDB-AA0E-453A-9A67-A6D7C242B057%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django API CSRF Issues - Need Help

2016-05-21 Thread François Schiettecatte
Is this what you are looking for:

https://docs.djangoproject.com/en/1.9/ref/csrf/

François


> On May 21, 2016, at 10:09 AM, Chris Troutner  wrote:
> 
> Yes, you're right that there is something confusing going on. I confess I 
> don't know much about CSRF or authentication or Django. Because of that, I'm 
> sure I presented it in a confusing way. That's all Bob's side of the stuff. 
> 
> I'm just trying to get my front end JavaScript to interact with the Django 
> server side API and the key to doing that is to pass in the CSRF token in a 
> way that makes Django happy. So far, I haven't figured out how to do that.
> 
> -Chris
> 
> 
> On Saturday, May 21, 2016 at 2:16:17 AM UTC-7, Daniel Roseman wrote:
> On Saturday, 21 May 2016 02:36:15 UTC+1, Chris Troutner wrote:
> Hey all,
> 
> This is my first time posting to the group. I'm working with Bob Hagan on the 
> Network Resource Planning (NRP) project. The platform runs on Django and he's 
> been using the REST API app to open up ports to some of the pieces of the 
> software. Right now we're working on an interface for creating new users, 
> which requires the passing of a CSRF token for authentication. I'm having a 
> heck of a time and we can't figure out if the issue is something set up on 
> the server or on my front end code. I'm hoping that the issue might be 
> obvious to someone here. 
> 
> First of all, you can access the Django API code in the repository code here:
> https://github.com/valnet/valuenetwork/tree/master/valuenetwork/api
> 
> My front end code is written in JavaScript can be viewed in it's own 
> repository here:
> https://github.com/christroutner/rpiovn/blob/unstable/public/js/app/views/NRPUsersView.js
> 
> This video gives a visual overview of the user interface and the general 
> issues I'm experiencing:
> https://youtu.be/vaYCLmsi_hM
> 
> 
> NRPUsersView.js is a Backbone.js View file. If that doesn't mean anything to 
> you, that's OK. The important thing to notice is the three different ways I 
> tried to access the API.
>   • I use JavaScript to fill out an HTML form. This is currently the only 
> way that works at the moment.
> 
>   • A typical AJAX POST submission
> 
>   • A JavaScript Virtual Form using the FormData object.
> Method 3 should be identical to method 1 as far as the server is concerned, 
> but the HTTP headers are slightly different. Like I said, methods 2 and 3 are 
> not working out. I've tweaked the code every which way and I always get a 
> "403 FORBIDDEN Authentication credentials were not provided" message.
> 
> According to this Django documentation, there are three possible locations to 
> put the CSRF token:
>   • In the document.cookie
> 
>   • In the HTTP header preceded by "X-CSRFToken"
> 
>   • And a hidden input field in the form
> 
> I've tried every combination of the three options for passing the CSRF token 
> and haven't had any luck.
> 
> 
> Has anyone had experience implementing this type of API authentication with 
> Django before? Any help you can provide would be appreciated.
> 
> 
> There's something a bit confused here. CSRF is not for authentication, and 
> has nothing to do with it at all; it's a method of preventing a certain class 
> of hack that would permit an attacker to hijack a user's session credentials. 
> It really can't be used to authenticate a user for your API; there are plenty 
> of other token-based ways of doing this.
> -- 
> DR.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/1c7788e8-1567-4dcd-9cac-24a518ab7efa%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3ED7FCFD-3B79-4576-B85F-9788E41D3781%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why redirects to foo.com/?next=/some/folder show up as foo.com/?next=%2Fsome%2Ffolder in browser? (i.e. how remove the %2F's? )

2016-04-23 Thread François Schiettecatte
Because the slashes are escaped, this is normal as they are a parameter and not 
part of the path itself.

François

> On Apr 23, 2016, at 2:47 PM, Chris Seberino  wrote:
> 
> Why redirects to foo.com/?next=/some/folder show up as 
> foo.com/?next=%2Fsome%2Ffolder in browser?  (i.e. how remove the %2F's? )
> 
> Is there a function I can call on URLs built in a view to avoid that?
> 
> cs
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/137f689f-306d-4528-82cd-03413b747f2c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/03FC111A-7422-4A60-A7E3-CC270389E3DA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SMTP AUTH extension not supported by server

2016-01-15 Thread François Schiettecatte
See this:

https://groups.google.com/forum/#!msg/django-users/w-fqKimJZH4/h1G0Lj2t0iIJ

Also plenty of other suggestions if you google for 'django  google smtp 
authentication’

Best regards

François

> On Jan 15, 2016, at 3:43 AM, achrefsaket2...@gmail.com wrote:
> 
> bnj
> 
> je suis bloqué  depuis deux jours sur un problème d'envoie d'un mail avec 
> django
> 
> enfaite j'ai tous fait a l'aide de documentation django
> 
> settings.py
> 
> EMAIL_USER_TLS = True
> EMAIL_HOST = "smtp.gmail.com"
> EMAIL_HOST_USER='blabla2...@gmail.com '
> EMAIL_HOST_PASSWORD = 'blabla2016'
> EMAIL_PORT = 587
> 
> 
> views.py
> 
> 
> form = ContactForm (request.POST ou Aucun)
>   if form.is_valid ():
>   
>   email = form.cleaned_data.get ("email")
>   message = form.cleaned_data.get ("message")
>   full_name = form.cleaned_data.get ("full_name")
> 
>   subject = "Mail de django"
>   from_email = settings.EMAIL_HOST_USER
>   to_email = [from_email]
>   contact_message = "% s:% s de VIA%" l'% (
>   nom complet,
>   message,
>   email
>   )
> 
> 
>   send_mail (sous réserve, contact_message, from_email, to_email, 
> fail_silently = False)
> 
> 
> 
> est voici l’erreur qui se produite 
> 
> 
>  Extension de SMTP AUTH pas supporté par le serveur
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/64c2b563-86c4-4489-9233-9dc0833edac4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9502ADD2-793B-400B-9114-3261619D0212%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: excel file upload to MySQL database

2016-01-14 Thread François Schiettecatte
Why don’t you try and see.

François

> On Jan 14, 2016, at 4:52 AM, girija sameera  wrote:
> 
>  Ok will see that. Also I found this 
> http://django-excel.readthedocs.org/en/latest/
> 
> Do you think it would work?
> 
> Thank you.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/447f8e90-5daf-44c9-a376-e4fed8208972%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D8DA4A4B-AD87-4A86-BAB2-8D53621CAF3E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: excel file upload to MySQL database

2016-01-13 Thread François Schiettecatte
You can also use xlrd to open .xls files if needed:

https://pypi.python.org/pypi/xlrd

François

> On Jan 13, 2016, at 10:48 AM, Larry Martell  wrote:
> 
> On Wed, Jan 13, 2016 at 9:26 AM, girija sameera  
> wrote:
>> 
>> Hello,
>>  I am  a Django beginner working on a web application wherein I am required 
>> to provide back-end support. I am expected to take an excel file uploaded by 
>> the admin from the template , parse the file using available Django 
>> libraries and upload it to MySQL database . Also  bulk upload of files needs 
>> to be supported.
>> 
>> I would like some suggestions on how to proceed.I would really appreciate 
>> links to tutorials and websites.
> 
> This is something you'd typically do on the server side from python.
> You can use a lib like openpyxl for that
> (https://pypi.python.org/pypi/openpyxl)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CACwCsY4pRdid9H1_XVrF1mVGfPkOz%2Bs4z1-a1aVmpVb2zZrEzg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/57E82E9F-CA4F-4A02-831C-B7014A665A73%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Could not parse the remainder template inheritance

2016-01-02 Thread François Schiettecatte
And if  you like it you should just buy BBEdit from BareBones, been using it 
for years, it’s great.

François

> On Jan 2, 2016, at 11:13 AM, Lee Hinde  wrote:
> 
> If you’re just getting your feet wet and don’t want to invest in an 
> editor/IDE just yet, try TextWrangler: 
> http://www.barebones.com/products/textwrangler/  It’s free and won’t get in 
> your way.
> 
>> On Jan 2, 2016, at 8:11 AM, Matthew  wrote:
>> 
>> Actually it turned out this works!! My TextEdit app was being finnicky and 
>> made me re-write the entire code instead of just the quotation marks. Thanks 
>> for the help!
>> 
>> On Saturday, January 2, 2016 at 10:52:22 AM UTC-5, Matthew wrote:
>> Hi James,
>> 
>> I turned smart quotes off and am still having the error.  I wasn't aware 
>> that could cause future errors though, so thanks for the heads up!
>> 
>> On Saturday, January 2, 2016 at 12:44:22 AM UTC-5, James Schneider wrote:
>> 
>> On Jan 1, 2016 8:08 PM, "Matthew"  wrote:
>> >
>> > Hi all,
>> >
>> > I'm working through the masteringdjango book, and am struggling in the 
>> > Templates area.
>> >
>> > I created a base.html base template, and am attempting to include a child 
>> > template.
>> >
>> > This is the child template:
>> >
>> > {% extends “base.html” %}
>> >
>> > {% block title %}The current time{% endblock %}
>> >
>> > {% block content %}
>> > It is now {{ current_date }}.
>> > {% endblock %}
>> >
>> > When I run the site, I get the following error message: 
>> > Could not parse the remainder: '“base.html”' from '“base.html”'
>> >
>> > And it points to the first line of the child template.
>> >
>> > I don't understand what I am doing wrong, please help.
>> 
>> Was this template code primarily copied/pasted from an example?
>> 
>> Can you try deleting and manually typing new quotes around the base.html 
>> reference in your {% extends %} tag?
>> 
>> Not sure if it's my email client or not, but those appear to be "smart 
>> quotes", which lean left/right, usually automatically inserted by editor 
>> applications like MS Word or possible from a translation from text to PDF to 
>> make things "pretty".
>> 
>> To a computer parser like the Django template system, those are interpreted 
>> differently as regular characters rather than quotes, which would explain 
>> the parser error you are receiving. Hard to spot, but I've been bit by that 
>> type of subtle bug before.
>> 
>> -James
>> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CE45DD84-98D8-406D-A829-CF0C2B7AB86D%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/339C31C4-B7C0-4F23-9E00-0774A432C538%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: update Django

2015-12-15 Thread François Schiettecatte
Such as…?

François

> On Dec 15, 2015, at 5:57 AM, Hugo Cosme  wrote:
> 
> Good morning to all, someone here has already done the update of some version 
> of django, as of 1.5 to 1.8 for example? I'm having some difficulties!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/6c116a52-4224-4857-aeee-f7143422ea98%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/349B1DB9-F01C-4ACC-994C-B4D097B43E17%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANNOUNCE] Django 1.9 released

2015-12-02 Thread François Schiettecatte
I see the error too, no virtualenv or pip here, this is my install sequence:

tar zxf Django-1.9.tar.gz 
cd Django-1.9
python3 ./setup.py build
sudo python3 ./setup.py install

F.

> On Dec 2, 2015, at 5:31 AM, Luke Granger-Brown  wrote:
> 
> On Wed, Dec 2, 2015 at 10:20 AM, Mike  wrote:
> pip install django
> Downloading/unpacking django
>   Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
> Installing collected packages: django
> Compiling 
> /Users/mike/sieve2/SIEVEENV/build/django/django/conf/app_template/apps.py ...
>   File 
> "/Users/mike/sieve2/SIEVEENV/build/django/django/conf/app_template/apps.py", 
> line 4
> class {{ camel_case_app_name }}Config(AppConfig):
>   ^
> SyntaxError: invalid syntax
> Compiling 
> /Users/mike/sieve2/SIEVEENV/build/django/django/conf/app_template/models.py 
> ...
>   File 
> "/Users/mike/sieve2/SIEVEENV/build/django/django/conf/app_template/models.py",
>  line 1
> {{ unicode_literals }}from django.db import models
>  ^
> SyntaxError: invalid syntax
> Successfully installed django
> Cleaning up...
> 
> Anyone else see this error? This was in an new virtualenv.
> It's mentioned in the release notes (specifically at 
> https://docs.djangoproject.com/en/1.9/releases/1.9/#syntaxerror-when-installing-django-with-pip-1-5-6)
>  
> 
>  
> 
> On Tuesday, December 1, 2015 at 7:10:41 PM UTC-5, Tim Graham wrote:
> Django 1.9 is now available:
> 
> https://www.djangoproject.com/weblog/2015/dec/01/django-19-released/
> 
> With the release of Django 1.9, Django 1.7 has reached end-of-life. Django 
> 1.7.11 is the final release of the 1.7 series and all users are encouraged to 
> upgrade to Django 1.8+ as soon as possible so they can continue to receive 
> security updates. Django 1.8 LTS will receive security updates until April 
> 2018. Django 1.4 (the previous LTS) reached end of life on October 1, 2015. 
> See the downloads page [1] for a table of supported versions and the future 
> release schedule.
> 
> [1] https://www.djangoproject.com/download/#supported-versions
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/04e0e7cb-250a-4eae-8745-4832c8f5eb2f%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALE3ZjV-z6wORaLaH4dk1B2FRyHpxC_ttJdaRdoZ9AqHF842gA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/BFEF7F98-695C-4495-967D-14D47D4A4ADA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm a Flask/Android developer in need of advice. Is Django a good fit for my next project: a no-transaction marketplace website/mobile app?

2015-10-25 Thread François Schiettecatte
You might want to look at the Django REST Framework as opposed to Flask given 
that you are already settled on Django:

http://www.django-rest-framework.org

François

> On Oct 25, 2015, at 12:41 PM, Kitti Wateesatogkij  wrote:
> 
> Hi,
> 
> Note: This question is opinion-based, open-ended. If this kind of question 
> should not be asked here, please let me know and I'll delete the post.
> 
> I came here because the phrase "Django is for perfectionist with deadline" 
> caught my attention. As I only have 3-4 months...
> 
> I really need your advice before committing to certain platforms for my next 
> project(s).
> 
> My development experiences:
> 
> - 5 years of native Android development
> - 1-2 Months of Python/Flask
> - 1-2 Months of PostgreSQL
> - 1-2 Months of HTML, CSS, Javascript
> 
> Now I need to complete 2 projects on my own in 3-4 months:
> 
> 1. A used car marketplace where users can list their cars for sale. There'll 
> be some user account and commenting system but no transaction/payment 
> processing.
> 2. A novel reader/writer site. Users can post their novel and some images. 
> Readers are free to read anything they want.
> 
> You see that both projects are very similar: Listing only. No 
> transaction/payment processing.
> 
> Both project requires me to develop:
> 
> - Responsive Website for desktop/mobile browser
> - Android + iOS app
> 
> I choose this after doing some research:
> 
> - Backend = PostgreSQL(JSON data type sounds good?) + Python + Flask REST API
> - Frontend(Responsive Website/Mobile site) = HTML5 + Bootstrap + AngularJS
> - Frontend(Android + iOS) = Ionic (which uses the just-learned AngularJS 
> skill from above. This also eliminate the need to learn Swift/Objective C 
> altogether)
> 
> 
> - QUESTION -
> 
> I'm interested in django if there's a package that fits my requirements so I 
> don't have to do it all manually in Flask. If possible please recommend such 
> packages for me. 
> 
> Thank you.
> 
> Best,
> Kitti
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/15cfbfa7-d38a-4dcf-9407-a1ceb5926091%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/A9B5B93A-234C-4DEA-8BB9-058E2826636D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django

2015-10-13 Thread François Schiettecatte
This does not really make sense? What do you mean?

> On Oct 13, 2015, at 8:06 AM, Anagha R  wrote:
> 
> what is the first steps in fixing an identified web?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/eba006c4-3aaa-416c-a58d-7a525d14b2f8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4C9A980F-D570-49F5-920E-5EE8FB3F738F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Load a static file with a variable name

2015-10-06 Thread François Schiettecatte
The '+' is an error, the line look more like this:



On Tue, Oct 6, 2015 at 2:33 PM, I. Dié  wrote:

> I tried in your way to concatenate, I don't get any exception, but  the
> image image does'nt want to display. The plage only throw the "alt" value.
> Even for this line of code it's thing.
>
>
> Le mardi 6 octobre 2015 19:51:04 UTC+2, Shawn Milochik a écrit :
>>
>> Try this:
>>
>> > pet.name }} />
>>
>> You're embedding {{pet_name}} in a string. If this was a regular Python
>> statement, it would be like writing "Hello, {0}" and not having a format()
>> at the end.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f29da80b-ffe4-421c-9aba-8ad76b87a484%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOhTVJEUZO_EQAoKSb-iSAEMumgc0StGctVYP55RxJoDXUYxww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sending mail using smtp server

2015-09-28 Thread François Schiettecatte
You going to need to set EMAIL_USE_TLS = True, and  EMAIL_PORT = 587.

And you will need to set "Allow less secure apps: ON” on:

https://myaccount.google.com/security?hl=en

because  Google uses OAUTH (I think) and it is beyond the standard SMTP client 
(to the best of my recollection)

François

> On Sep 28, 2015, at 7:26 PM, Mike Dewhirst  wrote:
> 
> Rajat
> 
> In your settings.py file you need to tell Django about your mail server like 
> this ...
> 
> EMAIL_HOST =
> EMAIL_PORT =
> EMAIL_HOST_USER =
> EMAIL_HOST_PASSWORD =
> 
> https://docs.djangoproject.com/en/1.7/topics/email/
> 
> 
> 
> On 29/09/2015 5:07 AM, Rajat Singh wrote:
>> I want to know the how to send mail using google smtp server in django
>> 
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users+unsubscr...@googlegroups.com
>> .
>> To post to this group, send email to django-users@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/162cda54-fe96-4dc5-8c27-a8a17926d1aa%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/5609CC89.9000609%40dewhirst.com.au.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5AC68360-419E-4553-8B53-6787F6799752%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-09-21 Thread François Schiettecatte
Not likely, all that is happening is that you are getting requests where the 
‘Host:’ HTTP header is not set or set to something other than what is accepted 
by your site. Most likely a buggy client. I get that all the time, I just 
ignore it.

Cheers

François

> On Sep 21, 2015, at 6:16 PM, frocco  wrote:
> 
> I am still getting this invalid host from time to time.
> Does this mean that someone is trying to hack my site?
> 
> www.g3suprimentos.com.br is not anything I own.
> 
> For now, I am just ignoring this.
> 
> Thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/a2cac09b-ae37-4b95-a72f-c80c47f24654%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82A273A0-5121-4257-8BC7-9E0BEB039FD5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Google indexing issue

2015-09-01 Thread François Schiettecatte
Shouldn’t you be asking google that? 

I recall they had pretty good tools for diagnosing crawler issues.

Cheers

François

> On Sep 1, 2015, at 1:51 PM, Arindam sarkar  wrote:
> 
> Guys I have submitted to google webmaster couple of days ago but only 1 (one 
> page is indexed so far). I am using django's sitemap app for creating my site 
> map. Any Idea what may be the reason for not getting indexed by google .
> My website link : www.schoolofdevelopers.in
> 
> -- 
> Regards,
> 
> Arindam
> 
> Contact no. 08732822385
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAGnF%2BrDtuAgo-vM99qT-BPuKOkXq7dbj0MnFsy8mkyhHHyDynA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F752E49D-CD2E-4DE3-8A65-633BDCEAADAC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django + microservices: What's correct approach?

2015-08-24 Thread François Schiettecatte
What do you mean by microservices? What are you looking to accomplish.

François

> On Aug 24, 2015, at 3:17 AM, cr0hn  wrote:
> 
> Hi guys,
> 
> I'm investigating about how to use Django as a microservices architecture, 
> but I'm so surprised that I don't found almost information about that.
> 
> Could you help me with some resource, documentation and anything?
> 
> Thanks!
> 
> Cheers
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/dd1cbb4d-65ea-4111-9a67-1130433dfdec%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F81FEC19-53B1-4C05-A6DE-D07B52E83BCF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangocon Costa Rica next year.

2015-08-19 Thread François Schiettecatte
lmgtfy:

https://2015.djangocon.us

Austin, early sept.

Francois

> On Aug 19, 2015, at 8:29 AM, Larry Martell  wrote:
> 
> On Wed, Aug 19, 2015 at 6:37 AM, Russell Keith-Magee
>  wrote:
>> If you're coming to DjangoCon US in a couple of weeks, make yourself known
>> to me and I'll introduce you to the team organising that event - I'm sure
>> they'll have plenty of advice, and maybe even some resources to share.
> 
> When and where is DjangoCon US?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CACwCsY7Gk_MkQWM8pAojAVv%3DZuGTU7vO4hDJ-k-KaxX6_Q3p4w%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/684AB62F-D01F-4D8F-8D13-E67D6E000714%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Security News?

2015-08-18 Thread François Schiettecatte
+1 on this.

And I also follow http://arstechnica.com, they are usually pretty quick.

François

> On Aug 18, 2015, at 5:30 PM, Shawn Milochik  wrote:
> 
> I've been using this source for over 10 years:
> https://www.grc.com/securitynow.htm
> 
> Main page: https://twit.tv/shows/security-now
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAOzwKwFM8Lo_16S%3D6so7j%2BfFFMGSMvHhh7mR0ggMyuEUn-1DbQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E2A172E9-3CD3-461A-B6D9-61F167E4F5BD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Learning Python and Django and should I?? (I have a year of 10 or so hours a week)

2015-08-16 Thread François Schiettecatte
Why not learn both, seriously, spend 6 months learning one and then 6 learning 
the other. Bigger range of skills means you are more marketable. 

François

> On Aug 16, 2015, at 9:45 AM, graeme  wrote:
> 
> A lot of it is a matter of personal preference, and a lot comes down to 
> whether you prefer Python or Ruby.
> 
> Python is more general purpose than Ruby, and a lot more general purpose than 
> PHP, so it is much more likely to be useful outside web apps, or if you need 
> unusual functionality within a web app - python has a huge range of libraries 
> available.
> 
> On Saturday, August 15, 2015 at 2:52:07 AM UTC+5:30, Rotimi Ajayi-Dopemu 
> wrote:
> Hi all,
> I am sure this question has been beaten into the ground but hopefully I can 
> get some specific insight so I don't waste time in the future. Thanks in 
> advance.
> 
> The question:
> I have a year to learn a new programming language for web application 
> development. I will be learning concurrently with going to school so I have 
> about 10 hrs a week give or take. So the question is this should I learn Ruby 
> on Rails or Python/Django???
> 
> Background Info about why:
> I am a student studying Cognitive Science and want to work as either a UX 
> designer or a Full Stack Engineer, I am leaning towards Full Stack 
> Engineering and designing more for the front end in my after hours. I don't 
> have a serious girlfriend (lol) and my life is pretty simple so I know this 
> is what I want to do. I am committed. I know PHP fairly well and can use 
> Wordpress and Joomla for whatever. I am familiar with MVC through use of a 
> popular PHP framework called Codeigniter. Oh yeah, I used C++ pretty heavily 
> about 10 years ago building Windows Applications...and loved it.
> 
> What I will be using it for:
> After I graduate in a year and after learning the language I decide on I plan 
> to develop a full blown web application. I don't know if this is too 
> ambitious but all I'm willing to say now is it is like Pintrest but not a 
> clone. I have fully developed the concept for a long time now and will have 
> the features down pat by then. My goal is to invest my time on a prototype 
> and release it, then hopefully get with a team or even investors if it works 
> and develop it more. If it doesn't work out then Plan B is to use my 
> skill-set in a full time position with a company in a tech hub somewhere in 
> the US. Plan B might turn into Plan A in a year depending on my money 
> situation.
> 
> So there are three aspects to this question: Should I learn Django/Python or 
> Ruby on Rails? is Plan A(the web app) feasible with just me and 
> Django/Python? How does Python fair in the work market?
> 
> I know all this may seem like a lot to ask but this is really just a test of 
> this forums activity. I have been pretty avid on staying with PHP or maybe 
> going back to C++ because this HTML/CSS situation I usually work with these 
> days tends to get on my nerves. 
> 
> Last thing to add for this thread (I swear) is: one thing that really irks me 
> about web development is the lack of real debugging tools that work 
> flawlessly. Maybe it is just I haven't learned them yet but I know in PHP you 
> are stuck with using Xdebug through your browser (although I just found a new 
> debugger that only works in recent versions of PHP) so if anyone could just 
> give a 1+ to integrated debugging with Python Django that would be great.
> 
> Thanks again if you read this far.
> Feel free to contact me if you have a similar web application in the works, I 
> have no doubt there probably is.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/ec08c90a-e9ce-4c71-9f12-02b4484aefb9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/48663B49-7E4E-4014-9F81-1B39D9C0BCD7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Writing a “circuit breaker” for use in Django

2015-08-10 Thread François Schiettecatte
Hi

Specifically addressing your questions:

- I would look at using shared memory to store data that you can share across 
processes, plenty of resources on the web that talk about this.

- You might want to use a small file to store data and fcntl.flock() to control 
access so you are not reading/writing at the same time.

I run Django via wsgi which spawns multiple processes so there is nothing 
within Django per-se that you can use, you have to go outside, i.e. shared 
memory, database or file.

François

> On Aug 10, 2015, at 1:24 PM, Peter Coles  wrote:
> 
> Thank you for your input. I appreciate you trying to steer my away from 
> potentially terrible design, however, I am still interested in someone 
> addressing my main questions. Some level of service calls is inevitable in 
> any interesting web application—even a call to an in-memory cache, like Redis 
> or Memcached, counts as a service call that could fail (a truly resilient 
> web-site would not fall over if the cache disappeared from DNS for 10 
> minutes). In fact one of the examples I linked to was a circuit breaker for 
> memcached.
> 
> I could leverage something like the local memory cache to store this very 
> light-weight information for a service client (which maybe would off-set that 
> disclaimer in the docs about not using it in production) or as seen in the 
> other examples, try something like storing values on a “global” class object 
> or instance. I was curious if anyone who has worked with stuff like this in 
> Django might have some pointers. Maybe Django Developers would be a better 
> forum?
> 
> My original questions:
>   • What’s the most global, persisting, shared-across-requests type of 
> data I can read & write to memory?
>   • However I can do this, does this require using `threading.Lock()`? 
> (looking around `dispatch.Signal` I see some use of it)
>   • If this data is shared per-process, what’s a good way to see how many 
> processes it would be (for uwsgi is that just the # of worker processes)?
> 
> 
> 
> On Monday, August 10, 2015 at 12:59:19 PM UTC-4, ke1g wrote:
> In Django, requests should not wait, since the threads are relatively 
> heavyweight in python, and need to be a limited resource.  The alternative is 
> a large number of processes, which is also expensive.
> 
> So you must design a scheme in which the client polls for a result, meaning 
> that you cannot expect it to be handled by the same process, let alone 
> thread.  So the success of a response (and its data) must be stored in a 
> resource shared across processes and threads.  Most obviously, this is you 
> database, whether by and ORM Model, or (if small enough) in session data.  
> But it is also possible to use a secondary, in RAM store, such as redis, or 
> maybe memcached (or an ad hoc separate process, by why reinvent the wheel?).
> 
> An alternative is to have these requests handled by something that does well 
> with Websockets, such as tornado.  (Django may have work toward Websocket 
> support, but I'm not aware of anything satisfying.)
> 
> Or, in the non-browser case of the client being able to provide a response 
> endpoint, a Celery task could retry, and wen successful could POST to that 
> endpoint.
> 
> Doing Websockets or long poll type interactions isn't what Django is designed 
> to do well.  Some machinations are appropriate if most of what you have to do 
> fits Django, but if all you need to do is drive a screw, don't waste time 
> filing a blade onto the face of a hammer.
> 
> On Fri, Aug 7, 2015 at 5:54 PM, Peter Coles  wrote:
> I’d like to write a circuit breaker wrapper to use with services that I call 
> from inside a Django app, and I’d like to get some pointers on the following 
> questions:
>   • What’s the most global, persisting, shared-across-requests type of 
> data I can read & write to memory?
>   • However I can do this, does this require using `threading.Lock()`? 
> (looking around `dispatch.Signal` I see some use of it)
>   • If this data is shared per-process, what’s a good way to see how many 
> processes it would be (for uwsgi is that just the # of worker processes)?
> The term “circuit breaker” is referring to service clients that cut 
> themselves off from making future requests to a service after the service has 
> failed to connect or read/write after a certain error threshold. They can 
> employ retries to eventually right themselves. If a service continues to 
> fail, even despite strict timeouts, it can significantly slow down a site or 
> even cause the webserver to run out of threads and it will effectively reach 
> a DoS scenario. The clients are per-webserver (or maybe in this case, 
> per-process) and all independently can open or close their “circuits” based 
> on what they’re experiencing.
> 
> To effectively track the effectiveness of service calls without having a 
> performance impact on the webserver, it 

Re: Two Things: (1)-ModelChoiceField with a searchbox and (2)-Related Dropboxes

2015-07-15 Thread François Schiettecatte
Another option would be JQuery Autocomplete:

https://github.com/devbridge/jQuery-Autocomplete

I have used both, JQuery Autocomplete is simpler to get going but Select2 is 
more flexible.

François

> On Jul 15, 2015, at 7:27 PM, Dan Tagg  wrote:
> 
> Select2 can do this https://select2.github.io. Other alternatives are 
> available too.
> 
> Dan
> 
> On 13 Jul 2015 4:27 pm, "Miguel Pereira Legal"  wrote:
> I have this two questions:
> 
> I am trying to write a small stock management system, and I am finding 
> problems in the Form.
> See, when an item goes out I have a dropbox (ChoiceField) to choose the item 
> that is going out, but this dropbox gets too long when you have so many 
> elements in the data base to choose from.
> 
> There is a way to implement a ChoiceField with a integrated search box to 
> make this search and selection more flexible?
> 
> If anyone have another idea, I will listen.
> 
> In the other hand, about the related dropboxes.
> What about if I have a Form where I need to chose a Manufacturer and THEN a 
> Model (i.e Samsung and then S6).
> 
> I need that after the selection of "Samsung" the next dropbox filter the 
> options for that manufacturer. I need that functionality because if the user 
> can choose freely the Manufacturer and then de model, it could be wrong (i.e. 
> the user could choose Samsung and then 6S, and 6S is not a cellphone model of 
> Samsung).
> 
> Thanks for your patience.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/742c2210-5cce-42cb-9997-c9258fd602db%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAPZHCY4FFYe8XMwwrFLjnHnVhCNMJJGpnq6mimfm2x9Lujpp3g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/13C57846-57C5-4827-B23E-86F8F3687604%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Which is the best tutorial to learn django, djangobook.com or djangoproject.com?

2015-05-23 Thread François Schiettecatte
djangoproject.com is the best place and is the official django website, 
djangobook.com is way out of date.

François

> On May 23, 2015, at 1:17 PM, Preeti  wrote:
> 
> Which is the best tutorial to learn django, djangobook.com or 
> djangoproject.com?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/a3b92ff9-e59b-46d9-acf3-fe61e7c18d02%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B81E20F3-007A-4773-81B3-623797AB687F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-05-15 Thread François Schiettecatte
There is nothing to debug, Django is just telling you that it is getting an 
invalid request where the ‘Host:’ header does not match the host name the 
application is expecting. Django will reject such requests and warn you about 
them:

https://docs.djangoproject.com/en/1.8/ref/settings/#allowed-hosts

François

> On May 15, 2015, at 11:10 AM, frocco  wrote:
> 
> The problem is I do not know how to debug this issue.
> 
> On Tuesday, March 17, 2015 at 9:17:15 AM UTC-4, frocco wrote:
> SuspiciousOperation: Invalid HTTP_HOST header (you may need to set 
> ALLOWED_HOSTS): www.g3suprimentos.com.br
> 
> I keep getting this error from time to time.
> 
> Is someone trying to hack my site?
> 
> Thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/e148d1ef-de61-418a-a821-d52dd81e5591%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F7C2CF63-2672-4366-8FA5-4E546950C054%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fix the UnboundLocalError

2015-05-11 Thread François Schiettecatte
You have an ident issue of some sort. pre_ques is out of scope if the 
request.method is not POST.

François

> On May 11, 2015, at 7:24 AM, 田福顿  wrote:
> 
> This is my code, 
> 
> def test_words(request):
> if request.method == "POST":
> i_d = request.user.id
> pre_word = []
> pre_mean = []
> pre_ques = 
> {"word":"","option1":"","option2":"","option3":"","option4":""}
> key_list = ["option1","option2","option3","option4"]
> pre_set =WordBase.objects.order_by('?')[:4]
> for pre_ser_odd in pre_set:
> pre_word.append(pre_ser_odd.word)
> pre_mean.append(pre_ser_odd.mean)
> pre_ques["word"] = random.choice(pre_word)
> while option_key:
> option_key = random.choice(key_list)
> option_value = random.choice(pre_mean)
> pre_ques[option_key] = option_value
> key_list.remove(option_key)
> pre_mean.remove(option_value)
> context = RequestContext(request)
> return 
> render_to_response('tag_study/test_words.html',{"pre_ques":pre_ques}, context)
> 
> I have no idea about the error, the tracebank is 
> UnboundLocalError at /tag_study/test_words/
> 
> local variable 'pre_ques' referenced before assignment
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/0f7e7890-322f-4b7f-ad45-b485ed1833ae%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7270DFB9-6473-455B-942B-2A9A189EF97C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Require code explaination

2015-04-29 Thread François Schiettecatte
Well the response does not seem to contain the audio file, to the best of my 
knowledge Django does not implement X-Accel-Redirect, are you running all this 
on the same machine? Maybe your browser is getting the file ? Seems unlikely. 
Have you tried something like ‘curl’ to make the request in debug mode to see 
what is coming over the wire back from Django?

F.

> On Apr 29, 2015, at 8:28 AM, Anubhav Kaushik <anubhavgree...@gmail.com> wrote:
> 
> yes i am working on this code but  i havnt wrote this code otherwise i would 
> not have required the explaination i guess.
> 
> and for your second question , i am not sure coz  as you said it looked like 
> nginx directive , but i am running it on default wsgi server included in 
> django . so i am asking how wsgi server is serving what a nginx is supposed 
> to serve?
> 
> On Wednesday, April 29, 2015 at 5:35:26 PM UTC+5:30, François Schiettecatte 
> wrote:
> You need to be a little more specific about what the context is, and what you 
> are observing, rather than just plastering up some code. 
> 
> - Is this code in an app you are working with ? Did you write this code ? 
> 
> - Is the audio file being served by your application through the  default 
> wsgi server included in django? 
> 
> F. 
> 
> > On Apr 29, 2015, at 7:55 AM, Anubhav Kaushik <anubhav...@gmail.com> wrote: 
> > 
> >  but i am not running ny nginx server , m just running default wsgi server 
> > with django ,and files are still served file ,can you explain how that is 
> > happening? 
> > 
> > On Wednesday, April 29, 2015 at 5:10:56 PM UTC+5:30, François Schiettecatte 
> > wrote: 
> > I found this page which was pretty clear I think: 
> > 
> > http://wiki.nginx.org/XSendfile 
> >   
> > Looks like an nginx directive to serve a file as the content of the 
> > response. 
> > 
> > F. 
> > 
> > > On Apr 29, 2015, at 7:28 AM, Anubhav Kaushik <anubhav...@gmail.com> 
> > > wrote: 
> > > 
> > > yes francois ,when i searched the term ,all i got was links related to 
> > > nginx. 
> > > 
> > > On Wednesday, April 29, 2015 at 4:55:58 PM UTC+5:30, François 
> > > Schiettecatte wrote: 
> > > Which part do you mean? The 'X-Accel-Redirect’ ? 
> > > 
> > > François 
> > > 
> > > > On Apr 29, 2015, at 6:08 AM, Anubhav Kaushik <anubhav...@gmail.com> 
> > > > wrote: 
> > > > 
> > > > response = HttpResponse() 
> > > > 
> > > > protected = settings.PROTECTED_AUDIO_ROOT + path 
> > > > 
> > > > logger.info('Protected path: %s', protected) 
> > > > 
> > > > response["X-Accel-Redirect"] = protected 
> > > > 
> > > > response["Content-Type"] = "audio/mpeg" 
> > > > 
> > > > return response 
> > > > 
> > > > -- 
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "Django users" group. 
> > > > To unsubscribe from this group and stop receiving emails from it, send 
> > > > an email to django-users...@googlegroups.com. 
> > > > To post to this group, send email to django...@googlegroups.com. 
> > > > Visit this group at http://groups.google.com/group/django-users. 
> > > > To view this discussion on the web visit 
> > > > https://groups.google.com/d/msgid/django-users/f59471d6-1baa-4a36-9d3c-327684049d65%40googlegroups.com.
> > > >  
> > > > For more options, visit https://groups.google.com/d/optout. 
> > > 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to django-users...@googlegroups.com. 
> > > To post to this group, send email to django...@googlegroups.com. 
> > > Visit this group at http://groups.google.com/group/django-users. 
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/django-users/b29c48fc-cb9d-49dd-869f-140afd5d1b6d%40googlegroups.com.
> > >  
> > > For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, sen

Re: Require code explaination

2015-04-29 Thread François Schiettecatte
You need to be a little more specific about what the context is, and what you 
are observing, rather than just plastering up some code.

- Is this code in an app you are working with ? Did you write this code ?

- Is the audio file being served by your application through the  default wsgi 
server included in django?

F.

> On Apr 29, 2015, at 7:55 AM, Anubhav Kaushik <anubhavgree...@gmail.com> wrote:
> 
>  but i am not running ny nginx server , m just running default wsgi server 
> with django ,and files are still served file ,can you explain how that is 
> happening?
> 
> On Wednesday, April 29, 2015 at 5:10:56 PM UTC+5:30, François Schiettecatte 
> wrote:
> I found this page which was pretty clear I think: 
> 
> http://wiki.nginx.org/XSendfile 
>   
> Looks like an nginx directive to serve a file as the content of the response. 
> 
> F. 
> 
> > On Apr 29, 2015, at 7:28 AM, Anubhav Kaushik <anubhav...@gmail.com> wrote: 
> > 
> > yes francois ,when i searched the term ,all i got was links related to 
> > nginx. 
> > 
> > On Wednesday, April 29, 2015 at 4:55:58 PM UTC+5:30, François Schiettecatte 
> > wrote: 
> > Which part do you mean? The 'X-Accel-Redirect’ ? 
> > 
> > François 
> > 
> > > On Apr 29, 2015, at 6:08 AM, Anubhav Kaushik <anubhav...@gmail.com> 
> > > wrote: 
> > > 
> > > response = HttpResponse() 
> > > 
> > > protected = settings.PROTECTED_AUDIO_ROOT + path 
> > > 
> > > logger.info('Protected path: %s', protected) 
> > > 
> > > response["X-Accel-Redirect"] = protected 
> > > 
> > > response["Content-Type"] = "audio/mpeg" 
> > > 
> > > return response 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to django-users...@googlegroups.com. 
> > > To post to this group, send email to django...@googlegroups.com. 
> > > Visit this group at http://groups.google.com/group/django-users. 
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/django-users/f59471d6-1baa-4a36-9d3c-327684049d65%40googlegroups.com.
> > >  
> > > For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users...@googlegroups.com. 
> > To post to this group, send email to django...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/b29c48fc-cb9d-49dd-869f-140afd5d1b6d%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/e158ec09-020a-4b80-9913-c0e2c3eccc8a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/13BF64E2-3B83-4100-9FA1-DAFCDE8A0676%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Require code explaination

2015-04-29 Thread François Schiettecatte
I found this page which was pretty clear I think:

http://wiki.nginx.org/XSendfile
 
Looks like an nginx directive to serve a file as the content of the response. 

F.

> On Apr 29, 2015, at 7:28 AM, Anubhav Kaushik <anubhavgree...@gmail.com> wrote:
> 
> yes francois ,when i searched the term ,all i got was links related to nginx.
> 
> On Wednesday, April 29, 2015 at 4:55:58 PM UTC+5:30, François Schiettecatte 
> wrote:
> Which part do you mean? The 'X-Accel-Redirect’ ? 
> 
> François 
> 
> > On Apr 29, 2015, at 6:08 AM, Anubhav Kaushik <anubhav...@gmail.com> wrote: 
> > 
> > response = HttpResponse() 
> > 
> > protected = settings.PROTECTED_AUDIO_ROOT + path 
> > 
> > logger.info('Protected path: %s', protected) 
> > 
> > response["X-Accel-Redirect"] = protected 
> > 
> > response["Content-Type"] = "audio/mpeg" 
> > 
> > return response 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users...@googlegroups.com. 
> > To post to this group, send email to django...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/f59471d6-1baa-4a36-9d3c-327684049d65%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/b29c48fc-cb9d-49dd-869f-140afd5d1b6d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D931862C-ED51-4705-95B1-318BDBEAFF8C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Require code explaination

2015-04-29 Thread François Schiettecatte
Which part do you mean? The 'X-Accel-Redirect’ ? 

François

> On Apr 29, 2015, at 6:08 AM, Anubhav Kaushik  wrote:
> 
> response = HttpResponse()
> 
> protected = settings.PROTECTED_AUDIO_ROOT + path
> 
> logger.info('Protected path: %s', protected)
> 
> response["X-Accel-Redirect"] = protected
> 
> response["Content-Type"] = "audio/mpeg"
> 
> return response
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f59471d6-1baa-4a36-9d3c-327684049d65%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5D141546-4D98-4ADF-B3C6-CC5D0061DC43%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread François Schiettecatte
I did a little research on this and found cpulimit, you can also use nice and 
renice, and (on fedora core 21 at least) you can do 'cat /proc/###/status’ 
where ### is the process ID which will give you memory stats on a process. Not 
ideal but you can wrap all of these in some python to make it easier to manage. 

François

> On Apr 20, 2015, at 1:58 PM, Tim Chase <django.us...@tim.thechases.com> wrote:
> 
> On 2015-04-20 13:54, François Schiettecatte wrote:
>> Peter, why do you want to limit memory and CPU usage? To prevent
>> someone from killing the machine ?
> 
> I know I've wanted it to help prevent malicious data that could suck
> up my RAM and push things into swap.  Absent "ulimit -a", I've had to
> work around it with extra care to ensure that huge files or pessimal
> instructions don't drag my machine to the ground.
> 
> -tkc
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/20150420125834.3faf7102%40bigbox.christie.dr.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/47D4DCD3-F55D-41A2-A4D9-4B6746C7BEA9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread François Schiettecatte
Bummer, shows how long it has been since I have used that.

Peter, why do you want to limit memory and CPU usage? To prevent someone from 
killing the machine ?

F.

> On Apr 20, 2015, at 1:47 PM, Tim Chase <django.us...@tim.thechases.com> wrote:
> 
> On 2015-04-20 13:13, François Schiettecatte wrote:
>> You don’t say what platform you are running on, but on linux/unix
>> you can use ulimit, see http://ss64.com/bash/ulimit.html
> 
> I've wanted this occasionally, but "ulimit -m" doesn't appear to work
> on most modern Linux installations.  See
> 
> http://unix.stackexchange.com/questions/129587/does-ulimit-m-not-work-on-modern-linux
> 
> for more info.
> 
> I'm not sure *why* it was removed, as there have been times I wanted
> this functionality (I'm looking at you, Firefox, and your
> memory-gorging habits) so it would be awfully helpful to have
> around.  I also just tested "ulimit -m" on OpenBSD and it too seems
> to let the RSS of the process grow beyond the specified limit.  I've
> got a FreeBSD laptop around here that I could test as well if I can
> find the power adaptor.
> 
> -tkc
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/20150420124711.0f49d04d%40bigbox.christie.dr.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E8425E9D-C9B9-4474-B6BC-3B719C599D23%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread François Schiettecatte
You don’t say what platform you are running on, but on linux/unix you can use 
ulimit, see http://ss64.com/bash/ulimit.html

François

> On Apr 20, 2015, at 1:09 PM, SHINTO PETER  wrote:
> 
> how to limit memory utilization for a particular python script ?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8bed3762-1dde-45e2-8573-4be58ab4d090%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/704F864E-CD2D-4A31-9D83-5E7BD35F83FA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread François Schiettecatte
I know what socket.gethostname() does, we still dont know what it returns on 
your setup. And the exception you get is about the host name. Note that a host 
can have multiple host names and socket.gethostname() only returns one, which 
may not be the one you want to use. By default a machine will have the host 
name ‘localhost’ which is a loopback, but it may have others if it is part of a 
network.

F.

> On Apr 17, 2015, at 8:05 AM, SHINTO PETER <shinto@gmail.com> wrote:
> 
> socket.gethostname()
> Return a string containing the hostname of the machine where the Python 
> interpreter is currently executing ie in python documentation
> 
> so ie used gethostname()
> 
> 
> On Friday, 17 April 2015 17:31:11 UTC+5:30, François Schiettecatte wrote:
> Well then why do you get it from socket.gethostname() ? Just set it to 
> ‘localhost’. 
> 
> F. 
> 
> > On Apr 17, 2015, at 7:56 AM, SHINTO PETER <shint...@gmail.com> wrote: 
> > 
> > i just want to give host as localhost / 127.0.0.1 
> > 
> > On Friday, 17 April 2015 17:15:05 UTC+5:30, François Schiettecatte wrote: 
> > What is the value of host? 
> > 
> > François 
> > 
> > > On Apr 17, 2015, at 7:38 AM, SHINTO PETER <shint...@gmail.com> wrote: 
> > > 
> > > socket.gaierror: [Errno -5] No address associated with hostname 
> > > 
> > > # server.py 
> > > import socket 
> > > import time 
> > > # create a socket object 
> > > serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> > > # get local machine name 
> > > host = socket.gethostname() 
> > > port =  
> > > # bind to the port 
> > > serversocket.bind((host, port)) 
> > > # queue up to 5 requests 
> > > serversocket.listen(5) 
> > > while True: 
> > > # establish a connection 
> > > clientsocket,addr = serversocket.accept() 
> > > print("Got a connection from %s" % str(addr)) 
> > > currentTime = time.ctime(time.time()) + "\r\n" 
> > > clientsocket.send(currentTime.encode('ascii')) 
> > > clientsocket.close() 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to django-users...@googlegroups.com. 
> > > To post to this group, send email to django...@googlegroups.com. 
> > > Visit this group at http://groups.google.com/group/django-users. 
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/django-users/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
> > >  
> > > For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users...@googlegroups.com. 
> > To post to this group, send email to django...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/fb79843b-5888-42c1-b8eb-ec59aca7f9f9%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/c7579f3d-4eb3-44ee-9d1a-1ec608a7123a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/06E04B96-1335-43BB-AAC0-0EA2BEBD51B6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread François Schiettecatte
Well then why do you get it from socket.gethostname() ? Just set it to 
‘localhost’.

F.

> On Apr 17, 2015, at 7:56 AM, SHINTO PETER <shinto@gmail.com> wrote:
> 
> i just want to give host as localhost / 127.0.0.1
> 
> On Friday, 17 April 2015 17:15:05 UTC+5:30, François Schiettecatte wrote:
> What is the value of host? 
> 
> François 
> 
> > On Apr 17, 2015, at 7:38 AM, SHINTO PETER <shint...@gmail.com> wrote: 
> > 
> > socket.gaierror: [Errno -5] No address associated with hostname 
> > 
> > # server.py 
> > import socket 
> > import time 
> > # create a socket object 
> > serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> > # get local machine name 
> > host = socket.gethostname() 
> > port =  
> > # bind to the port 
> > serversocket.bind((host, port)) 
> > # queue up to 5 requests 
> > serversocket.listen(5) 
> > while True: 
> > # establish a connection 
> > clientsocket,addr = serversocket.accept() 
> > print("Got a connection from %s" % str(addr)) 
> > currentTime = time.ctime(time.time()) + "\r\n" 
> > clientsocket.send(currentTime.encode('ascii')) 
> > clientsocket.close() 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users...@googlegroups.com. 
> > To post to this group, send email to django...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/fb79843b-5888-42c1-b8eb-ec59aca7f9f9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/FE8AD0A8-DA52-4720-B4EE-8DA2E1A188CE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread François Schiettecatte
What is the value of host?

François

> On Apr 17, 2015, at 7:38 AM, SHINTO PETER  wrote:
> 
> socket.gaierror: [Errno -5] No address associated with hostname
> 
> # server.py 
> import socket 
> import time 
> # create a socket object 
> serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> # get local machine name 
> host = socket.gethostname() 
> port =  
> # bind to the port 
> serversocket.bind((host, port)) 
> # queue up to 5 requests 
> serversocket.listen(5) 
> while True: 
> # establish a connection 
> clientsocket,addr = serversocket.accept() 
> print("Got a connection from %s" % str(addr))
> currentTime = time.ctime(time.time()) + "\r\n"
> clientsocket.send(currentTime.encode('ascii'))
> clientsocket.close()
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0EECBFFC-5CFC-4194-B6CE-C54CC5DFBAE4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Alternatives to Django REST Framework

2015-04-09 Thread François Schiettecatte
If you do go the Flask route,  you might want to check this:

https://github.com/humiaozuzu/awesome-flask

Just came with the lastest ImportPython Newsletter 
(http://importpython.com/newsletter/no/27/)

François

> On Apr 9, 2015, at 9:45 AM, Vijay Khemlani  wrote:
> 
> If you don't need the advanced features of Django or REST framework it's easy 
> to ignore them, it's not like they require tons of resources or configuration 
> files to work.
> 
> On Thu, Apr 9, 2015 at 10:24 AM, graeme  wrote:
> If you do not need Django at all, Flask or Bottle.
> 
> If you are going to use Django anyway, just use a Django view that return 
> JSON, XML or whatever you want.
> 
> On Thursday, April 9, 2015 at 6:25:21 PM UTC+5:30, amit.p...@gmail.com wrote:
> Hi,
> 
> while Django REST Framework seems wonderful to me, it is a heayweight option 
> for a little project of mine. I wonder if there are simpler alternatives for 
> publishing a simple API?
> 
> TIA,
> AP.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/a3885622-d4f2-41c2-b9f4-3d261c0ac7b3%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALn3ei0oasfjrvvO2ZtR9krUE-%2B8D%2B6gbcgrQrddnJboYD55zQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B787D7F7-361F-4B90-99F6-AAAC33C98BCE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Alternatives to Django REST Framework

2015-04-09 Thread François Schiettecatte
You could try Flask, I have used it in the past when I did not need all the 
infrastructure that Django provides:

http://flask.pocoo.org

François

> On Apr 9, 2015, at 8:54 AM, Amit Prahesh  wrote:
> 
> Hi,
> 
> while Django REST Framework seems wonderful to me, it is a heayweight option 
> for a little project of mine. I wonder if there are simpler alternatives for 
> publishing a simple API?
> 
> TIA,
> AP.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAEH4rCRLGSjfi1G1ToKSPwcAUmsa38vyxp5s%3DnzDgbNqAg4Z1w%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07A3E0E7-3C73-407B-9319-D18D1113C6CB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django TCP Socket Communication

2015-03-27 Thread François Schiettecatte
Have you looked at the ‘socket’ python library ?

François

> On Mar 27, 2015, at 3:05 PM, bobdxcool  wrote:
> 
> I am new to TCP socket programming. I have a django based server
> communicating with a microcontroller. Now, I want to implement TCP based
> socket on the server side in order to communicate with the TCP socket on the
> microcontroller. Can anyone give me an idea on how to do this ? What
> libraries should I use on my django server The microprocessor basically
> opens the socket every 5 seconds and sends a notification to the server. I
> on the server side should be able to read this and pump data back to the
> microprocessor using this socket which was opened by the microprocessor.
> 
> 
> 
> --
> View this message in context: 
> http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792.html
> Sent from the django-users mailing list archive at Nabble.com.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/1427483125637-5090792.post%40n6.nabble.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/DAE16363-2EEE-4E0F-A230-A31BB270E2F9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Max_length of EmailField in django.contrib.auth.models.User

2015-03-22 Thread François Schiettecatte
Hi

I have been using this patch to get around the short user name (which is 30 
characters):

#--
#
# Patch to allow username to exceed the default maximum of 30 characters
#
# http://stackoverflow.com/a/6453368/1228131
#
# Note: this works for django 1.3, 1.4, 1.5, 1.6
#

# Import what we need
from django.contrib.auth.models import User
from django.core.validators import MaxLengthValidator

# New username length
NEW_USERNAME_MAX_LENGTH = 75

# Method to patch the user name maximum length
def monkey_patch_username_maximum_length():

username = User._meta.get_field("username")
username.max_length = NEW_USERNAME_MAX_LENGTH

for validator in username.validators:
if isinstance(validator, MaxLengthValidator):
validator.limit_value = NEW_USERNAME_MAX_LENGTH

# Patch the user name maximum length
monkey_patch_username_maximum_length()

#--


> On Mar 22, 2015, at 10:55 AM, Tim Graham  wrote:
> 
> Currently you need to use a custom user model if you want to change the 
> username max_length. There's an open ticket to increase the default length to 
> 254 though: https://code.djangoproject.com/ticket/20846
> 
> On Sunday, March 22, 2015 at 10:45:34 AM UTC-4, somen...@gmail.com wrote:
> Thanks, Anderson, but can I overwrite the length of User class? How? Sorry 
> I'm still a newbee? With AbstractUser? 
> [https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#django.contrib.auth.models.CustomUser]
>  or Extending user class 
> [https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#extending-the-existing-user-model]?
> 
> On the other, hand, it were useful if someone could add the information in 
> the web page.
> 
> El diumenge, 22 març de 2015 15:28:34 UTC+1, Anderson Resende va escriure:
> No, the user class uses 75. You need to change to 254.
> 
> models.EmailField(max_lenght=254)
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/012b584e-3e72-44e6-9a09-4909b2b3353c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C9304BDE-FD41-48A6-93C1-119751D48267%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Load Template without rendering/parsing

2015-03-16 Thread François Schiettecatte
I am not sure what you mean.

I have this is urls.py

# Root view, goes to 'app.home.views.page'
(r'^$', 'app.home.views.page'),

and the code below in page() in views.py, django routes ‘/‘ to that view and it 
renders the home page.

Or you could use {% ssi %} to include the angular stuff.

François


> On Mar 16, 2015, at 9:01 AM, Guilherme Leal <lealhu...@gmail.com> wrote:
> 
> This solution crossed my mind, and the only down side that i see on it, is 
> that i cant use the "template.loader" logic for finding the right template.
> 
> Em seg, 16 de mar de 2015 às 09:59, François Schiettecatte 
> <fschietteca...@gmail.com> escreveu:
> You can just read the file content and return it with an HttpResponse(), like 
> this:
> 
> 
> # File handle
> fileHandle = None
> 
> # Open the file, return a 404 if failed
> try:
> fileHandle = open(filePath, 'r')
> except IOError:
> raise Http404()
> 
># Return the file
> return HttpResponse(content=fileHandle.read(), content_type=’text/html')
> 
> François
> 
> 
> > On Mar 16, 2015, at 8:49 AM, Guilherme Leal <lealhu...@gmail.com> wrote:
> >
> > Hello!
> >
> > Anyone knows a way to load a template file WITHOUT parsing/rendering it?
> >
> > To ilustrate a bit more:
> >
> > I have a django app serving a restfull api, and everithing is just fine 
> > with it. The front end that consumes this api, is an Angular.js single page 
> > app. To centralize the routing logic, what i want to do is to let django to 
> > serve the "index.html" of this app. The only problem is, when i load the 
> > html of the front end (through "django.template.loader.get_template"), the 
> > template engine tries to parse it, and throws an exception because this 
> > "template" has the angularjs template tags on it.
> >
> > What i need is:
> > - Load the template without parsing/rendering it
> > OR
> > - Serve this html document as static in production (the static serving view 
> > only works when debug is activated)
> >
> > Thanx in advance!
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/CAOs3Lp43aDqXDSfNNcH10gUvAZB-3UazGEL45bW59t-6Hyay9Q%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/FFC3A2C1-51A0-4A2D-9D94-EEF0C511C5A6%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAOs3Lp7DtTtDdmaYHp%3DnKAxD%2B-_SU7JtBqbyNMpPDRdqpnjTNw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63341965-80C9-457B-B6C8-766C094869EA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Load Template without rendering/parsing

2015-03-16 Thread François Schiettecatte
You can just read the file content and return it with an HttpResponse(), like 
this:


# File handle
fileHandle = None

# Open the file, return a 404 if failed
try:
fileHandle = open(filePath, 'r')
except IOError:
raise Http404()

   # Return the file
return HttpResponse(content=fileHandle.read(), content_type=’text/html')

François


> On Mar 16, 2015, at 8:49 AM, Guilherme Leal  wrote:
> 
> Hello!
> 
> Anyone knows a way to load a template file WITHOUT parsing/rendering it?
> 
> To ilustrate a bit more: 
> 
> I have a django app serving a restfull api, and everithing is just fine with 
> it. The front end that consumes this api, is an Angular.js single page app. 
> To centralize the routing logic, what i want to do is to let django to serve 
> the "index.html" of this app. The only problem is, when i load the html of 
> the front end (through "django.template.loader.get_template"), the template 
> engine tries to parse it, and throws an exception because this "template" has 
> the angularjs template tags on it.
> 
> What i need is:
> - Load the template without parsing/rendering it
> OR
> - Serve this html document as static in production (the static serving view 
> only works when debug is activated)
> 
> Thanx in advance!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAOs3Lp43aDqXDSfNNcH10gUvAZB-3UazGEL45bW59t-6Hyay9Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/FFC3A2C1-51A0-4A2D-9D94-EEF0C511C5A6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Future for Django, Jobs, Confused :/

2015-03-04 Thread François Schiettecatte
If the question is What Do I Invest In? Then the answer is to learn enough 
tools to be able to develop a full stack (JavaScript, HTML, Django, Python, 
MySQL/Postgres/Other), and expect that you will be learning new things all the 
time. I picked Django because I settled for Python rather than Ruby when I 
wanted to move off of Perl (having done a lot of C and Java along the way). 
Learning Python not only opened up Django but also Flask (and a lot more 
besides), but I learned enough Ruby to able to develop with i. And what you use 
now may not be what you use in 5 years time. It is good to have two or three 
languages (not including JavaScript) under your belt and commit to learning a 
new one every couple of years (or more often if you can).

François

> On Mar 4, 2015, at 4:36 PM, Avraham Serour  wrote:
> 
> so what is the question?
> 
> On Tue, Mar 3, 2015 at 2:34 AM, Ismael Ezequiel  
> wrote:
> I'm confused what "framework" choice for web development, I love Python. as 
> is the future for Django, I spend a lot time studying Django. I see more jobs 
> for Ruby on Rails than Django :/
> 
> Sorry my english.
> 
> Thanks.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/6515c506-3d18-40b4-814e-3df576e5c1e2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAFWa6t%2BGCTRVDR4100j7M0FpMVqaZZHN1Ay3x0m4sMVzQN06wA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F823ED65-4E8A-4F88-BF0A-4F3E1A27E4AE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django

2015-02-20 Thread François Schiettecatte
Two options:


https://docs.djangoproject.com/en/1.7/ref/django-admin/#django-admin-dumpdata

http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html

François

> On Feb 20, 2015, at 8:49 AM, raviki...@inndata.in wrote:
> 
> how to dump mysql database table  in our django project
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/bdbbfd6c-a0f6-4465-a972-62a95abea19c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0D26673A-0433-4674-BACD-89D1F8B9927D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SMTPAuthenticationError sending email via smtp.gmail

2015-02-09 Thread François Schiettecatte
It does not really have to do with Django, it has to do with OAuth which Google 
just started enforcing in gmail, you need to relax the security level on the 
gmail account you are using on this page:

https://www.google.com/settings/security/lesssecureapps

François

> On Feb 9, 2015, at 8:25 PM, bradford li  wrote:
> 
> I am trying to have django send emails but I am getting this error:
> 
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/Library/Python/2.7/site-packages/django/core/mail/__init__.py", 
> line 62, in send_mail
> return mail.send()
>   File "/Library/Python/2.7/site-packages/django/core/mail/message.py", 
> line 286, in send
> return self.get_connection(fail_silently).send_messages([self])
>   File 
> "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 
> 92, in send_messages
> new_conn_created = self.open()
>   File 
> "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 
> 59, in open
> self.connection.login(self.username, self.password)
>   File 
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
>  line 615, in login
> raise SMTPAuthenticationError(code, resp)
> SMTPAuthenticationError: (534, '5.7.9 Application-specific password 
> required. Learn more at\n5.7.9 
> http://support.google.com/accounts/bin/answer.py?answer=185833 
> v14sm3323298pbs.11 - gsmtp')
> 
> The link suggested my to perform a 2-step verification which I did but still 
> no results.
> 
> In my settings.py
> 
> EMAIL_USE_TLS = True
> EMAIL_HOST = 'smtp.gmail.com'
> EMAIL_HOST_USER = 'em...@gmail.com'
> EMAIL_HOST_PASSWORD = 'password'
> EMAIL_PORT = 587
> 
> I tried testing this in django shell but got the error shown above:
> 
> >>> from django.core.mail import send_mail
> >>> from django.conf import settings
> >>> sub = "sup man"
> >>> msg = "char lisss"
> >>> from_user = settings.EMAIL_HOST_USER
> >>> to = ["em...@email.com"]
> >>> send_mail(sub,msg,from_user,to, fail_silently=False)
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/3047e0c7-86f9-477a-be92-76ba53a43225%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C74DBDD8-559F-4A59-8014-9A80B43A3DA9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create Django token-based Authentication

2015-01-30 Thread François Schiettecatte
I wonder if OAuth would help you, see http://oauth.net

François

> On Jan 30, 2015, at 8:22 AM, Collin Anderson  wrote:
> 
> Hi,
> 
> What happens when you try? :)
> 
> Your setup is pretty complicated, but I don't know if REST framework will 
> help much.
> 
> Collin
> 
> On Tuesday, January 27, 2015 at 12:00:59 AM UTC-5, Hossein Rashnoo wrote:
> I have my authentication service on django. I want to role as web-service to 
> gave other website a token and authenticate users with that token.
> 
> This is my scenario:
> 
>   • user visit external website and try to login
>   • when hit the login button that website redirect user to my site to 
> use username and password for login
>   • When successfully logged in users will redirect to external website 
> with a token
>   • And every time that website send me that token, I recognize that user 
> and pass some data to external website I'm try to use REST-Framework 
> authentication but it is too complicated Please help me.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/cc8def1e-9788-41ef-8896-4632b0d3b1ea%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9104F84F-0C1B-4D22-B972-27BC6EC46B93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do you link your Django project to a domain

2015-01-27 Thread François Schiettecatte
I would not recommend godaddy.com, they try really hard to upsell you, I use 
hover.com and I have also heard good things about domain.com

François

> On Jan 27, 2015, at 3:09 PM, Collin Anderson  wrote:
> 
> I use namecheap, but yes, domains.google.com has a nice user interface.
> 
> On Saturday, January 24, 2015 at 8:22:33 AM UTC-5, patrickbeeson wrote:
> You might also check out Google's recently launched domain registrar at 
> domains.google.com.
> 
> On Saturday, January 24, 2015 at 2:01:43 AM UTC-5, djangocharm2020 wrote:
> pretty much have a project built but now want to purchase a domain to link it 
> live . Do you guys have any suggestions on who i should go with like 
> godaddy.com.
> 
> I also need to know is there a special step or code that is needed to add to 
> the project?
> 
> Thanks 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/d49b77bc-a760-4867-8611-0f80cac9717c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1F417922-3648-49B7-B64D-F555F6376E79%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Raw access to cache table

2014-12-18 Thread François Schiettecatte
Hi

I use fcntl.flock() from the fcntl module. I have used this method in C, Perl 
and Python, works great. Happy to share code.

François




> On Dec 18, 2014, at 9:24 AM, Javier Guerra Giraldez  
> wrote:
> 
> On Thu, Dec 18, 2014 at 6:20 AM, Erik Cederstrand
>  wrote:
>> I'm using Django as a hub to synchronize data between various external 
>> systems. To do this, I have some long-running Django management commands 
>> that are started as cron jobs. To ensure that only one job is working on a 
>> data set at any one time, I have implemented a locking system using the 
>> Django cache system.
> 
> 
> there are many ways to skin this cat; one of them is doing it the Unix
> way with flock.  In short, it's a command line tool that makes it easy
> to do "if i'm already running, exit now" in shell scripts.
> 
> check the man page, it lists a few ways to do this kind of things.
> 
> http://linux.die.net/man/1/flock
> 
> -- 
> Javier
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAFkDaoTFuxQ-f564uWBd6S%3DPaO960nxRKNLkspqko5DujjhioQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C9709909-1AA9-43DB-8E7B-A6676844BC7F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DATABASE in settings file not working

2014-12-11 Thread François Schiettecatte
PASSSWORD => PASSWORD


> On Dec 11, 2014, at 9:26 AM, dennis breland  wrote:
> 
> Please help with this problem...
> 
>  
> I am getting an access denied error when running Django; details follow:
> Currently installed versions:
> Python 2.7.3
> MySQL-python package 1.2.3
> Django 1.7
>  
> I previously used the Django tutorial and successfully used the polling app, 
> using sqlite3. Now I started over with the tutorial and I’m trying to use 
> mysql instead. I created a database called denmain.
> As stated in the tutorial, when I perform:
> python manage.py migrate
> I get this response:
> …
> File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", 
> line 187, in __init__
> super(Connection, self).__init__(*args, **kwargs2)
> django.db.utils.OperationalError: (1045, "Access denied for user 
> 'dennis'@'localhost' (using password: NO)")
>  
> Here is my settings.py:
> …
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'denmain',
> 'USER': 'dennis',
> 'PASSSWORD': 'mypass',
> 'HOST': '127.0.0.1',
> 'PORT': '3306',
> }
> …
> 
> On Friday, February 17, 2012 9:11:11 AM UTC-5, Detectedstealth wrote:
> Hi, 
> 
> I am just coming back to django development after a while of 
> developing with pyramid. I have taking over an application. 
> 
> For some reason with the newest version of django it is not reading 
> the password I set in settings: 
> 
> DATABASES = { 
> 'default': { 
> 'ENGINE': 'django.db.backends.mysql', # Add 
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 
> 'NAME': 'mydatabase',  # Or path to 
> database file if using sqlite3. 
> 'USER': 'root',  # Not used with sqlite3. 
> 'PASSWORD': 'mypassword',  # Not used with 
> sqlite3. 
> 'HOST': '',  # Set to empty string for 
> localhost. Not used with sqlite3. 
> 'PORT': '',  # Set to empty string for 
> default. Not used with sqlite3. 
> } 
> } 
> 
> When starting the server I get the following error: 
> ...MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/connections.py", 
> line 187, in 
> __init__ 
> _mysql_exceptions.OperationalError: (1045, "Access denied for user 
> 'root'@'localhost' (using password: NO)") 
> 
> Not sure why it is saying there was not password. For the newest 
> version of django is there a new way to tell python manage.py 
> runserver what password/username/database to use?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/fd0f8b04-a8ff-41fc-8c77-01bd47abb679%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5CBEEB4E-6A70-430F-B2F4-C25EE064B28E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Connect django project with sharepoint 2013

2014-12-06 Thread François Schiettecatte
Ok, but I am not sure what this has to do with Django ? Maybe you should ask on 
a SharePoint mailing list ? And did you try running the code in a script on the 
command line ?

François

> On Dec 6, 2014, at 7:10 AM, Hossein Rashnoo  wrote:
> 
> I need to connect my project to sharepoint. So i installed "sharepoint 0.4.1" 
> package and then use this code in my view :
> 
> from sharepoint import SharePointSite, basic_auth_opener
> 
> def userloginres(request):
>   server_url = "http://portal:8080/;
>   site_url = server_url + "rashno/"
>   opener = basic_auth_opener(server_url, "my username", "my password")
>   site = SharePointSite(site_url, opener)
> 
>   htt=r"Sharepoint lists"
>   for sp_list in site.lists:
>   htt = htt + r" %s . %s " % 
> (sp_list.id,sp_list.meta['Title'])
>   htt = htt + r""
> 
>   t = get_template('userlogin/userloginres.html')
>   html= t.render(Context({"htt":htt}))
>   return HttpResponse(html)
> 
> But now when i open that url this error appear:
> 
> URLError at /test/login/
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/a982dfcf-6824-441a-ab5f-f68907e1f0d7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C2CC4E3F-9E56-47E2-AF74-459007BF7FC7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql connector python 3

2014-12-05 Thread François Schiettecatte
Hi

Couldn't resist and did a quick test. The original tests I did were with 
MySQLdb, and I just reran the tests with MySQL Connector/Python and mysqlclient 
(assuming that django prioritizes mysqlclient over MySQLdb if both are 
installed).

If I make a request, then sleep for more than the mysql timeout, and then make 
another request I get an error regardless of what CONN_MAX_AGE is set to, even 
if it is commented out of the DATABASES dictionary.

I need to ping() the connection not to get an error. This suggests that this is 
django related and not in the driver.

That being said I am very curious how your test turns out.

François


> On Dec 5, 2014, at 8:36 AM, Andreas Kuhne <andreas.ku...@suitopia.com> wrote:
> 
> François,
> 
> Thanks for the offer, however I will be trying to change to mysqlclient 
> instead of the mysql-connector-python connector. I can only do this by 
> releasing to our production servers, which will not be until Tuesday. So 
> unfortunately I will have to wait until then.
> 
> Regards,
> 
> Andréas
> 
> 
> 2014-12-05 14:19 GMT+01:00 François Schiettecatte <fschietteca...@gmail.com>:
> Andreas
> 
> I have had to use this workaround for scripts that run a long time between 
> database accesses:
> 
> from django.db import connection
> 
> def checkConnection():
> 
> # Check the connection, close if needed
> try:
> connection.connection.ping()
> # print 'INFO: connection.connection.ping()'
> except:
> connection.close()
> # print 'INFO: connection.close()'
> 
> 
> Call checkConnection() before you do a database access, you may need to play 
> around with where you put this. The code I have is crawler which uses the 
> django models to add data to a  database, so a lot of time elapses between 
> the start of the script and when the data is actually inserted into the 
> database, so plenty of time for connections to time out.
> 
> I spent a while tracking this down a while back but was not able to fully 
> sort  out the issue, I came away with the impression that there was a bug 
> somewhere in the connection pool code. If you like I have a little spare time 
> today and can dig into this again.
> 
> François
> 
> 
> > On Dec 5, 2014, at 4:08 AM, Andreas Kuhne <andreas.ku...@suitopia.com> 
> > wrote:
> >
> > Hi Collin,
> >
> > Thanks!
> >
> > I tried the CONN_MAX_AGE setting and it didn't work. We still get problems, 
> > so I'll have to try changing the connector. The only thing left I think.
> >
> > Regards,
> >
> > Andréas
> >
> > 2014-12-05 5:07 GMT+01:00 Collin Anderson <cmawebs...@gmail.com>:
> > Hi Andréas,
> >
> > If it helps, mysqlclient (python3-compatible fork of mysqldb) is Django's 
> > recommended connector/driver.
> >
> > https://pypi.python.org/pypi/mysqlclient
> > https://docs.djangoproject.com/en/dev/ref/databases/#mysql-db-api-drivers
> >
> > Collin
> >
> >
> > On Thursday, December 4, 2014 1:50:09 PM UTC-5, Andréas Kühne wrote:
> > Hi all,
> >
> > We went live with a new website, completely rewritten in python 3 and with 
> > django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> > there were some minor issues, but most of them have been resolved and so 
> > far everything is working really nice.
> >
> > HOWEVER... We are having major issues with the mysql-connector-python pip 
> > package. We are running the latest stable version (2.0.2), but it seems as 
> > if the connector looses it's connection every now and then. This is really 
> > irritating as it can happen 10-15 times / day. This means that a lot of our 
> > customers are probably having problems. The exception we are getting is:
> > mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL 
> > server during query
> >
> > We are running on AWS with a RDS instance for the mysql server. This worked 
> > perfectly in our previous configuration with python 2.7 and the mysqldb 
> > connector.
> >
> > Is mysql-connector-python not ready for a production system? Is there 
> > anyone else who has had the same problems?
> >
> > Is there any other python 3 compatible connector that we can use instead? 
> > We are also using south, so it has to be compatible with south as well.
> >
> > Regards,
> >
> > Andréas
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
&g

Re: Mysql connector python 3

2014-12-05 Thread François Schiettecatte
Andreas

I have had to use this workaround for scripts that run a long time between 
database accesses:

from django.db import connection

def checkConnection():

# Check the connection, close if needed
try:
connection.connection.ping()
# print 'INFO: connection.connection.ping()'
except:
connection.close()
# print 'INFO: connection.close()'


Call checkConnection() before you do a database access, you may need to play 
around with where you put this. The code I have is crawler which uses the 
django models to add data to a  database, so a lot of time elapses between the 
start of the script and when the data is actually inserted into the database, 
so plenty of time for connections to time out.

I spent a while tracking this down a while back but was not able to fully sort  
out the issue, I came away with the impression that there was a bug somewhere 
in the connection pool code. If you like I have a little spare time today and 
can dig into this again.

François


> On Dec 5, 2014, at 4:08 AM, Andreas Kuhne  wrote:
> 
> Hi Collin,
> 
> Thanks! 
> 
> I tried the CONN_MAX_AGE setting and it didn't work. We still get problems, 
> so I'll have to try changing the connector. The only thing left I think.
> 
> Regards,
> 
> Andréas
> 
> 2014-12-05 5:07 GMT+01:00 Collin Anderson :
> Hi Andréas,
> 
> If it helps, mysqlclient (python3-compatible fork of mysqldb) is Django's 
> recommended connector/driver.
> 
> https://pypi.python.org/pypi/mysqlclient
> https://docs.djangoproject.com/en/dev/ref/databases/#mysql-db-api-drivers
> 
> Collin
> 
> 
> On Thursday, December 4, 2014 1:50:09 PM UTC-5, Andréas Kühne wrote:
> Hi all,
> 
> We went live with a new website, completely rewritten in python 3 and with 
> django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> there were some minor issues, but most of them have been resolved and so far 
> everything is working really nice.
> 
> HOWEVER... We are having major issues with the mysql-connector-python pip 
> package. We are running the latest stable version (2.0.2), but it seems as if 
> the connector looses it's connection every now and then. This is really 
> irritating as it can happen 10-15 times / day. This means that a lot of our 
> customers are probably having problems. The exception we are getting is:
> mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL server 
> during query
> 
> We are running on AWS with a RDS instance for the mysql server. This worked 
> perfectly in our previous configuration with python 2.7 and the mysqldb 
> connector. 
> 
> Is mysql-connector-python not ready for a production system? Is there anyone 
> else who has had the same problems? 
> 
> Is there any other python 3 compatible connector that we can use instead? We 
> are also using south, so it has to be compatible with south as well.
> 
> Regards,
> 
> Andréas
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8283294e-2d8d-487c-9bb1-f96c06ef46a5%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALXYUbmPrpEwHbrNn29HQ_%2BtDGYgeCdeV9PqyikJLq9C-V2zdQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D2E85288-5BD9-4C78-92BC-474EEF82E6C9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql connector python 3

2014-12-04 Thread François Schiettecatte
Andréas

Django 1.6 introduced persistent connections:


https://docs.djangoproject.com/en/dev/ref/databases/#persistent-database-connections

The problem is that the mysql is dropping the connection while it is still in 
the pool on the django side (I have run into this with Java connection pools 
too, its a common gotcha). 

You might also want to check this:

https://code.djangoproject.com/ticket/21597

I just found when I was looking at a hack I had to put in because a very long 
running script was always triggering this issue.

François

> On Dec 4, 2014, at 2:03 PM, Andreas Kuhne <andreas.ku...@suitopia.com> wrote:
> 
> François,
> 
> Thanks for your answer. I will check the settings. The problem we have had is 
> that it seems to be on ANY query, both those that take a long time and those 
> that take a short time. But I'll check. 
> 
> Being an RDS instance it's not easy for me to get the my.cnf file, but I 
> should be able to see the settings somehow.
> 
> Thanks again,
> 
> Andréas
> 
> 2014-12-04 19:58 GMT+01:00 François Schiettecatte <fschietteca...@gmail.com>:
> Andreas
> 
> Are your sql queries taking a very long time or is this for quick queries. 
> Places to start would be to check that CONN_MAX_AGE in settings.py is less 
> than wait_timeout in my.cnf. You could also check slow query log in MySQL.
> 
> I ran into this issue but with a different setup, Django 1.6, Python 2.7 and 
> MySQL-python 1.2.3, but this was specifically when I upgraded from Django 1.5 
> to 1.6 and the introduction of CONN_MAX_AGE.
> 
> François
> 
> > On Dec 4, 2014, at 1:49 PM, Andreas Kuhne <andreas.ku...@suitopia.com> 
> > wrote:
> >
> > Hi all,
> >
> > We went live with a new website, completely rewritten in python 3 and with 
> > django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> > there were some minor issues, but most of them have been resolved and so 
> > far everything is working really nice.
> >
> > HOWEVER... We are having major issues with the mysql-connector-python pip 
> > package. We are running the latest stable version (2.0.2), but it seems as 
> > if the connector looses it's connection every now and then. This is really 
> > irritating as it can happen 10-15 times / day. This means that a lot of our 
> > customers are probably having problems. The exception we are getting is:
> > mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL 
> > server during query
> >
> > We are running on AWS with a RDS instance for the mysql server. This worked 
> > perfectly in our previous configuration with python 2.7 and the mysqldb 
> > connector.
> >
> > Is mysql-connector-python not ready for a production system? Is there 
> > anyone else who has had the same problems?
> >
> > Is there any other python 3 compatible connector that we can use instead? 
> > We are also using south, so it has to be compatible with south as well.
> >
> > Regards,
> >
> > Andréas
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/CALXYUbmZYaEhoyt5OCWd_F47a0LbkuQRJ3pjJL3vz98Y6hwZNA%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/9358A368-FA33-462F-AE58-DB3F86D1A7AC%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/djan

Re: Mysql connector python 3

2014-12-04 Thread François Schiettecatte
Andreas

Are your sql queries taking a very long time or is this for quick queries. 
Places to start would be to check that CONN_MAX_AGE in settings.py is less than 
wait_timeout in my.cnf. You could also check slow query log in MySQL. 

I ran into this issue but with a different setup, Django 1.6, Python 2.7 and 
MySQL-python 1.2.3, but this was specifically when I upgraded from Django 1.5 
to 1.6 and the introduction of CONN_MAX_AGE.

François

> On Dec 4, 2014, at 1:49 PM, Andreas Kuhne  wrote:
> 
> Hi all,
> 
> We went live with a new website, completely rewritten in python 3 and with 
> django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> there were some minor issues, but most of them have been resolved and so far 
> everything is working really nice.
> 
> HOWEVER... We are having major issues with the mysql-connector-python pip 
> package. We are running the latest stable version (2.0.2), but it seems as if 
> the connector looses it's connection every now and then. This is really 
> irritating as it can happen 10-15 times / day. This means that a lot of our 
> customers are probably having problems. The exception we are getting is:
> mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL server 
> during query
> 
> We are running on AWS with a RDS instance for the mysql server. This worked 
> perfectly in our previous configuration with python 2.7 and the mysqldb 
> connector. 
> 
> Is mysql-connector-python not ready for a production system? Is there anyone 
> else who has had the same problems? 
> 
> Is there any other python 3 compatible connector that we can use instead? We 
> are also using south, so it has to be compatible with south as well.
> 
> Regards,
> 
> Andréas
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALXYUbmZYaEhoyt5OCWd_F47a0LbkuQRJ3pjJL3vz98Y6hwZNA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9358A368-FA33-462F-AE58-DB3F86D1A7AC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: models.py question for setting up multiple sql entries for 1 master sql entry

2014-11-24 Thread François Schiettecatte
Hi

You should consider having a single Barcodeid table and have a one-to-many 
relationship between the Hardwareid and Barcodeid.

François
 
> On Nov 24, 2014, at 1:43 AM, Bovine Devine  wrote:
> 
> Hello,
> 
> I am creating hardware database webapp in django and I have a question for 
> how to setup my models.py to ensure I get the data entered into the mysql db 
> that I have setup.
> 
> I have my models.py setup this way:
> 
> from django.db import models
> from django.utils import timezone
> # Create your models here.
> 
> 
> class Hardwareid(models.Model):
>   hardwareid_text = models.CharField(max_length=200)
>   pub_date = models.DateField(default=timezone.now)
>   def __unicode__(self): 
>   return self.hardwareid_text
>   
>   
> class Barcodeid1(models.Model):
>   barcode1 = models.ForeignKey(Hardwareid)
>   Barcodeid1_text = models.CharField(max_length=50)
>   def __unicode__(self): 
>   return self.Barcodeid1_text
>   
> class Barcodeid2(models.Model):
>   barcode2 = models.ForeignKey(Hardwareid)
>   Barcodeid2_text = models.CharField(max_length=50)
>   def __unicode__(self): 
>   return self.Barcodeid2_text
> 
> 
> My question is do I have this setup properly? The end result I would like to 
> have is to have a "master" Hardwareid name of an item in my sql db that has 
> multiple barcodeids associated with each master hardwareid.
> 
> Is this the correct way to do it?
>   
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/47abd291-f46c-4d9b-b535-bd1ed0a7c6da%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/19DACD41-B8C6-4499-B5E4-A214709A573A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question on url routing

2014-10-10 Thread François Schiettecatte
Hi

You could check request.META['HTTP_REFERER'], it should be set if the user 
clicks on a link and unset if the user entered the url in the address bar. 
Obviously this is browser dependent. If you really want to be sure I would use 
a one time url with a uuid which you generate and store to validate against 
when you get the request.

François

On Oct 10, 2014, at 8:09 AM, robert brook  wrote:

> If I have 2 urls coded in the file for example
> 
> url(r'^abc/$', views.abc),
> url( r'^abc/def/$', views.def),
> 
> And the first url should be accessible by typing it into the browser.
> 
> The 2nd url should only be accessible from the application, not by virtue of 
> a user typing it into the browser.
> 
> How do I accomplish that?
> How do I capture that and reroute it to a valid page?
> 
> Thanks is advance
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/b8423a99-7798-4458-b817-5f5179373603%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6D7DADBF-5562-4E61-9941-7FC140458BB5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 and Python 2.6

2014-09-28 Thread François Schiettecatte
Russell

Thanks, this the answer I was looking for, I think virtualenv is the way to go.

Cheers

François

On Sep 27, 2014, at 7:14 PM, Russell Keith-Magee <russ...@keith-magee.com> 
wrote:

> 
> Out of the box, it won't work - but if maintaining an internal fork that adds 
> Python 2.6 compatibility back in shouldn't be *too* difficult. 
> 
> When we drop support for a Python version, we don't go out of our way to 
> break compatibility with that version. It's more like a gradual process where 
> language features incompatible with older versions of Python slowly drift 
> into the codebase.
> 
> The two sources of problems you'll hit are:
> 
>  1) Using language features available in 2.7 that weren't in 2.6. Set 
> literals, dictionary/set comprehensions, and multiple context managers are 
> the new features that are most likely to cause problems.
> 
>  2) Relying on compatibility shims that are no longer required in 2.7, and so 
> were removed. The native OrderedDictionary type will be the complication 
> here. We previously shipped a shim for older Python versions; that shim was 
> removed in Django 1.7.
> 
> If you're absolutely stuck on 2.6, and you can't use a virutalenv or docker 
> container to isolate your Python requirements (as suggested by others in this 
> thread), then a back port might be an option.
> 
> The ultimate test - Can you run Django's own test suite? Once the test suite 
> runs, you shouldn't have any problems.
> 
> Yours
> Russ Magee %-)
> 
> On Sun, Sep 28, 2014 at 2:54 AM, François Schiettecatte 
> <fschietteca...@gmail.com> wrote:
> Hi
> 
> I know that Django 1.7 does not officially run on Python 2.6:
> 
> 
> https://docs.djangoproject.com/en/1.7/releases/1.7/#python-compatibility
> 
> Unfortunately I am stuck with Python 2.6 on a number of servers but would 
> like to migrate to Django 1.7. Does anyone run that configuration? Is there 
> anything in Django 1.7 which explicitly prevents it from running on Python 
> 2.6? Or is this a "great if it runs, but don't care if it doesn't" situation.
> 
> Cheers
> 
> François
> 
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/04A8E7D2-35CD-429A-873F-FF20C4D3D492%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAJxq84-MEYEN_fX6f2Sj%3DguLB-jp%3D9GKvw36o9CRbG4GDSX_aQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F0A55A4F-C988-4C32-9C01-5A6782F3755A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.7 and Python 2.6

2014-09-27 Thread François Schiettecatte
Hi

I know that Django 1.7 does not officially run on Python 2.6:

https://docs.djangoproject.com/en/1.7/releases/1.7/#python-compatibility

Unfortunately I am stuck with Python 2.6 on a number of servers but would like 
to migrate to Django 1.7. Does anyone run that configuration? Is there anything 
in Django 1.7 which explicitly prevents it from running on Python 2.6? Or is 
this a "great if it runs, but don't care if it doesn't" situation.

Cheers

François


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/04A8E7D2-35CD-429A-873F-FF20C4D3D492%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: n00b question - using Django for web services

2014-09-22 Thread François Schiettecatte
Rog

Django is an option, you may also want to look at the Django REST Framework too 
( http://www.django-rest-framework.org ).

If you want to do something really simple you might want to look at Flask ( 
http://flask.pocoo.org ), it is another python based web framework, 'lighter' 
than Django but it does a lot less.

François


On Sep 22, 2014, at 2:19 AM, Roger Rustad  wrote:

> I have a limited progamming background (C++ in school 10+ years ago) and am 
> needing to setup an API framework to take HTTP callbacks from landing pages 
> (e.g. Unbounce).  Given my following requirements and conditions, is Django 
> what I want to use and where is the best place to start?
>   * forms filled out on a different page will need to send their info to 
> my server (e.g. in a webhook or HTTP callback format).
>   * My web services box needs to take those inputs (JSON POSTS ?) and 
> then take action on them
>   * First action I'll do here is to SMS / call via Twilio
> (I have a basic Python background -- enough to follow someone else's code, 
> but not enough to hit the ground running on a big projects.)
> 
> Any pointers in the right direction would be greatly appreciated.  
> 
> Rog
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/b552f62a-ec7b-44e3-95ef-9e163dafd476%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/439CE913-97CB-4615-98F5-4766DD04BDF9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Excel Sorting

2014-09-11 Thread François Schiettecatte
You have three ways you can do this:

- In the browser with Javascript, with all the data stored in the page (as a 
javascript array).

- In the browser with Javascript and a REST call to Django to get the data (in 
JSON for example).

- With a url that reloads the page with different parameters to sort/filter the 
data.

François

On Sep 11, 2014, at 9:33 AM, Gregory Strydom  
wrote:

> Sorry i forgot to mention the filtering/sorting should be done in the view so 
> the user can simply click on a button and sort by date, category etc
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/af02ef85-eb9d-4537-93d0-da6a02ebd488%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C8467525-0FCE-41FA-8A63-440AFF1BD309%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: KeyboardInterrupt on production

2014-09-05 Thread François Schiettecatte
What is probably happening lower down in the stack that the browser is closing 
a connection to the server before all the content is sent back causing a broken 
pipe error which is being reported as a KeyboardInterrupt exception by django.

Cheers

François

On Sep 5, 2014, at 4:03 AM, Rok Jaklič  wrote:

> Hi,
> 
> on our production environment we get random KeyboardInterrupt exceptions 
> being thrown (Bad gateway in browser), but we do not know where to even start 
> to look.
> 
> We went through our raised exceptions but everything seems to be ok there...
> 
> Usually we get this if we click on links fast on page.
> 
> Any ideas?
> 
> Kind reagards,
> 
> Rok
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/83958041-0e17-4f3c-b4ba-1a079982e76a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F6FBD140-BAE1-462A-A52D-5957F0398AB9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: nothing i can do about "CSRF token missing or incorect" -- beginner

2014-09-02 Thread François Schiettecatte
Did you check that the csrf_token is actually inserted into the form by looking 
at the HTML in the browser?

François

On Sep 2, 2014, at 3:57 AM, aseds  wrote:

> i searched and tried what i found to solve it, but...
> here is my edit.html which contains my form:
> 
> 
> 
> 
>   {{ page_name }} - Editing
> 
> 
> 
>   Editing {{ page_name }}
>   
>   {% csrf_token %}
>   {{ content 
> }}
>   
>   
> 
> 
> 
> 
> and here is my views.py:
> 
> # ...
> 
> def edit_page(request, page_name):
>   try:
>   page = Page.objects.get(pk = page_name)
>   content = page.contents
>   except Page.DoesNotExist:
>   content = ""
>   return render(request, "edit.html", {"page_name": page_name, 
> "content": content})
> 
> # ...
> 
> 
> i changed my views.py as was suggested in a webpage to this:
> 
> @csrf_protect
> def edit_page(request, page_name):
>   c = {}
>   try:
>   page = Page.objects.get(pk = page_name)
>   content = page.contents
>   except Page.DoesNotExist:
>   content = ""
>   return render(request, "edit.html", {"page_name": page_name, 
> "content": content}, c)
> 
> 
> but it didn't help.
> thank you for your help.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/0acb15b8-6752-4930-8e72-c3c77ec9bd32%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B82B6A46-B77B-4E8A-9C0F-168B80E1A816%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dynamic CSS

2014-08-12 Thread François Schiettecatte
You could certainly render the CSS either in-line in the HMTL pages or in 
templates, just produce CSS as opposed to HTML (I have produced RSS, ATOM, XML 
and JSON in templates). Or you could have multiple CSS files and just pick the 
one you want to use when you render the link to the CSS in your HTML pages.

François 

On Aug 12, 2014, at 7:37 PM, Drew Ferguson  wrote:

> Hi
> 
> Is there any documentation describing possible ways of having dynamic CSS
> in a site?
> 
> For example, having a CSS colour scheme set from a database query or
> setting a site logo URL from a database query
> 
> Ta
> -- 
> Drew Ferguson
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/20140813003710.3f766b96%40blacktav.fergiesontour.org.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CC247E9B-3629-4627-9456-F4FAB5E7316C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to log out a user

2014-08-12 Thread François Schiettecatte
You should take a look at sessions:

https://docs.djangoproject.com/en/1.7/topics/http/sessions/

You can arbitrarily remove sessions regardless of expiration which will log out 
the user.

François

On Aug 12, 2014, at 2:32 PM, Torsten Bronger  
wrote:

> Hallöchen!
> 
> I know that there is a logout(request) routine, but how to program a
> logout(user) routine?
> 
> Background:  Every night, a cronjob iterates over all active users
> in our Django deployment and checks whether they can still be found
> in our LDAP directory.  Every user that is not found anymore is set
> to inactive.  Unfortunately, this is not enough, he or she must be
> logged out.  But how to do that?
> 
> Tschö,
> Torsten.
> 
> -- 
> Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
>  or http://bronger-jmp.appspot.com
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/87egwlk18f.fsf%40physik.rwth-aachen.de.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F7E9D86C-19D6-48DF-B4BB-CF4837DFD99D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Starting with Python 3 and Django 1.x?

2014-08-09 Thread François Schiettecatte
I would go with Python 3, string handling is much better and the library layout 
is a little more rational. I am stuck with 2.7 for the websites I develop but I 
have been using 3 for the attending scripts with no issues. If you do decide to 
go with 2.7 I would add the following to each file to make sure that a future 
migration to 3 is as painless as possible.

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division


François

On Aug 9, 2014, at 8:33 AM, Ari Davidow  wrote:

> If I stick to Python 2.7, I start off with a host of Unicode issues--not a 
> promising way to start a site that relies on Unicode, Middle Eastern 
> character sets, and bidi functionality. I hate the last-century, Python 2 
> ways of dealing with those. That makes no sense, barring something more 
> compelling than the statement, "stick to python 2.7".
> 
> ari
> 
> 
> On Sat, Aug 9, 2014 at 4:09 AM, ngangsia akumbo  wrote:
> stick to python 2.7
> 
> collins anderson can i meet u on skype? mine is 
> 
> skype:  ngangsi.richard
> 
> 
> 
> 
> On Friday, August 8, 2014 11:53:30 PM UTC+1, Collin Anderson wrote:
> I'd start with 1.7 as it should be more friendly to newcomers. There will be 
> another release candidate soon and the final version should be out in about a 
> month.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/d2864620-4d13-4d41-9d6d-cad5b31dc589%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAF%2BxBDVVTBSo39oVJ9eAPC9h_VwOdwo9JsSq1Y%2BTK2Jenu7Ecw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E570EE98-0691-404B-A1D8-DBA7112AF42B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: deploying djnago on apache

2014-08-08 Thread François Schiettecatte
You should check your web server's error_log, there might be something there 
which would help.

François

On Aug 8, 2014, at 9:40 AM, ngangsia akumbo  wrote:

> Thanks bro am drawing closer to the solution
> i got this error when i types
>  www.bluepearlhotel.com
> 
> Internal Server Error
> 
> The server encountered an internal error or misconfiguration and was unable 
> to complete your request.
> 
> Please contact the server administrator at [no address given] to inform them 
> of the time this error occurred, and the actions you performed just before 
> this error.
> 
> More information about this error may be available in the server error log.
> 
> 
> 
> i have 4 apps withing the project bluepearlhotel 
> 
> 
> 
> On Friday, August 8, 2014 1:43:58 PM UTC+1, Collin Anderson wrote:
> 
> WSGIScriptAlias / /home/yems/bluepearlhotel.wsgi
> 
> ServerName  bluepearlhotel.com
> 
> Alias /static /var/www/bluepearlhotel/static/
> 
> 
> Order allow,deny
> Allow from all
> 
> 
> 
> 
> Require all granted
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/140db4f8-d12d-4761-bcdc-d3f5ce0ac90f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4BBB9F24-9393-45DD-85EF-711D752B6B69%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: admin site not available after modifying base_site.html

2014-08-06 Thread François Schiettecatte
This suggests the server is not running, can you get to http://127.0.0.1:8000/  
?

On Aug 6, 2014, at 2:30 PM, Eric G  wrote:

> I'm on Google Chrome, so it reads, "This webpage is not available."
> 
> On Wednesday, August 6, 2014 5:27:12 AM UTC-7, Collin Anderson wrote:
> Now the 127.0.0.1:8000/admin/ site isn't available.
> 
> What happens when you try? 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/47004884-88cc-47ee-8416-ee384e3d1b3f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/BEE4EA98-78E7-4625-98D6-07FF9EF7F231%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: plz help me to learn django

2014-07-29 Thread François Schiettecatte
Two great resources:

https://www.djangoproject.com

https://docs.djangoproject.com/en/1.6/intro/tutorial01/

http://www.djangobook.com/en/2.0/index.html

François

On Jul 29, 2014, at 1:13 PM, Soumya Verma  wrote:

> 
>  i m a beginner in this area, plz help me to learn this. i dnt know how to 
> create django project...:(
> Thank you
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/68f3d8d2-1005-412d-9014-8bf53b54cdfa%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CCED7020-7129-4848-B25B-69B8A5D992C2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django + Mysql connector

2014-07-21 Thread François Schiettecatte
Check this thread:

https://groups.google.com/forum/#!topic/django-users/cb_IGZXVuVQ

François

On Jul 21, 2014, at 4:23 PM, Henrique Oliveira  
wrote:

> Hi there,
> 
> I am getting this error after hours:
> 
>  File "/opt/d/lib/python3.4/site-packages/django/contrib/sites/models.py", 
> line 45, in get_current
> current_site = SITE_CACHE[sid]
> 
> KeyError: 1
> 
> 
> During handling of the above exception, another exception occurred:
> 
> 
> Traceback (most recent call last):
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/backends/__init__.py", 
> line 131, in _cursor
> return self.create_cursor()
> 
>   File "/opt/d/lib/python3.4/site-packages/mysql/connector/django/base.py", 
> line 537, in create_cursor
> cursor = self.connection.cursor()
> 
>   File "/opt/d/lib/python3.4/site-packages/mysql/connector/connection.py", 
> line 1328, in cursor
> raise errors.OperationalError("MySQL Connection not available.")
> 
> mysql.connector.errors.OperationalError: MySQL Connection not available.
> 
> 
> The above exception was the direct cause of the following exception:
> 
> 
> Traceback (most recent call last):
> 
>   File "/opt/d/lib/python3.4/site-packages/django/core/handlers/base.py", 
> line 114, in get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/views/generic/base.py", 
> line 69, in view
> return self.dispatch(request, *args, **kwargs)
> 
>   File "/opt/d/lib/python3.4/site-packages/allauth/account/views.py", line 
> 62, in dispatch
> **kwargs)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/views/generic/base.py", 
> line 87, in dispatch
> return handler(request, *args, **kwargs)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/views/generic/edit.py", 
> line 161, in get
> return self.render_to_response(self.get_context_data(form=form))
> 
>   File "/opt/d/lib/python3.4/site-packages/allauth/account/views.py", line 
> 111, in get_context_data
> "site": Site.objects.get_current(),
> 
>   File "/opt/d/lib/python3.4/site-packages/django/contrib/sites/models.py", 
> line 47, in get_current
> current_site = self.get(pk=sid)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/models/manager.py", line 
> 151, in get
> return self.get_queryset().get(*args, **kwargs)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/models/query.py", line 
> 301, in get
> num = len(clone)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/models/query.py", line 
> 77, in __len__
> self._fetch_all()
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/models/query.py", line 
> 854, in _fetch_all
> self._result_cache = list(self.iterator())
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/models/query.py", line 
> 220, in iterator
> for row in compiler.results_iter():
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/models/sql/compiler.py", 
> line 709, in results_iter
> for rows in self.execute_sql(MULTI):
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/models/sql/compiler.py", 
> line 781, in execute_sql
> cursor = self.connection.cursor()
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/backends/__init__.py", 
> line 159, in cursor
> cursor = util.CursorWrapper(self._cursor(), self)
> 
>   File "/opt/d/lib/python3.4/site-packages/mysql/connector/django/base.py", 
> line 552, in _cursor
> return super(DatabaseWrapper, self)._cursor()
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/backends/__init__.py", 
> line 131, in _cursor
> return self.create_cursor()
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/utils.py", line 99, in 
> __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/utils/six.py", line 535, in 
> reraise
> raise value.with_traceback(tb)
> 
>   File "/opt/d/lib/python3.4/site-packages/django/db/backends/__init__.py", 
> line 131, in _cursor
> return self.create_cursor()
> 
>   File "/opt/d/lib/python3.4/site-packages/mysql/connector/django/base.py", 
> line 537, in create_cursor
> cursor = self.connection.cursor()
> 
>   File "/opt/d/lib/python3.4/site-packages/mysql/connector/connection.py", 
> line 1328, in cursor
> raise errors.OperationalError("MySQL Connection not available.")
> 
> django.db.utils.OperationalError
> 
> Any ideas to solve this?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> 

Dictionary-style string formatting

2014-07-21 Thread François Schiettecatte
Hi

Here it tells me that 'The given URL may contain dictionary-style string 
formatting...':


https://docs.djangoproject.com/en/1.6/ref/class-based-views/base/#redirectview

and to get it to work I have to put an 's' at the end of the url parameters:

url('^(?P\d{6})$', RedirectView.as_view(url='/entry/%(number)s')),

Why is there an 's' ? I could not find documentation on this.

Thanks

François

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C603820C-BBAF-4B99-B111-44FABC983F16%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


MySQL-python on ubuntu?

2014-07-09 Thread François Schiettecatte
Hi

I am installing django on Ubuntu and have a question about installing 
MySQL-python?

I know I can get install it on CentOS/Fedora/Red Hat with this:

yum -y install MySQL-python

but I cant find the MySQL-python package on apt-get? Is it in there under a 
different name? I can find 'python-mysqldb' but not sure if it is the same?

Any suggestions greatly appreciated.

Thanks

François

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08F54026-8F7B-4BA2-A805-2F5AA9F7D4CC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql connections after started django app

2014-07-04 Thread François Schiettecatte
Hi

Again I think there is a bug somewhere in how django handles CONN_MAX_AGE when 
it is not set or set to 0, you should not be seeing those sleeping connections. 

It is perfectly fine to set CONN_MAX_AGE to some number, though keep it to less 
than the wait_timeout in my.cnf. You will still see sleeping connections but 
that is normal with a connection pool. Django will create a number of 
connections to the database as needed, reusing then when appropriate and 
closing them after the timeout you set. This will save you from having to ping 
your site to maintain the connections. Setting up a connection to MySQL is very 
fast so there should be performance issues if you set CONN_MAX_AGE to something 
like 60 (again check my.cnf).

Cheers

François


On Jul 4, 2014, at 12:39 PM, Zemian Deng <saltnlig...@gmail.com> wrote:

> Thanks for the tips @Francois! Yeah, I already have this CONN_MAX_AGE set to 
> 0. I even try some positive number, but there is still Sleep connections 
> remain after the app is started and running without any traffic. Which is not 
> what I expect when set to 0 value.
> 
> I don't even have fancy background tasks that need long running connection 
> time. But my site is only been use every few days per week, so it has timeout 
> issue when first use. As I mentioned, my current workaround is have a crontab 
> task to "curl" my site hourly to keep it alive. Even at this is not 
> completely reliable since there are 5 established connections, and not always 
> refresh all of them per ping.
> 
> 
> 
> On Fri, Jul 4, 2014 at 11:24 AM, François Schiettecatte 
> <fschietteca...@gmail.com> wrote:
> Hi
> 
> I have a little experience with this, and I have posted about this here 
> before.
> 
> The "MySQL Connection not available" message will occur when MySQL is 
> dropping the connection before Django is done with it, ie Django is trying to 
> send something down a dead connection.
> 
> I would look at CONN_MAX_AGE in DATABASES (in settings.py) and wait_timeout 
> in my.cnf, the first should be lower than the second.
> 
> For example I have these settings for a number of projects:
> 
>'CONN_MAX_AGE': 3500,   # 3500 seconds because 
> wait_timeout = 3600 in my.cnf
> 
> And this for another:
> 
> 'CONN_MAX_AGE': 50, # 50 seconds because 
> wait_timeout = 60 in my.cnf
> 
> Not setting CONN_MAX_AGE (or setting it to 0) in 1.6 caused the "MySQL 
> Connection not available" issue, I suspect there is a bug in how Django 
> handles its pooling but I have not checked. Seeing Sleeping connections on 
> MySQL is suggestive of that. A Sleeping connection just means it is idle and 
> waiting for stuff.
> 
> I have a number of long running scripts, where more than an hour (3600 
> seconds) can elapse between database accesses, and I find I have to ping the 
> connections to see if they are still alive before I do any database accesses, 
> so I call the following method to ping the connections, and close off dead 
> connections:
> 
> 
> from django.db import connection
> 
> def checkConnection():
> 
> # Check the connection, close if needed
> try:
> connection.connection.ping()
> # print 'INFO: connection.connection.ping()'
> except:
> connection.close()
> # print 'INFO: connection.close()'
> 
> 
> Hope this helps.
> 
> https://docs.djangoproject.com/en/1.6/ref/databases/
> https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-CONN_MAX_AGE
> 
> Cheers
> 
> François
> 
> 
> On Jul 4, 2014, at 10:46 AM, cercatrova2 <cercatro...@gmail.com> wrote:
> 
> > On 04/07/14 16:11, Zemian Deng wrote:
> >> @cercatrova2,
> >>
> >> Yes, my original problem also was (and still is) with "MySQL Connection 
> >> not available" after the 8 hours timeout inactivity on webfaction hosting. 
> >> I have to restart it whenever this happens and then problem will go away. 
> >> My current workaround is to schedule a dummy crontab to hit my site every 
> >> hour to keep connection timeout refresh. Not ideal, but better than 
> >> nothing so far. Thus I am looking for some help here.
> >>
> >> I really like MySQL, and I have tested my app with it already. It would be 
> >> a bummer to switch because of this just now. I have tried direct usage of 
> >> mysql.connection with just open and close a connection, and I do see the 
> >> process go away properly. This plus the number of process list is 
> >> increasing when I try simple "mysite" app lead me to think it might be 
> >> django related. I am n

Re: Mysql connections after started django app

2014-07-04 Thread François Schiettecatte
Hi

I have a little experience with this, and I have posted about this here before.

The "MySQL Connection not available" message will occur when MySQL is dropping 
the connection before Django is done with it, ie Django is trying to send 
something down a dead connection.

I would look at CONN_MAX_AGE in DATABASES (in settings.py) and wait_timeout in 
my.cnf, the first should be lower than the second.

For example I have these settings for a number of projects:

   'CONN_MAX_AGE': 3500,   # 3500 seconds because 
wait_timeout = 3600 in my.cnf

And this for another:

'CONN_MAX_AGE': 50, # 50 seconds because 
wait_timeout = 60 in my.cnf

Not setting CONN_MAX_AGE (or setting it to 0) in 1.6 caused the "MySQL 
Connection not available" issue, I suspect there is a bug in how Django handles 
its pooling but I have not checked. Seeing Sleeping connections on MySQL is 
suggestive of that. A Sleeping connection just means it is idle and waiting for 
stuff.

I have a number of long running scripts, where more than an hour (3600 seconds) 
can elapse between database accesses, and I find I have to ping the connections 
to see if they are still alive before I do any database accesses, so I call the 
following method to ping the connections, and close off dead connections:


from django.db import connection

def checkConnection():

# Check the connection, close if needed
try:
connection.connection.ping()
# print 'INFO: connection.connection.ping()'
except:
connection.close()
# print 'INFO: connection.close()'

 
Hope this helps.

https://docs.djangoproject.com/en/1.6/ref/databases/
https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-CONN_MAX_AGE

Cheers

François


On Jul 4, 2014, at 10:46 AM, cercatrova2  wrote:

> On 04/07/14 16:11, Zemian Deng wrote:
>> @cercatrova2,
>> 
>> Yes, my original problem also was (and still is) with "MySQL Connection not 
>> available" after the 8 hours timeout inactivity on webfaction hosting. I 
>> have to restart it whenever this happens and then problem will go away. My 
>> current workaround is to schedule a dummy crontab to hit my site every hour 
>> to keep connection timeout refresh. Not ideal, but better than nothing so 
>> far. Thus I am looking for some help here.
>> 
>> I really like MySQL, and I have tested my app with it already. It would be a 
>> bummer to switch because of this just now. I have tried direct usage of 
>> mysql.connection with just open and close a connection, and I do see the 
>> process go away properly. This plus the number of process list is increasing 
>> when I try simple "mysite" app lead me to think it might be django related. 
>> I am not sure. Further testing would be need to verify which end is causing 
>> the problem.
>> 
>> But good to hear PostgreSQL doesn't have the same issue though.
>> 
>> 
>> 
>> On Fri, Jul 4, 2014 at 1:06 AM, cercatrova2  wrote:
>> On 04/07/14 05:04, Zemian Deng wrote:
>>> Hi,
>>> 
>>> In my django settings.py I have set CONN_MAX_AGE=0 to use with MySQL DB, 
>>> which I understood as closing conn after each request. However when I start 
>>> a simple "mysite" tutorial with "python manage.py runserver", I see 
>>> immediately 3 connections in mysql that will not close but in Sleep mode. 
>>> Did I miss something here? How do we ensure these connections will get 
>>> closed while the app is running?
>>> 
>>> mysql> show full processlist;
>>> 
>>> +-+--+-+--+-+--+---+---+
>>> 
>>> | Id  | User | Host| db   | Command | Time | State | Info   
>>>|
>>> 
>>> +-+--+-+--+-+--+---+---+
>>> 
>>> | 316 | root | localhost   | NULL | Query   |0 | init  | show full 
>>> processlist |
>>> 
>>> | 317 | root | localhost:61695 | test | Sleep   |3 |   | NULL   
>>>|
>>> 
>>> | 318 | root | localhost:61696 | test | Sleep   |3 |   | NULL   
>>>|
>>> 
>>> | 319 | root | localhost:61697 | test | Sleep   |3 |   | NULL   
>>>|
>>> 
>>> +-+--+-+--+-+--+---+---+
>>> 
>>> 4 rows in set (0.00 sec)
>>> 
>>> 
>>> Thanks
>>> 
>>> Zemian
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/33fcf156-42bd-4c07-819f-952a6b214b76%40googlegroups.com.
>>> For more options, visit 

Re: Upgrade Mysql

2014-06-20 Thread François Schiettecatte
Dariusz 

Not sure about upgrading mysql, what the error is telling you is that mysql is 
dropping the connection before django is done with it.

I would look at CONN_MAX_AGE in DATABASES (in settings.py) and wait_timeout in 
my.cnf, the first should be lower than the second.

For example I have these settings for a project:

'CONN_MAX_AGE': 3500,   # 3500 seconds because 
wait_timeout = 3600 in my.cnf


Cheers

François

On Jun 20, 2014, at 11:31 AM, Dariusz Mysior  wrote:

> I use pythonanywhere.com Django 1.6 and Python 2.7 I 
> 
> and when I write p.save() I had error like below.
> It says something about updating mysql to fix it, but I don't know what code 
> or shell commands I need to write.
> 
> Can you help me? One person post that he upgrade MySQL to 5.0.27 but I don't 
> know what is a commend for do this :/.
> 
> Traceback (most recent call last):
> 
>   
> File "", line 1, in 
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py",
>  line 545, in save
> 
> force_update
> =force_update, update_fields=update_fields)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py",
>  line 570, in
>  save_base
> 
> with transaction.commit_on_success_unless_managed(using=using, 
> savepoint=False):
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/transaction.py",
>  line 280, in
>  __enter__
> connection
> .set_autocommit(False)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/__init__.py",
>  line 340, in
>  set_autocommit
> self
> ._set_autocommit(autocommit)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
>  line 461, in
>  _set_autocommit
> self
> .connection.autocommit(autocommit)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/utils.py",
>  line 99, in
>  __exit__
> six
> .reraise(dj_exc_type, dj_exc_value, traceback)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
>  line 461, in
>  _set_autocommit
> self
> .connection.autocommit(autocommit)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/MySQLdb/connections.py",
>  line 243, in
>  autocommit
> _mysql
> .connection.autocommit(self, on)
> 
> OperationalError
> : (2006, 'MySQL server has gone away')
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/0dc3a793-2fd0-4884-87f3-b14724bdd1ab%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ED0A86A-0299-49CE-B959-929EE13EB761%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django python fuction

2014-06-10 Thread François Schiettecatte
Wouldn't the deep copy module handle this for you:

https://docs.python.org/2/library/copy.html

François

On Jun 10, 2014, at 12:17 PM, hito koto <hitokoto2...@gmail.com> wrote:

> Hi,  Qiancong :
> 
> I was looking for exactly this、
> Thank you ver much!
> 
> 
> 2014年6月10日火曜日 23時35分52秒 UTC+9 Qiancong:
> 
> Hi, hito koto:
> I think you want to deep copy the list. The following code maybe  helpful:
> def dcopy(obj):
> if not isinstance(obj, list):
> return obj
> return [dcopy(x) for x in obj]
>  
> But this function only deep copy for list.  You can change code as what I did 
> for dic, set, tuple , etc ..
> moqia...@gmail.com
>  
> From: François Schiettecatte
> Date: 2014-06-10 22:07
> To: django-users
> Subject: Re: Django python fuction
> You need to use .append() to add elements to a list, I suggest you take a 
> look at the python tutorial:
>  
> https://docs.python.org/2/tutorial/
>  
> Not quite sure what you are doing with i or elem either.
>  
> François
>  
> On Jun 10, 2014, at 10:01 AM, hito koto <hitoko...@gmail.com> wrote:
>  
> > So, I also have errors:
> >
> >
> > >>> def foo(x):
> > ... myList = []
> > ... if isinstance(x, list):
> > ... for i in x:
> > ... elem = i
> > ... return myList + foo(elem)
> > ... else:
> > ... return 1
> > ...
> > >>>
> > >>> foo(a)
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File "", line 6, in foo
> >   File "", line 6, in foo
> > TypeError: can only concatenate list (not "int") to list
> >
> >
> >
> >
> >
> > 2014年6月10日火曜日 22時53分28秒 UTC+9 François Schiettecatte:
> > You are redefining 'list' on  line 2, rename list to myList as follows:
> >
> > def foo(x):
> > myList = []
> > if isinstance(x, list):
> > for i in x:
> > elem = i
> > return myList + foo(i)
> > else:
> > return 1
> >
> > And take this to a python list, this is for django.
> >
> > Cheers
> >
> > François
> >
> >
> > On Jun 10, 2014, at 9:43 AM, hito koto <hitoko...@gmail.com> wrote:
> >
> > > hi,
> > >
> > > I have this erroes:
> > >
> > > >>> def foo(x):
> > > ... list = []
> > > ... if isinstance(x, list):
> > > ... for i in x:
> > > ... elem = i
> > > ... return list + foo(i)
> > > ... else:
> > > ... return 1
> > > ...
> > > >>> foo(a)
> > > Traceback (most recent call last):
> > >   File "", line 1, in 
> > >   File "", line 3, in foo
> > > TypeError: isinstance() arg 2 must be a class, type, or tuple of classes 
> > > and types
> > >
> > >
> > >
> > > 2014年6月10日火曜日 22時27分42秒 UTC+9 Andrew Farrell:
> > > In general, I recommend adding the line "import pdb;pdb.set_trace()"
> > > to the top of your function and walking through it to see why it doesn't 
> > > work.
> > >
> > > def foo(x):
> > > import pdb;pdb.set_trace()
> > >
> > > list = []
> > > if isinstance(x, list):
> > > for i in x:
> > > elem = i
> > > return list + foo(i)
> > > else:
> > > return 1
> > >
> > > See https://docs.python.org/2/library/pdb.html on how pdb works.
> > > There are faster ways to debug, but when starting out, pdb lets you see 
> > > what is happening as you run the function.
> > >
> > >
> > > Some questions I have about this function:
> > > - What is the purpose of the "elem" function? It is never accessed.
> > > - What is the purpose of returning 1 if the argument is not a list?
> > > - Why is it named "foo" rather than something that tells me what the 
> > > purpose of the function is?
> > >
> > >
> > > On Tue, Jun 10, 2014 at 8:16 AM, hito koto <hitoko...@gmail.com> wrote:
> > > Hello,
> > >
> > > I don't know how can i do to change to write python function
> > > I want to following code change to write python function or change to 
> > &

Re: Django python fuction

2014-06-10 Thread François Schiettecatte
You need to use .append() to add elements to a list, I suggest you take a look 
at the python tutorial:

https://docs.python.org/2/tutorial/

Not quite sure what you are doing with i or elem either.

François

On Jun 10, 2014, at 10:01 AM, hito koto <hitokoto2...@gmail.com> wrote:

> So, I also have errors:
> 
> 
> >>> def foo(x):
> ... myList = []
> ... if isinstance(x, list):
> ... for i in x:
> ... elem = i
> ... return myList + foo(elem)
> ... else:
> ... return 1
> ...
> >>>
> >>> foo(a)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "", line 6, in foo
>   File "", line 6, in foo
> TypeError: can only concatenate list (not "int") to list
> 
> 
> 
> 
> 
> 2014年6月10日火曜日 22時53分28秒 UTC+9 François Schiettecatte:
> You are redefining 'list' on  line 2, rename list to myList as follows: 
> 
> def foo(x): 
> myList = [] 
> if isinstance(x, list): 
> for i in x: 
> elem = i 
> return myList + foo(i) 
> else: 
> return 1 
> 
> And take this to a python list, this is for django. 
> 
> Cheers 
> 
> François 
> 
> 
> On Jun 10, 2014, at 9:43 AM, hito koto <hitoko...@gmail.com> wrote: 
> 
> > hi, 
> > 
> > I have this erroes: 
> > 
> > >>> def foo(x): 
> > ... list = [] 
> > ... if isinstance(x, list): 
> > ... for i in x: 
> > ... elem = i 
> > ... return list + foo(i) 
> > ... else: 
> > ... return 1 
> > ... 
> > >>> foo(a) 
> > Traceback (most recent call last): 
> >   File "", line 1, in  
> >   File "", line 3, in foo 
> > TypeError: isinstance() arg 2 must be a class, type, or tuple of classes 
> > and types 
> > 
> > 
> > 
> > 2014年6月10日火曜日 22時27分42秒 UTC+9 Andrew Farrell: 
> > In general, I recommend adding the line "import pdb;pdb.set_trace()" 
> > to the top of your function and walking through it to see why it doesn't 
> > work. 
> > 
> > def foo(x): 
> > import pdb;pdb.set_trace() 
> > 
> > list = [] 
> > if isinstance(x, list): 
> > for i in x: 
> > elem = i 
> > return list + foo(i) 
> > else: 
> > return 1 
> > 
> > See https://docs.python.org/2/library/pdb.html on how pdb works. 
> > There are faster ways to debug, but when starting out, pdb lets you see 
> > what is happening as you run the function. 
> > 
> > 
> > Some questions I have about this function: 
> > - What is the purpose of the "elem" function? It is never accessed. 
> > - What is the purpose of returning 1 if the argument is not a list? 
> > - Why is it named "foo" rather than something that tells me what the 
> > purpose of the function is? 
> > 
> > 
> > On Tue, Jun 10, 2014 at 8:16 AM, hito koto <hitoko...@gmail.com> wrote: 
> > Hello, 
> > 
> > I don't know how can i do to change to write python function 
> > I want to following code change to write python function or change to write 
> >  recursive definition 
> > >>> y = [10, 12, [13, [14, 9], 16], 7] 
> > >>> z = copy.deepcopy(y) 
> > >>> y 
> > [10, 12, [13, [14, 9], 16], 7] 
> > >>> z 
> > [10, 12, [13, [14, 9], 16], 7] 
> > >>> z[2][1][1] 
> > 9 
> > >>> z[2][1][1] = 88 
> > >>> z 
> > [10, 12, [13, [14, 88], 16], 7] 
> > [10, 12, [13, [14, 9], 16], 7] 
> > >>> 
> > 
> > this is my use function but not work: 
> > 
> > def foo(x): 
> > list = [] 
> > if isinstance(x, list): 
> > for i in x: 
> > elem = i 
> > return list + foo(i) 
> > else: 
> > return 1 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users...@googlegroups.com. 
> > To post to this group, send email to django...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discuss

Re: Django python fuction

2014-06-10 Thread François Schiettecatte
You are redefining 'list' on  line 2, rename list to myList as follows:

def foo(x):
myList = []
if isinstance(x, list):
for i in x:
elem = i
return myList + foo(i)
else:
return 1

And take this to a python list, this is for django.

Cheers

François


On Jun 10, 2014, at 9:43 AM, hito koto  wrote:

> hi,
> 
> I have this erroes:
> 
> >>> def foo(x):
> ... list = []
> ... if isinstance(x, list):
> ... for i in x:
> ... elem = i
> ... return list + foo(i)
> ... else:
> ... return 1
> ...
> >>> foo(a)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "", line 3, in foo
> TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and 
> types
> 
> 
> 
> 2014年6月10日火曜日 22時27分42秒 UTC+9 Andrew Farrell:
> In general, I recommend adding the line "import pdb;pdb.set_trace()"
> to the top of your function and walking through it to see why it doesn't work.
> 
> def foo(x):
> import pdb;pdb.set_trace()
> 
> list = []
> if isinstance(x, list):
> for i in x:
> elem = i
> return list + foo(i)
> else:
> return 1
> 
> See https://docs.python.org/2/library/pdb.html on how pdb works.
> There are faster ways to debug, but when starting out, pdb lets you see what 
> is happening as you run the function.
> 
> 
> Some questions I have about this function:
> - What is the purpose of the "elem" function? It is never accessed.
> - What is the purpose of returning 1 if the argument is not a list?
> - Why is it named "foo" rather than something that tells me what the purpose 
> of the function is?
> 
> 
> On Tue, Jun 10, 2014 at 8:16 AM, hito koto  wrote:
> Hello,
> 
> I don't know how can i do to change to write python function
> I want to following code change to write python function or change to write  
> recursive definition
> >>> y = [10, 12, [13, [14, 9], 16], 7]
> >>> z = copy.deepcopy(y)
> >>> y
> [10, 12, [13, [14, 9], 16], 7]
> >>> z
> [10, 12, [13, [14, 9], 16], 7]
> >>> z[2][1][1]
> 9
> >>> z[2][1][1] = 88
> >>> z
> [10, 12, [13, [14, 88], 16], 7]
> [10, 12, [13, [14, 9], 16], 7]
> >>>
> 
> this is my use function but not work:
> 
> def foo(x):
> list = []
> if isinstance(x, list):
> for i in x:
> elem = i
> return list + foo(i)
> else:
> return 1
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/cf982ef6-1398-4292-9001-eab418f2035a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/2347967a-55c4-400b-9bf3-7aacc4f27311%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/97331564-3E2E-4425-9BEA-70C932CA1064%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Transform list comprehension back to traditional looping construct, how?

2014-06-01 Thread François Schiettecatte
.extend() takes as a parameter something that can be iterated over and appends 
it to the list. Something that can be iterated over includes other lists, sets, 
tuples, dictionaries, see https://docs.python.org/2/tutorial/datastructures.html

François

On Jun 1, 2014, at 9:00 AM, Pepsodent Cola  wrote:

> At first I was trying to use list.append but then Python complained that 
> append could only take 1 argument.  So I google around and list.extend said 
> that it could take more arguments so I just went with it.
> 
> What is this right method you are thinking about?  My imagination is very 
> limited I only know of append but not sure how to work with it in this 
> situation.
> 
> 
> 
> On Sunday, June 1, 2014 2:52:33 PM UTC+2, Masklinn wrote:
> 
> On 2014-06-01, at 14:29 , Pepsodent Cola  wrote: 
> 
> > Hi, I want to transform my articles_list5 list comprehension back to a 
> > traditional looping construct to make things easier to read. 
> > The articles_list5 returns a list of tuples. 
> > 
> > But when I try to do the same using traditional looping in articles_list6 
> > then I just get one long list from everything.  How do I transform list5 to 
> > list6 correctly so it still returns a list of tuples? 
> 
> By using the right method? Why are you calling list.extend?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/095e6321-4337-4bcb-b55d-07a273f515fb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C59E37CD-0920-4438-A46E-E40777B8670B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: BookMarker Project - Opening local files on localhost through Django generated pages

2014-05-22 Thread François Schiettecatte
You are not going to get a work-around to a page being served by a web server 
not having access to the local file system, that would be a serious bug in the 
browser security model.

What you can do is have the webpage be a file on your drive, open that with a 
browser (locally, not via a web server) and make REST/AJAX calls to your web 
server returning JSONP encoded data.

Even easier, just have the browser store your bookmarks in the cloud, you can 
do that with Safari, Chrome and Firefox. You wont be able to share bookmarks 
across browsers, but if you stick to Chrome you just need to sign into you 
goggle account on the computer you are using. No need for 
django/webservers/etc... in this case.

François

On May 22, 2014, at 2:51 PM, Aseem Bansal <asmbans...@gmail.com> wrote:

> This bookmarker that I want to make will be th repacement for my webbrowser's 
> boomarks so I will be storing the bookmarks in sqlite DB. As per my 
> understanding using html5 local storage is more of a temporary storage. A 
> sqlite3 db will be portable hence keeping my bookmarks with me in case I want 
> to transfer computers.  Didn't get what will be insecure?Storage into sqlite3 
> db or turning off web browser's security?
> 
> I am not going to hold it against the framework. I am just going to look for 
> a workaround. There is always a workaround. Client and server are on the same 
> machine and they will be even after this is complete so why cannot I just ask 
> the server to open the webpage? The security applies to browser's not 
> allowing file protocol but my project's code is Python and there is 
> webbrowser module available to server. Couldn't I just ask the server to open 
> the webpage? They are after all on same machine. Any problems in that or am I 
> missing something here?
> 
> On Friday, May 23, 2014 12:03:09 AM UTC+5:30, C. Kirby wrote:
> There are not really any workarounds, just different architecture - save your 
> bookmarks to the django project instead of on the local filesystem. You can 
> also look into using html5 local storage. Just note that either of these 
> architecture changes would mean rolling your own bookmark system instead of 
> utilizing the one you use now. It is fundamentally insecure to do it the way 
> you want to do it, and unlikely to be hacked around.
> Sometimes projects fail due to outside forces or not completely understanding 
> the problem domain. This may be one of those cases, and that is unfortunate.
> If this is your first experience with django, don't hold it against the 
> framework - the issue you have run into unequivocally has nothing to do with 
> django. You would run into the same issue using any web framework in any 
> language.  
> 
> On Thursday, May 22, 2014 1:22:18 PM UTC-5, Aseem Bansal wrote:
> There has to be a workaround. Using webbrowser.open via a request to the 
> server on clicking? That's hacky but I started working on Django for this 
> project and if web browsers cannot do this then  I made  a wrong choice for 
> the technology to use for this project. 
> 
> On Thursday, May 22, 2014 11:46:49 PM UTC+5:30, François Schiettecatte wrote:
> See my previous email, you can get chrome to launch with securities turned 
> off (and Chromium too with the same command line argument), but not Firefox 
> or Safari, not sure about IE. Not even sure if the flag I mentioned will help 
> in this specific case. 
> 
> And I am not sure about the wisdom of running a web browser with securities 
> off. 
> 
> Regardless this is not a django issue but a browser issue, so this is not the 
> forum for this question :) 
> 
> François 
> 
> On May 22, 2014, at 2:10 PM, Aseem Bansal <asmba...@gmail.com> wrote: 
> 
> > I had searched that but there should be a way to give permissions. The 
> > client can give the permissions. Can the client not? 
> > 
> > On Thursday, May 22, 2014 11:28:59 PM UTC+5:30, François Schiettecatte 
> > wrote: 
> > It would also help to know what is giving the error. 
> > 
> > I did a quick google search with the text of the error (which you could 
> > have done), it looks like browsers are not keen on accessing 'file://...' 
> > urls from a web page served by a web server, this for security reasons. For 
> > kicks, I embedded a link to 'file:///Users/francois/Sites/index.html' in a 
> > page served by the django sandbox web server ( 'python manage.py runserver' 
> > ), and none of the browsers I tried would access this file (Safari, FF, 
> > Chrome, IE). 
> > 
> > François 
> > 
> > On May 22, 2014, at 1:39 PM, C. Kirby <mis...@gmail.com> wrote: 
> > 
> > > Errors without code aren't very useful. If you provide the view and 
> > > template you 

Re: BookMarker Project - Opening local files on localhost through Django generated pages

2014-05-22 Thread François Schiettecatte
See my previous email, you can get chrome to launch with securities turned off 
(and Chromium too with the same command line argument), but not Firefox or 
Safari, not sure about IE. Not even sure if the flag I mentioned will help in 
this specific case.

And I am not sure about the wisdom of running a web browser with securities off.

Regardless this is not a django issue but a browser issue, so this is not the 
forum for this question :)

François

On May 22, 2014, at 2:10 PM, Aseem Bansal <asmbans...@gmail.com> wrote:

> I had searched that but there should be a way to give permissions. The client 
> can give the permissions. Can the client not?
> 
> On Thursday, May 22, 2014 11:28:59 PM UTC+5:30, François Schiettecatte wrote:
> It would also help to know what is giving the error. 
> 
> I did a quick google search with the text of the error (which you could have 
> done), it looks like browsers are not keen on accessing 'file://...' urls 
> from a web page served by a web server, this for security reasons. For kicks, 
> I embedded a link to 'file:///Users/francois/Sites/index.html' in a page 
> served by the django sandbox web server ( 'python manage.py runserver' ), and 
> none of the browsers I tried would access this file (Safari, FF, Chrome, IE). 
> 
> François 
> 
> On May 22, 2014, at 1:39 PM, C. Kirby <mis...@gmail.com> wrote: 
> 
> > Errors without code aren't very useful. If you provide the view and 
> > template you are rendering it will give us something to latch onto and 
> > debug 
> > 
> > Kirby 
> > 
> > On Thursday, May 22, 2014 12:23:06 PM UTC-5, Aseem Bansal wrote: 
> > I understand the requirement of file protocol. That's how I keep bookmarks 
> > in Chrome currently. But when I served the same as a hyperlink I am getting 
> > Not allowed to load local resource: 
> > 
> > On Thursday, May 22, 2014 10:14:39 PM UTC+5:30, François Schiettecatte 
> > wrote: 
> > You can do this with a 'file://...' url, that will cause the browser to 
> > open a file on the local file system, the browser won't need to ask for 
> > permission, the only issue is that the files will need to be in a known 
> > path. 
> > 
> > François 
> > 
> > On May 22, 2014, at 12:34 PM, Aseem Bansal <asmba...@gmail.com> wrote: 
> > 
> > > The server will not be able to open pages stored on client machine but 
> > > the client user should be able to open html pages stored on client 
> > > machine by clicking on a hyperlink manually. 
> > > 
> > > On Thursday, May 22, 2014 10:02:52 PM UTC+5:30, Aseem Bansal wrote: 
> > > I want the the webpage served to the client machine from the server to 
> > > have a hyperlink. The hyperlink will be for a html file stored on the 
> > > client machine. After the webpage has been served to the client 
> > > webbrowser then when the client user clicks on the hyperlink I want the 
> > > html page to be opened in the webbrowser. The webbrowser can ask for the 
> > > permissions if necessary. 
> > > 
> > > Basically I want a interface where I can manage my bookmarks - offline or 
> > > online for which I am making this. So any ideas now? 
> > > 
> > > On Thursday, May 22, 2014 1:45:53 PM UTC+5:30, Daniel Roseman wrote: 
> > > On Tuesday, 20 May 2014 19:29:06 UTC+1, Aseem Bansal wrote: 
> > > I am working on a BookMarker project for managing my bookmarks. I was 
> > > creating the search page for lisitng bookmarks as per categories. I hit a 
> > > snag while testing it. I am unable to open locally stored webpages. I 
> > > understand that it is for security purposes but is it possible 
> > > (cross-browser way) to grant permissions for a app to open locally stored 
> > > files? The app can ask for permissions for this. 
> > > 
> > > You'll need to be a bit clearer. Ignoring for the moment the fact that 
> > > the client and the server are the same machine in development, are you 
> > > hoping for your server to be able to open pages stored locally on your 
> > > client? That's not going to be possible, for what I hope are obvious 
> > > reasons. If that's not what you mean, you should explain in more detail. 
> > > -- 
> > > DR. 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to django-users...@googlegroups.com. 
> > > To post to this group, send email to django...

Re: BookMarker Project - Opening local files on localhost through Django generated pages

2014-05-22 Thread François Schiettecatte
Well ok, this is not a django issue. Like I said in my previous email the 
browser is blocking this for security/sandboxing issue. You could start chrome 
with security ( see 
http://superuser.com/questions/593726/is-it-possible-to-run-chrome-with-and-without-web-security-at-the-same-time
 ) and see if that helps. But other browsers will have the same issue.

If you think about it, it makes perfect sense for a browser to block local file 
access from a page served by a web server, otherwise it would be trivial for 
anyone to write some javascript to access local files and send them off back to 
the server. 

François

On May 22, 2014, at 2:01 PM, Aseem Bansal <asmbans...@gmail.com> wrote:

> The error is coming in Chrome's console not in Python/Django when I try to 
> click on the link in my webbrowser. The HTML generated is below
> 
> 
> 
>  target="_blank">Python 3.4 Docs
> 
> 
> 
> 
> On Thursday, May 22, 2014 11:30:31 PM UTC+5:30, Aseem Bansal wrote:
> Here is the code so far. I have just kept Bootstrap and JQuery ignored in 
> git. Rest is there
> 
> https://github.com/anshbansal/Bookmarker
> 
> On Thursday, May 22, 2014 11:09:09 PM UTC+5:30, C. Kirby wrote:
> Errors without code aren't very useful. If you provide the view and template 
> you are rendering it will give us something to latch onto and debug
> 
> Kirby
> 
> On Thursday, May 22, 2014 12:23:06 PM UTC-5, Aseem Bansal wrote:
> I understand the requirement of file protocol. That's how I keep bookmarks in 
> Chrome currently. But when I served the same as a hyperlink I am getting Not 
> allowed to load local resource:
> 
> On Thursday, May 22, 2014 10:14:39 PM UTC+5:30, François Schiettecatte wrote:
> You can do this with a 'file://...' url, that will cause the browser to open 
> a file on the local file system, the browser won't need to ask for 
> permission, the only issue is that the files will need to be in a known path. 
> 
> François 
> 
> On May 22, 2014, at 12:34 PM, Aseem Bansal <asmba...@gmail.com> wrote: 
> 
> > The server will not be able to open pages stored on client machine but the 
> > client user should be able to open html pages stored on client machine by 
> > clicking on a hyperlink manually. 
> > 
> > On Thursday, May 22, 2014 10:02:52 PM UTC+5:30, Aseem Bansal wrote: 
> > I want the the webpage served to the client machine from the server to have 
> > a hyperlink. The hyperlink will be for a html file stored on the client 
> > machine. After the webpage has been served to the client webbrowser then 
> > when the client user clicks on the hyperlink I want the html page to be 
> > opened in the webbrowser. The webbrowser can ask for the permissions if 
> > necessary. 
> > 
> > Basically I want a interface where I can manage my bookmarks - offline or 
> > online for which I am making this. So any ideas now? 
> > 
> > On Thursday, May 22, 2014 1:45:53 PM UTC+5:30, Daniel Roseman wrote: 
> > On Tuesday, 20 May 2014 19:29:06 UTC+1, Aseem Bansal wrote: 
> > I am working on a BookMarker project for managing my bookmarks. I was 
> > creating the search page for lisitng bookmarks as per categories. I hit a 
> > snag while testing it. I am unable to open locally stored webpages. I 
> > understand that it is for security purposes but is it possible 
> > (cross-browser way) to grant permissions for a app to open locally stored 
> > files? The app can ask for permissions for this. 
> > 
> > You'll need to be a bit clearer. Ignoring for the moment the fact that the 
> > client and the server are the same machine in development, are you hoping 
> > for your server to be able to open pages stored locally on your client? 
> > That's not going to be possible, for what I hope are obvious reasons. If 
> > that's not what you mean, you should explain in more detail. 
> > -- 
> > DR. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users...@googlegroups.com. 
> > To post to this group, send email to django...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/7df2d6a2-dcc9-4551-8617-a4eb30003926%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe fro

Re: BookMarker Project - Opening local files on localhost through Django generated pages

2014-05-22 Thread François Schiettecatte
It would also help to know what is giving the error.

I did a quick google search with the text of the error (which you could have 
done), it looks like browsers are not keen on accessing 'file://...' urls from 
a web page served by a web server, this for security reasons. For kicks, I 
embedded a link to 'file:///Users/francois/Sites/index.html' in a page served 
by the django sandbox web server ( 'python manage.py runserver' ), and none of 
the browsers I tried would access this file (Safari, FF, Chrome, IE).

François

On May 22, 2014, at 1:39 PM, C. Kirby <mist...@gmail.com> wrote:

> Errors without code aren't very useful. If you provide the view and template 
> you are rendering it will give us something to latch onto and debug
> 
> Kirby
> 
> On Thursday, May 22, 2014 12:23:06 PM UTC-5, Aseem Bansal wrote:
> I understand the requirement of file protocol. That's how I keep bookmarks in 
> Chrome currently. But when I served the same as a hyperlink I am getting Not 
> allowed to load local resource:
> 
> On Thursday, May 22, 2014 10:14:39 PM UTC+5:30, François Schiettecatte wrote:
> You can do this with a 'file://...' url, that will cause the browser to open 
> a file on the local file system, the browser won't need to ask for 
> permission, the only issue is that the files will need to be in a known path. 
> 
> François 
> 
> On May 22, 2014, at 12:34 PM, Aseem Bansal <asmba...@gmail.com> wrote: 
> 
> > The server will not be able to open pages stored on client machine but the 
> > client user should be able to open html pages stored on client machine by 
> > clicking on a hyperlink manually. 
> > 
> > On Thursday, May 22, 2014 10:02:52 PM UTC+5:30, Aseem Bansal wrote: 
> > I want the the webpage served to the client machine from the server to have 
> > a hyperlink. The hyperlink will be for a html file stored on the client 
> > machine. After the webpage has been served to the client webbrowser then 
> > when the client user clicks on the hyperlink I want the html page to be 
> > opened in the webbrowser. The webbrowser can ask for the permissions if 
> > necessary. 
> > 
> > Basically I want a interface where I can manage my bookmarks - offline or 
> > online for which I am making this. So any ideas now? 
> > 
> > On Thursday, May 22, 2014 1:45:53 PM UTC+5:30, Daniel Roseman wrote: 
> > On Tuesday, 20 May 2014 19:29:06 UTC+1, Aseem Bansal wrote: 
> > I am working on a BookMarker project for managing my bookmarks. I was 
> > creating the search page for lisitng bookmarks as per categories. I hit a 
> > snag while testing it. I am unable to open locally stored webpages. I 
> > understand that it is for security purposes but is it possible 
> > (cross-browser way) to grant permissions for a app to open locally stored 
> > files? The app can ask for permissions for this. 
> > 
> > You'll need to be a bit clearer. Ignoring for the moment the fact that the 
> > client and the server are the same machine in development, are you hoping 
> > for your server to be able to open pages stored locally on your client? 
> > That's not going to be possible, for what I hope are obvious reasons. If 
> > that's not what you mean, you should explain in more detail. 
> > -- 
> > DR. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users...@googlegroups.com. 
> > To post to this group, send email to django...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/7df2d6a2-dcc9-4551-8617-a4eb30003926%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/4e5e9e63-0771-4a04-8cbc-91361106f81c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B4F76619-6314-424B-B057-5930ED880AF1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: BookMarker Project - Opening local files on localhost through Django generated pages

2014-05-22 Thread François Schiettecatte
You can do this with a 'file://...' url, that will cause the browser to open a 
file on the local file system, the browser won't need to ask for permission, 
the only issue is that the files will need to be in a known path.

François

On May 22, 2014, at 12:34 PM, Aseem Bansal  wrote:

> The server will not be able to open pages stored on client machine but the 
> client user should be able to open html pages stored on client machine by 
> clicking on a hyperlink manually. 
> 
> On Thursday, May 22, 2014 10:02:52 PM UTC+5:30, Aseem Bansal wrote:
> I want the the webpage served to the client machine from the server to have a 
> hyperlink. The hyperlink will be for a html file stored on the client 
> machine. After the webpage has been served to the client webbrowser then when 
> the client user clicks on the hyperlink I want the html page to be opened in 
> the webbrowser. The webbrowser can ask for the permissions if necessary.
> 
> Basically I want a interface where I can manage my bookmarks - offline or 
> online for which I am making this. So any ideas now?
> 
> On Thursday, May 22, 2014 1:45:53 PM UTC+5:30, Daniel Roseman wrote:
> On Tuesday, 20 May 2014 19:29:06 UTC+1, Aseem Bansal wrote:
> I am working on a BookMarker project for managing my bookmarks. I was 
> creating the search page for lisitng bookmarks as per categories. I hit a 
> snag while testing it. I am unable to open locally stored webpages. I 
> understand that it is for security purposes but is it possible (cross-browser 
> way) to grant permissions for a app to open locally stored files? The app can 
> ask for permissions for this.
> 
> You'll need to be a bit clearer. Ignoring for the moment the fact that the 
> client and the server are the same machine in development, are you hoping for 
> your server to be able to open pages stored locally on your client? That's 
> not going to be possible, for what I hope are obvious reasons. If that's not 
> what you mean, you should explain in more detail.
> --
> DR.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/7df2d6a2-dcc9-4551-8617-a4eb30003926%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/76D50DFA-6030-4529-951C-C4643DFA3064%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Many links to one function in url.py

2014-05-21 Thread François Schiettecatte
You can also do something like this:

(r'^link(?Pd+)/$', 'project.apps.main.get'),

project.apps.main.get will be passed a parameter called linkID containing the 
number, and if you wanted to limit it to digits 1 through 4, you would use:

(r'^link(?P[1-4])/$', 'project.apps.main.get'),

Cheers

François

On May 21, 2014, at 12:32 PM, Tom Evans  wrote:

> On Wed, May 21, 2014 at 3:40 AM, Jun Tanaka  wrote:
>> Hi there.
>> 
>> 
>> I hope to know the solution for the following:
>> say, there are several links to one function but I would like to identify
>> which link that come from.
>> 
>> url.py looks
>> 
>>(r'^link1/$', 'project.apps.main.get'),
>>(r'^link2/$', 'project.apps.main.get'),
>>(r'^link3/$', 'project.apps.main.get'),
>>(r'^link4/$', 'project.apps.main.get'),
>> 
>> In 'get' function, how can I know which link does that come from? Later, I
>> want to get a parameter , 1, 2, 3, 4 in that function.
>> 
>> If anyone have a good idea? please teach me.
> 
> You can add arguments to send to the view in the url:
> 
> https://docs.djangoproject.com/en/1.6/topics/http/urls/#passing-extra-options-to-view-functions
> 
> Eg:
> 
> urlpatterns = patterns('',
>url(r'^link1/$', 'project.apps.main.get', { 'type': 'link1' }),
>url(r'^link2/$', 'project.apps.main.get', { 'type': 'link2' }),
>url(r'^link3/$', 'project.apps.main.get', { 'type': 'link3' }),
>url(r'^link4/$', 'project.apps.main.get', { 'type': 'link4' }),
> )
> 
> Make sure that you use the url() function rather than a raw tuple.
> 
> Cheers
> 
> Tom
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAFHbX1Kjey_jLvi-GsNq0kOFU2PzsXVTx231nrOxrVBHkHsx%2BA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8C49BDCD-F548-44D9-85A2-9E423604AF6C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: M2M frustration

2014-05-18 Thread François Schiettecatte
Olga

This won't work, you need to send the request to:

 django-users+unsubscr...@googlegroups.com

(see the bottom of this email for more information.

François



On May 18, 2014, at 4:20 PM, Olga Burdonova  
wrote:

> unsubscibe
> 
> 
> 2014-05-18 9:01 GMT+02:00 Yusuf Düzgün :
> http://yusufduzgun.com/blog/Django404/ i hope help you :) .
> 
> 17 Mayıs 2014 Cumartesi 19:20:56 UTC+3 tarihinde Joris yazdı:
> Dear all, please help me with this unsolved mystery. 
> 
> Error: "Cannot resolve keyword u'' into field. Choices 
> are: " 
> 
> 
> 1) Error in admin 
> In the admin it only happens when DEBUG=True. Works perfectly when 
> DEBUG=False. 
> The error occurs when opening the form view of the model that has the 
> M2M field. 
> 
> 2) In code 
> Here the error is also present when DEBUG=False. 
> The error occurs when accessing the model field, field, for example 
> self.my_m2m_field.all() 
> 
> 
> The error doesn't happen locally on the Django/Python debug server. On 
> the testing server, which is Apache2 + wsgi, it does occur. The versions 
> of Python  (2.7) and Django (1.5.7) are the same on both computers. 
> The result is that a fellow developer is accusing me of being neglective 
> with testing the code before uploading it :-( 
> 
> There have been people with similar problems, but it has never been solved: 
> https://groups.google.com/forum/#!topic/django-users/E4UVZHf6kP8 
> http://stackoverflow.com/questions/19145787/fielderror-cannot-resolve-keyword--into-field
>  
> http://chase-seibert.github.io/blog/2010/04/30/django-manytomany-error-cannot-resolve-keyword-xxx-into-a-field.html
>  
> http://code.djangoproject.com/ticket/1796 (7 year old django bug which 
> is reported fixed but in fact is not) 
> 
> 
> So it seems to be a bug deep down in Django. 
> This makes the use of M2M fields impossible for my application, which is 
> quite a problem. 
> 
> Instead of trying to find the bug in Django, would anyone have any clue 
> why it does work on the Python debug server and not on Apache2? 
> 
> 
> Thank you! 
> J 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f4184af8-10a5-4d84-b92f-448b830a1b8f%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAEKo5h_GNuc6OAD%3DnULOUvthpY5z5%2BBJuY80GFZ5eUZshu-83Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: New to Django

2014-05-10 Thread François Schiettecatte
I would start with the tutorial:

https://docs.djangoproject.com/en/1.6/intro/tutorial01/

And there is a wealth of documentation on the site itself:

https://www.djangoproject.com

François

On May 10, 2014, at 2:06 PM, ashish garg  wrote:

> Hey
> I am new to Django.I have heard a lot about the powerful features it has.I 
> want to learn Django.
> Any sort of help would be really appreciated.
> How can i get started?
> I am using Django 1.6 and python 2.7.
> How can i get used to it's concepts to gain in-depths in short span of time?
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/b7cdc4a9-7b86-48b7-871c-a6272d09d114%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: django documentation tutorial 3 questions. home page missing.

2014-05-09 Thread François Schiettecatte
Presumably because there is nothing set to handle localhost:8000/ in your 
urlpatterns  like this:

# Root view, goes to 'app.home.views.page' (r'^$', 
'app.home.views.page'), 


François

On May 8, 2014, at 11:46 PM, cheesiong lim  wrote:

> hi all,
>  i am learning django by using django 1.6 documents tutorial 1 - 6.
>  this round is my 4th try and, previous 3 try was successful and i understand 
> more on every try.
> 
>  i am in tutorial 3 now, to create views.
> 
>  according to the documents, after i created a view, i need to map it to a 
> URL.
>  so i follow the documents to add a urls.py in the polls directory.
>  and then i follow the document to add include() to mysite/urls.py
>  i am able to so called wired an index view into the polls view.
> 
>  now if i go back to localhost:8000, i get an error page,
>  so my question is
>  1) WHY?
>  2) how to get back my localhost:8080 index page co-exist with  the polls 
> index page?
> 
> thank you very much everyone for your time. i am new and sorry for so simple 
> question.
> thank you.
> 
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f3f727db-3c1f-493d-a581-f19376a9a6d8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: How would you do this cleanly in Django (remembering the states of check boxes in multiple pages)

2014-05-08 Thread François Schiettecatte
I would create a number of DIVs, put 100 production in each DIV and then 
show/hide the DIVs as needed using some javascript (like JQuery)

François

On May 8, 2014, at 9:18 AM, Chi-Cheong Weng  wrote:

> Hi guys,
> 
> I have been using Django for a little more than a year now, but I still 
> cannot think of a clean way of achieving this:
> 
> Let's say I have 1000 products in the db and I want to create a campaign to 
> promote the products. I am displaying the products 100 items each time and 
> each item has a check box. I want to be able to go back and forth between 
> different pages to select products and then when I hit the submit button, the 
> server will know what products I select.
> 
> How would you do this? Will you use other technology stack such as ajax, 
> jquery, etc?
> 
> Thanks.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/3b7c61b7-647e-48c9-907a-3a52dad7c183%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: What is different of handling character code between pure Python and Django?

2014-04-27 Thread François Schiettecatte
You should check the encoding of stdout when running from django, I suspect 
that it is plain ascii rather than utf-8 which is what you are probably getting 
when running standalone. Check sys.getdefaultencoding().

Note that this has nothing to do with django, just the way stdin/stdout are set 
up depending on how your script is running.

Also see:


http://stackoverflow.com/questions/1473577/writing-unicode-strings-via-sys-stdout-in-python
http://stackoverflow.com/questions/15740236/stdout-encoding-in-python

http://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python

François

On Apr 27, 2014, at 2:13 AM, Sugita Shinsuke  wrote:

> Hi there
> 
> I’d like to run Java code via Django.
> 
> The Java code, javaprogram use like below.
> 
> —
> java javaprogram [text] [file_name]
> —
> 
> text is parameter. multi-byte character is also okey.
> file_name is generate file name.
> 
> So, I run the stand-alone Python program like below could run fine.
> —
> java_file = ‘javaprogram’
> file_name = ‘filename’
> text = ‘あいうえお’ #Japanese character
> java_file_path = ‘/path/to/‘
> class_path = ‘-cp ' + java_file_path
> 
> cmd = “java {0} {1} {2} {3}".format(class_path, java_file, text, file_name)
> 
> import subprocess
> proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, 
> stderr=subprocess.STDOUT)
> —
> 
> But, I run same program in Django.
> It couldn’t work. However, if text is English, it works fine.
> 
> What is different of handling character code between pure Python and Django?
> And, could you tell me how to resolve it?
> 
> Thank you.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/cd081056-2a39-40f5-94c8-7b470bf827ea%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Django

2014-04-19 Thread François Schiettecatte
The tutorial on the django site is very good, and there is a wealth of 
documentation. That is how I learnt django.

And the OReilly books for python are great, as is Dive Into Python by Pilgrim.

François

On Apr 19, 2014, at 2:07 AM, Srinivasulu Reddy  
wrote:

> 
> Hello folks,
>  I am new to python/django . i am earning myself i want to 
> know effective way of learning python / django . i am following django book 
> for django .  Light bird apps also.
> 
> So please anyone can help me to find the good way learn the python / django . 
> I love to learn the python / django .
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/00b6b705-9442-44a1-b61e-968ccab6ee1f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Autoupdate

2014-04-14 Thread François Schiettecatte
Hi

You will need to either use  in the  
section of your html (ugly) or use javascript to poll the server for new data 
on a regular interval.

François

On Apr 14, 2014, at 8:29 AM, Saransh Mehta  wrote:

> I want some data to autoupdate on my homepage as more entries come into the 
> database. It is more or less like the news feed feature of Facebook.
> How do we do that?
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/736ef367-3ca0-456b-8c8e-3f792946dca4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Django 1.5.4 sql generation just generates one model field (PostgreSQL)

2014-04-03 Thread François Schiettecatte
You have a comma at the end of this:

bar = models.IntegerField(),

Could that be the issue?

François

On Apr 3, 2014, at 6:24 PM, Jorge Arevalo  wrote:

> Hello,
> 
> I have this dummy models.py
> 
> from django.db import models
> 
> class Foo(models.Model):
> bar = models.IntegerField(),
> // more integer fields here...
> xyz = models.IntegerField()
> 
> And I want to know the SQL code generated for PostgreSQL, executing:
> 
> python manage.py sqlall myapp
> 
> No south involved. Just Django 1.5.4. And this is the SQL output
> 
> BEGIN;
> CREATE TABLE "myapp_foo" (
> "id" serial NOT NULL PRIMARY KEY,
> "xyz" integer NOT NULL
> )
> ;
> 
> COMMIT;
> 
> Just the internal id and the last specified field were generated. The rest 
> are ignored. No matter how many fields or what fields. Just takes the last 
> one, and generates that output.
> 
> Does it make any sense? I'm running Django 1.5.4 under a virtualenv, using 
> Python 2.7 in Ubuntu 12.04. This is the complete output of pip freeze in my 
> virtualenv
> 
> Django==1.5.4
> Jinja2==2.7.1
> MarkupSafe==0.18
> PIL==1.1.7
> Pygments==1.6
> Sphinx==1.1.3
> Unipath==1.0
> argparse==1.2.1
> distribute==0.6.24
> django-admin-tools==0.5.1
> django-appconf==0.6
> django-bootstrap3==2.0.0
> django-colorful==0.1.3
> django-compressor==1.3
> django-extensions==1.2.5
> django-geojson==2.1.1
> django-guardian==1.1.1
> django-leaflet==0.8.2
> django-model-utils==1.5.0
> django-secure==1.0
> django-sorting==0.1
> django-waffle==0.9.2
> docutils==0.11
> feedparser==5.1.3
> psycopg2==2.5.1
> requests==2.0.1
> six==1.4.1
> wsgiref==0.1.2
> 
> This is just... weird. Any clues?
> 
> Many thanks in advance
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/3ab753c1-96eb-4386-b031-dbc61aeeec9d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Get secret key from django settings

2014-03-25 Thread François Schiettecatte
110-130 milliseconds to 'import' something, sounds very suspect to me.

François

On Mar 25, 2014, at 12:08 PM, Errfan Wadia  wrote:

> Hi Daniel,
> 
> When I try to get the SECRET_KEY from settings.py in one of the app, it takes 
> around 110-130 millisec. Here I am talking about execution time.
> 
> On Tuesday, 25 March 2014 18:31:01 UTC+5:30, Daniel Roseman wrote:
> On Tuesday, 25 March 2014 06:36:53 UTC, Errfan Wadia wrote:
> Hi,
> 
> I am using from django.conf import settings
> Is there any faster way to get the SECRET_KEY in one of my app from 
> settings.py ?
> 
> What do you mean, faster? In what way is that slow?
> --
> DR. 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/be8a456f-1f0e-47bd-9116-94ac54304b3d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Custom Login page in Django

2014-03-20 Thread François Schiettecatte
You need to have sessions if you want login so you can tie a browser to a user, 
and the CSRF is tied to the session cookie.

F.

On Mar 20, 2014, at 11:28 AM, Aryak Sengupta <aryaksengu...@gmail.com> wrote:

> Alright... Thanks  a lot. But do I really require using sessions for 
> implementing this simple functionality ... Or is it just a bad design that I 
> had been trying?
> 
> On 20 Mar 2014 20:28, "François Schiettecatte" <fschietteca...@gmail.com> 
> wrote:
> See https://docs.djangoproject.com/en/1.6/topics/http/sessions/
> 
> On Mar 20, 2014, at 10:50 AM, Aryak Sengupta <aryaksengu...@gmail.com> wrote:
> 
> > Can you please elaborate
> >
> > On 20 Mar 2014 20:17, "François Schiettecatte" <fschietteca...@gmail.com> 
> > wrote:
> > You may be missing some middleware, eg:
> >
> > 'django.contrib.sessions.middleware.SessionMiddleware',
> > 'django.middleware.csrf.CsrfViewMiddleware',
> >
> > 'django.contrib.sessions',
> >
> > Maybe your browser is rejecting cookies.
> >
> > François
> >
> > On Mar 20, 2014, at 10:43 AM, Aryak Sengupta <aryaksengu...@gmail.com> 
> > wrote:
> >
> > > Yes I do Where am I going wrong then?
> > >
> > > On 20 Mar 2014 20:06, "Robin Lery" <robinl...@gmail.com> wrote:
> > > do you have {% csrf_token % } in your forms?
> > >
> > >
> > > On Thu, Mar 20, 2014 at 7:36 PM, Aryak Sengupta <aryaksengu...@gmail.com> 
> > > wrote:
> > > I am new to Django (but not new to python) and I am looking forward to 
> > > create a customized  page using django.  I have read about django's 
> > > inbuilt authentication system but I want build it from scratch So here 
> > > are the few ideas I am stumbling upon :
> > >
> > >   • Creating a users class in the models.py with username and 
> > > password as the fields (both are CharField)
> > >
> > >   • Creating  two views one named LoginView, which will depict the 
> > > initial login page (such as a form imported from a module named  
> > > forms.py) and another view named LoggedInView which will show only the 
> > > username of the logged user
> > >
> > >   • Mapping them into corresponding URLs
> > > I tried creating it with above mentioned thoughts but I got stuck with an 
> > > error as follows:
> > >
> > > Forbidden (403)
> > > CSRF verification failed. Request aborted.
> > > Help
> > >
> > > Reason given for failure:
> > > CSRF cookie not set.
> > >
> > > I couldn't figure out why possibly I am getting this error for 
> > > incorporating such a simple(and basic) functionality.
> > >
> > > I want to understand the best way/approach to go about this (for 
> > > implementing this functionality). I am not worrying about the error for 
> > > the time being since I didn't spend much time thinking about it (So I am 
> > > not posting any code). I want to get my approach right first. I want to 
> > > be flawless while implementing such basic and elementary stuffs.
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to django-users+unsubscr...@googlegroups.com.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > Visit this group at http://groups.google.com/group/django-users.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/django-users/4f18d65c-8e85-434f-b584-0ab7017f6cf9%40googlegroups.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to django-users+unsubscr...@googlegroups.com.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > Visit this group at http://groups.google.com/group/django-users.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/django-users/CA%2B4-nGq8taHb%2B9%2Bz3%3DxJq-Qitnuf0%3D127O9esk8LZygSQLeSZA%40mail.gmail.com.
> > > For more options, visit ht

Re: Custom Login page in Django

2014-03-20 Thread François Schiettecatte
See https://docs.djangoproject.com/en/1.6/topics/http/sessions/

On Mar 20, 2014, at 10:50 AM, Aryak Sengupta <aryaksengu...@gmail.com> wrote:

> Can you please elaborate
> 
> On 20 Mar 2014 20:17, "François Schiettecatte" <fschietteca...@gmail.com> 
> wrote:
> You may be missing some middleware, eg:
> 
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 
> 'django.contrib.sessions',
> 
> Maybe your browser is rejecting cookies.
> 
> François
> 
> On Mar 20, 2014, at 10:43 AM, Aryak Sengupta <aryaksengu...@gmail.com> wrote:
> 
> > Yes I do Where am I going wrong then?
> >
> > On 20 Mar 2014 20:06, "Robin Lery" <robinl...@gmail.com> wrote:
> > do you have {% csrf_token % } in your forms?
> >
> >
> > On Thu, Mar 20, 2014 at 7:36 PM, Aryak Sengupta <aryaksengu...@gmail.com> 
> > wrote:
> > I am new to Django (but not new to python) and I am looking forward to 
> > create a customized  page using django.  I have read about django's inbuilt 
> > authentication system but I want build it from scratch So here are the few 
> > ideas I am stumbling upon :
> >
> >   • Creating a users class in the models.py with username and password 
> > as the fields (both are CharField)
> >
> >   • Creating  two views one named LoginView, which will depict the 
> > initial login page (such as a form imported from a module named  forms.py) 
> > and another view named LoggedInView which will show only the username of 
> > the logged user
> >
> >   • Mapping them into corresponding URLs
> > I tried creating it with above mentioned thoughts but I got stuck with an 
> > error as follows:
> >
> > Forbidden (403)
> > CSRF verification failed. Request aborted.
> > Help
> >
> > Reason given for failure:
> > CSRF cookie not set.
> >
> > I couldn't figure out why possibly I am getting this error for 
> > incorporating such a simple(and basic) functionality.
> >
> > I want to understand the best way/approach to go about this (for 
> > implementing this functionality). I am not worrying about the error for the 
> > time being since I didn't spend much time thinking about it (So I am not 
> > posting any code). I want to get my approach right first. I want to be 
> > flawless while implementing such basic and elementary stuffs.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/4f18d65c-8e85-434f-b584-0ab7017f6cf9%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/CA%2B4-nGq8taHb%2B9%2Bz3%3DxJq-Qitnuf0%3D127O9esk8LZygSQLeSZA%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/CALTbq1zEC9RPPKmVvTOYqXQ5AgVghzDWd0og2FoeKBJOMyfe1A%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALTbq1xzxJ8LmH6gkLSMcFZ5Ec0X-XW7q1N0v0YpnX_qoJVWtg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Custom Login page in Django

2014-03-20 Thread François Schiettecatte
You may be missing some middleware, eg:

'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 

'django.contrib.sessions',

Maybe your browser is rejecting cookies.

François

On Mar 20, 2014, at 10:43 AM, Aryak Sengupta  wrote:

> Yes I do Where am I going wrong then?
> 
> On 20 Mar 2014 20:06, "Robin Lery"  wrote:
> do you have {% csrf_token % } in your forms?
> 
> 
> On Thu, Mar 20, 2014 at 7:36 PM, Aryak Sengupta  
> wrote:
> I am new to Django (but not new to python) and I am looking forward to create 
> a customized  page using django.  I have read about django's inbuilt 
> authentication system but I want build it from scratch So here are the few 
> ideas I am stumbling upon :
> 
>   • Creating a users class in the models.py with username and password as 
> the fields (both are CharField)
> 
>   • Creating  two views one named LoginView, which will depict the 
> initial login page (such as a form imported from a module named  forms.py) 
> and another view named LoggedInView which will show only the username of the 
> logged user
> 
>   • Mapping them into corresponding URLs
> I tried creating it with above mentioned thoughts but I got stuck with an 
> error as follows:
> 
> Forbidden (403)
> CSRF verification failed. Request aborted.
> Help
> 
> Reason given for failure:
> CSRF cookie not set.
> 
> I couldn't figure out why possibly I am getting this error for incorporating 
> such a simple(and basic) functionality.
> 
> I want to understand the best way/approach to go about this (for implementing 
> this functionality). I am not worrying about the error for the time being 
> since I didn't spend much time thinking about it (So I am not posting any 
> code). I want to get my approach right first. I want to be flawless while 
> implementing such basic and elementary stuffs.  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/4f18d65c-8e85-434f-b584-0ab7017f6cf9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CA%2B4-nGq8taHb%2B9%2Bz3%3DxJq-Qitnuf0%3D127O9esk8LZygSQLeSZA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALTbq1zEC9RPPKmVvTOYqXQ5AgVghzDWd0og2FoeKBJOMyfe1A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


  1   2   >