Build the future of communications.
Start building for free
  • By August Allard
    PythonでHTTPリクエストを送信する5つの方法 PythonでHTTPリクエストを送信する5つの方法

    この記事はAugust Allardこちらで公開した記事(英語)を日本語化したものです。

    ソフトウェア開発では、同じ結果を得るための方法が複数あることがよくあります。これは、サードパーティーのソフトウェアパッケージを評価する際にも同じことが言えます。例えば、Pythonのエコシステムでは、HTTP リクエストの送信に関連するパッケージがいくつもあります。開発者はどれを使えばいいのでしょうか?

    この実験ベースのチュートリアルでは、Pythonの最も人気のあるリクエスト関連パッケージを5つご紹介します。各パッケージの簡単なGETリクエストを作成する方法と簡単なコードスニペットを例示します。NASAのAstronomy Photo of the Day API(以降「APOD」と短縮)を使って、Webブラウザで宇宙の写真を表示させます。

    本稿の目標は、各パッケージのすべての機能を細かく比較対照するのではなく、様々なPythonパッケージを使って簡単なGETリクエストを素早く構成することです。もし非同期リクエストがあなたのユースケースにより適しているなら、Twilioブログの「aiohttpとasyncioを使用したPythonの非同期HTTPリクエスト」を参照してください。

    必要事項

    NASAのデモ用APIキーを取得する

    https://api.nasa.gov/に移動します。認証セクションに、NASAデータセットを検索するために固有のAPIキーが必要ないことが記載されています。もしA …

    Read More
  • By August Allard
    Create Secret Santa Matches Using Python Flask and Twilio SMS Create Secret Santa matches using Python Flask and Twilio SMS

    For the second year in a row, my family decided to embrace the “secret santa” method of giving gifts at Christmas. Rather than everyone getting a gift for everyone else, which can be expensive and time consuming, each person’s name is put in a box and we each draw one name from the box. The name we draw is the person we give a gift to, up to a certain dollar amount that we’ve all agreed on in advance.

    This year, my family is spread all over the United States so it wasn’t possible to draw names from a box. Instead, I thought it would be fun to create my own Flask application that would match people up and notify each person of their gift recipient using Twilio SMS.

    Follow along with the tutorial below, or clone the GitHub repository if you’re in a rush!

    Prerequisites

    Read More
  • By August Allard
    5 Ways to Make HTTP Requests Using Python 5 Ways to Make HTTP Requests Using Python

    When it comes to software development, there are almost always several different ways to achieve the same outcome. This is true when evaluating a family of third-party software packages, too. For example, in the Python ecosystem there are thousands of packages related to making HTTP requests. Which one should you use?

    In this experiment-based tutorial, we’ll walk through brief code snippets that show how to make a simple GET request using 5 of Python’s most popular requests-related packages. We’ll use NASA’s Astronomy Photo of the Day API (shortened to APOD throughout the rest of the tutorial) and open today’s photo in our web browser.

    Our goal is to make simple GET requests quickly using a variety of Python packages, rather than to compare and contrast all of the features and subtleties of each package. If asynchronous requests are a better fit for your use case, check out the companion …

    Read More
  • By August Allard
    Expose a local Django server to the Internet using ngrok django_and_ngrok.jpg

    Django comes with a lightweight server that allows you to serve your project on your local machine at http://localhost:8000. This is a great way to test and troubleshoot your application code.

    Your local server isn't exposed to the real Internet, though, so your Django project can't receive requests from an external source, such as a Twilio webhook.

    For development purposes, you may need to test that your app code properly handles requests from external sources. To do that, you must expose your app to the Internet.

    What is ngrok?

    The ngrok utility generates public URLs that map to your local server, enabling you to test how your development code handles requests from external sources. Read more about ngrok and how it works in the official documentation.

    Prerequisites

    All you need for this tutorial is an existing Django project running on Python 3.

    Install the pyngrok package

    The …

    Read More
  • By August Allard
    Introducing Python Developer for Technical Content, August Allard augustallard.png

    Ask just about any programmer why they like to write code, and I’ll bet you a giant slice of chocolate cake that every single person will give at least one of these answers:

    • “I love making things!”
    • “I love learning how things work!”
    • “I love solving problems!”

    Of course, this isn’t an exhaustive list of the reasons why people like to write code, but the exclamations in this list have reliably and recurrently come up when I get into conversations with fellow developers. Often, these developers will tell me that not only do they love making things, love learning how things work, or love solving problems, they have actually always enjoyed these things, even in their childhood.

    This unique collection of interests — building, learning, solving — is the longstanding core of my identity.

    How it started

    In elementary school, Mrs. Elliott was my daycare provider and watched over me …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.