Sample Applicaiton powered by Python3 and Flask.
You can write a short message (including codes) and publish it. ( First, You have to sign up and log in. )
$ pip3 install -r requirements.txt
installs dependency for this app.
You have to set 2 variables:
$ export DATABASE_URL=mysql://username:password@localhost/db_name
$ export DATABASE_URL=mysql+pymysql://username:password@localhost/db_name
$ export flask_config=development
Windows
$ set FLASK_APP=manage
$ flask run
Linux
$ export FLASK_APP=manage
$ flask run
Run shell operations
$ flask runserver
$ flask test
$ flask deploy
Launching a shell
$ flask shell
>>> db.create_all()
>>> Message.query.all()
>>> search.create_index()
You can run with Docker.
First, You edit two files( See docker-compose.yml ).
- .env
- .env-mysql
Write MySQL connection info which is used for the application.
example:
DATABASE_URL=mysql+pymysql://username:password@mysql/db_name
You can change it.
Write MySQL account info which is user for MySQL container initialization.
example:
MYSQL_ROOT_PASSWORD=root_pass
MYSQL_DATABASE=db_name
MYSQL_USER=username
MYSQL_PASSWORD=password
Change them as you want.
Fetch Images when you dont have them.
$ docker-compose pull
Run.
$ docker-compose up
Run as daemon.
$ docker-compose up -d