forked from NoLog.cz/TrhlinaBar
Grocy connection info moved to env variables
This commit is contained in:
parent
2be6e36fc2
commit
1e5d18a707
2 changed files with 12 additions and 3 deletions
11
app.py
11
app.py
|
@ -3,12 +3,13 @@ from pygrocy.data_models.generic import EntityType
|
|||
from flask import Flask, render_template, request, redirect
|
||||
from datetime import datetime
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
import os
|
||||
|
||||
from pprint import pprint
|
||||
|
||||
#Global variables
|
||||
#Default global variables
|
||||
DEFAULT_AMOUNT = 1
|
||||
CASHBOX_USERID = 3
|
||||
CASHBOX_USERID = 1
|
||||
|
||||
error_messages = {
|
||||
'item_not_found': 'Tenhle produkt nemůžeme najít ve skladu. Zkus to prosím znovu a pokud to nepůjde, řekni někomu z Trhliny.',
|
||||
|
@ -16,9 +17,13 @@ error_messages = {
|
|||
'user_not_found': 'Tenhle účet neexistuje nebo nemá povolený kredit. Můžeš věc naskenovat znovu a hodit prachy do kasičky',
|
||||
}
|
||||
|
||||
GROCY_URL = os.getenv('GROCY_URL')
|
||||
GROCY_API_KEY = os.getenv('GROCY_API_KEY')
|
||||
GROCY_PORT = os.getenv('GROCY_PORT')
|
||||
CASHBOX_USERID = os.getenv('CASHBOX_USER_ID')
|
||||
|
||||
|
||||
g = Grocy("http://localhost", "BZzLkorATL66hSbKwIERoesALcIqNUPW91zONNNTHP0r9N6vk2", port=8080)
|
||||
g = Grocy(GROCY_URL, GROCY_API_KEY, port=GROCY_PORT)
|
||||
|
||||
|
||||
# Write money movement into the ledger (transaction log in Grocy).
|
||||
|
|
4
sample-config.env
Normal file
4
sample-config.env
Normal file
|
@ -0,0 +1,4 @@
|
|||
GROCY_URL=https://en.demo.grocy.info
|
||||
GROCY_API_KEY=xxxxx
|
||||
GROCY_PORT=443
|
||||
CASHBOX_USER_ID=2
|
Loading…
Reference in a new issue