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

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

More than 1 year has passed since last update.

@ekzemplaro

uWSGI の簡単な使い方

Arch Linux でのインストール

sudo pacman -S uwsgi
sudo pacman -S uwsgi-plugin-python
foobar.py
# -*- 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/ にアクセス
uwsgi_oct28.png

確認した環境

$ 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
2.0.17.1
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
0
Help us understand the problem. What are the problem?