Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationEventAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.


uWSGI の簡単な使い方

Arch Linux でのインストール

sudo pacman -S uwsgi
sudo pacman -S uwsgi-plugin-python
# -*- coding: utf-8 -*-
#   foobar.py
#                       Oct/18/2018
# ------------------------------------------------------------------
def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    rvalue = b"<h2>Hello World</h2>"
    rvalue += b"<blockquote>"
    rvalue += b"\tTest<p />"
    rvalue += b"</blockquote>"
    rvalue += b"\tOct/28/2018 PM 20:36<p />"
    return rvalue
# ------------------------------------------------------------------


uwsgi --plugin http,python --http :9090 --wsgi-file foobar.py

クライアントで http://localhost:9090/ にアクセス


$ uname -a
Linux iwata 4.18.16-arch1-1-ARCH #1 SMP PREEMPT Sat Oct 20 22:06:45 UTC 2018 x86_64 GNU/Linux
[uchida@iwata uwsgi]$ python --version
Python 3.7.1
[uchida@iwata uwsgi]$ uwsgi --version
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Help us understand the problem. What are the problem?