A web service to share Image using Line Api
- Create
instance/config-dev.py
and setup below:
USERNAME = 'xxx' // username and passwords are for a console to manage photos. Set your own
PASSWORD = 'pass'
CLOUDINARY_CLOUD_NAME="xxx"
CLOUDINARY_API_KEY="xxx"
CLOUDINARY_API_SECRET="xxx"
DATABASE_URL="postgres:///pipidb" //requied at 3. Setup DB
LINE_CHANNEL_SECRET='xxx'
LINE_CHANNEL_ACCESS_TOKEN='xxx'
- Install dependencies
- Setup
virtualenv
before install dependencies. Create a virtual environment for this project. - Setup Python dependencies
pip install --editable .
- Setup webpack
cd pipi/static
npm i --save
npm run build
- Setup DB
- Install Postgres DB -> http://postgresapp.com/documentation/
- Create DB for the service(db name will be used for DATABASE_URL)
- Run
- Run with web socket server
export FLASK_APP=pipi //module name
export FLASK_DEBUG=1 // Debugging
export FLASK_ENV=dev
flask initdb // initialize db and create table. Required only first time
python run.py
- Access
http://localhost:5000
to access debug page(uploading image). - Access
http://localhost:5000/list
to access Screen page. - Access
http://localhost:5000/page
to access photo list page. - Line feature does not work on debug mode
- Set up variables from HEROKU console's setting
- Set
WEB_CONCURRENCY=3
to manage multiple worker process
heroku login
git push heroku master
heroku run flask initdb // initialize db and create table.. Required only first time
python python-3.6.2
flask 0.12.2
Cloudinary 1.8.0
socketio
postgres SQL
Kyosuke Inoue - Gave me a great advice around saving images and FrontEnd jQuery. Thank you so much!
This app is under Apache v2 License. However, I would be very happy if you let me know before you use this source code for wedding or other events.
Twitter: Tomoaki Imai
Gmail: tomoima525@gmail.com
Copyright 2019 Tomoaki Imai
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.