Web application using Bottle (1)

I've been using javascript a lot these days, but sometimes I think "I just want some logic on the server side ...".

If you want to do something on the server side, PHP seems to be convenient, but I wonder if there is something in C # or Python that I am familiar with ... Bottle I decided to try / docs / dev /).

A similar one is CherryPy, which I thought was a fairly lightweight framework, but Bottle is even lighter. (Only one .py file)

main_cherry.py


import cherrypy

class HelloWorld( object ):

    def index( self ):
        return "Hello World!"

    index.exposed = True
 
cherrypy.quickstart( HelloWorld() )

Here is the description in Bottle.

main_bottle.py


from bottle import route, run, template
 
@route('/')
def index():
    return 'Hello World!'
 
run( host = 'localhost', port = 8080 )

Both are short enough, but Bottle works with just one Python file you need.


This article is a port of the article from Mizu Nagi Kobo to Qiita.

Recommended Posts

Web application using Bottle (1)
WEB application development using django-Development 1-
WEB application development using Django [Django startup]
Creating a web application using Flask ②
WEB application development using Django [Application addition]
Creating a web application using Flask ①
Creating a web application using Flask ③
Creating a web application using Flask ④
WEB application development using Django [Model definition]
WEB application development using Django [Initial settings]
WEB application development using django-Development environment construction-
WEB application development using Django [Request processing]
WEB application development using Django [Template addition]
[Python] A quick web application with Bottle!
(Python) Try to develop a web application using Django
Web application development with Flask
Web application creation with Django
Web scraping using Selenium (Python)
Web scraping using AWS lambda
Web application with Python + Flask ② ③
Web application with Python + Flask ④
Web application with Python3.3.1 + Bottle (1) --Change template engine to jinja2
Development of WEB application using Django [Add data from management screen]
Proxy measures when using WEB API
Web application created with Python + Flask (using VScode) # 1-Virtual environment construction-
Web application development memo in python
Publish your web app in 4 minutes 33 seconds using Heroku x bottle
About HTTP cache when developing REST API-based web application [using GCP]
Creating a voice transcription web application
Add response headers using Bottle hook
Build a web application with Django
I tried to make a todo application using bottle with python
Application development using Azure Machine Learning
Web application performance measurement tool Funkload ...
Until you publish (deploy) a web application made with bottle on Heroku
Start a web server using Bottle and Flask (I also tried using Apache)
How to build an application from the cloud using the Django web framework
I want to make a web application using React and Python flask
Implement a simple application with Python full scratch without using a web framework.
[Python] Web application from 0! Hands-on (2) -Hello World-
Sample application using MongoDB of Spring Boot
Display matplotlib diagrams in a web application
Port forwarding your web server using iptables
[Beginner] Python web scraping using Google Colaboratory
Python: Application of image recognition using CNN
[Python] Web application from 0! Hands-on (4) -Data molding-
Application development using SQLite with Django (PTVS)
Automatically manipulate web pages using selenium webdriver
Create an application using the Spotify API
[Python] Web application design for machine learning
Creating a data analysis application using Streamlit
Run a Python web application with Docker
Web application development in Go language_Hands-on day 1
[Python] Web application from 0! Hands-on (0) -Environmental construction-
About Cloud run + Firebase development [Web application development]
I tried benchmarking a web application framework
I made a WEB application with Django
Go beginner tried to create a cloud native web application using Datastore / GAE
[Raspberry Pi] Publish a web application on https using Apache + WSGI + Python Flask
Web application that analyzes morphological elements and generates sentences with Markov chains [bottle]