Browsed by
월: 2020 3월

[:en]Sending simultaneous requests using Python[:ko]Python에서 여러 Request 동시에 보내기[:]

[:en]Sending simultaneous requests using Python[:ko]Python에서 여러 Request 동시에 보내기[:]

[:en] Python is a perfect programming language unless you have to deal with asynchronous action. Many programmers using Javascript complain about ‘callback hell’. Still, people become grateful when they have to deal with asynchronous action (simultaneous, parallel, concurrent, etc.). Recently I needed to send several requests at the same time, instead of waiting for the previous request to finish. Moreover, all responses should be collected as one variable. 1. Ordinary request If we call 10 requests sequentially, it took 11.285…

Read More Read More

[:en]Django 301 redirect problem with React[:ko]React에서 Django 301 리다이렉트 문제[:]

[:en]Django 301 redirect problem with React[:ko]React에서 Django 301 리다이렉트 문제[:]

[:en] The answer is: ‘/’ Sometimes when you change your client-side code, and suddenly you experience a 301 redirect response from your server-side. In my case, I was using Django as a serverside and use ReactJS as a client-side. The API was implemented in a RESTful style. Most of the cases, the reason was I forgot to end with ‘/’ in my request URL. (Good) https://api.example.com/api/100/ (Bad) https://api.example.com/api/100 I haven’t really investigated what is behind this rule but, don’t panic…

Read More Read More

[:en]How to install Flask in Ubuntu 18.04[:ko]Ubuntu 18.04에 Python Flask 설치하기[:]

[:en]How to install Flask in Ubuntu 18.04[:ko]Ubuntu 18.04에 Python Flask 설치하기[:]

[:en] Ubuntu version : 18.04Python version: 3.6.7 Let’s get started from Ubuntu. If you are in ubuntu server and type below command you will see the version of your current python installation. In my case, it was Python 3.6.9. Now we need to install ‘virtualenv’ module.(There are several approaches that we can set a virtual environment for python, but it seems like this one is recommended these days.) Then, we make our project directory. In side the project directory, we…

Read More Read More