mercredi 29 juillet 2015

[Python] Buffered ouput by default

By default, Python produces buffered output (when you use print).

This could be a problem when you would like to see in "real time" your print(...) for example in a log file.

You can disable the buffer for output, by adding the option "-u" like that :
python -u my_script.py


I had this problem with Tornado + supervisor. I did not understand why my print(..) was not written immediately in my log file => -u option solves my problem !

lundi 20 juillet 2015

[Nginx] Redirect http to https


server {
   listen 80;
   server_name my.domain.com;
   return 301 https://$server_name$request_uri; 


server { 
   listen 443 ssl; 
   server_name my.domain.com; 
   [....] 

Categories