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

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

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

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

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

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

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

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

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?

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é

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

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

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

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

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

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

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

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

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)

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,

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

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

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

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:

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

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

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

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

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:

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 >

Re: Require code explaination

2015-04-29 Thread François Schiettecatte
t 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 w

Re: Require code explaination

2015-04-29 Thread François Schiettecatte
ng? > > 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.

Re: Require code explaination

2015-04-29 Thread François Schiettecatte
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, An

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) > >

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

2015-04-20 Thread François Schiettecatte
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 machin

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çoi

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

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

2015-04-17 Thread François Schiettecatte
hon > 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’. &

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çoi

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(

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

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,

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

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 # #

Re: Load Template without rendering/parsing

2015-03-16 Thread François Schiettecatte
. 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

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

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

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 >

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

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

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

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 >

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

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

Re: Mysql connector python 3

2014-12-05 Thread François Schiettecatte
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>: >

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:

Re: Mysql connector python 3

2014-12-04 Thread François Schiettecatte
> 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

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

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

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

Re: Django 1.7 and Python 2.6

2014-09-28 Thread François Schiettecatte
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: > >

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?

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

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

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č

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

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

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

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

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

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

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

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

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})$',

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

Re: Mysql connections after started django app

2014-07-04 Thread François Schiettecatte
able 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 he

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

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

Re: Django python fuction

2014-06-10 Thread François Schiettecatte
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 elemen

Re: Django python fuction

2014-06-10 Thread François Schiettecatte
. 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&qu

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

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

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

2014-05-22 Thread François Schiettecatte
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

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

2014-05-22 Thread François Schiettecatte
rmissions. 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 co

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

2014-05-22 Thread François Schiettecatte
nsal 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: >

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

2014-05-22 Thread François Schiettecatte
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, tha

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

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])/$',

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

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

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

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

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

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

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

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

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

Re: Custom Login page in Django

2014-03-20 Thread François Schiettecatte
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/ >

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

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

  1   2   >