[PYTHON] Introduced Pyramid

This is an introductory article from installing Pyramid, a Python web framework, to starting it.

Development environment

Installation

Just use pip. It's very easy.

$ pip pyramid

Project creation

Create a Pyramid project. In this example, we will create ** my-app **.

$ pcreate -s alchemy my-app

By specifying alchemy, a project will be created with settings that use SQLAlchemy.

setting change

The default setting is to use SQLite for DB. Since MariaDB is used this time, change the DB connection settings.

development.ini


sqlalchemy.url = mysql+pymysql://pyramid_user:pyramid_password@localhost:3306/pyramid_db?charset=utf8&use_unicode=1

Supplement

Replace pyramid_user, pyramid_password and pyramid_db as appropriate.

Start-up

The default setting is to use a WSGI server called waitress. Do not change this time, start with the default settings. The settings are described in development.ini / production.ini.

$ pserve development.ini

Now that the web server is up and running, you can proceed with development.

Recommended Posts

Introduced Pyramid
Introduced tweepy2
Introduced anaconda
Introduced PyQt4
pytest + webtest + pyramid
[Robot] Introduced Pepper
Redirect with Pyramid
Play with Pyramid