4 Commits

Author SHA1 Message Date
3193c6d507 Avoid redirect 2022-03-05 13:34:17 +01:00
4cfac906ac Update rollup-plugin-scss 2022-02-26 12:05:56 +01:00
61918546b7 Add node-sass as dependency 2022-02-26 11:45:36 +01:00
bb50382809 Move config object to config file 2021-01-24 16:28:18 +01:00
8 changed files with 907 additions and 549 deletions

View File

@@ -12,11 +12,14 @@ Nur ein Mal zu initialisieren:
git clone https://github.com/clerie/wetter.git
cd wetter/
virtualenv -p python3 ENV
cp wetter/config/db.py.example wetter/config/db.py
cd ..
```
Passe nun `wetter/config/db.py` mit deinen Datenbankzugangsdaten an.
Erstelle eine `config.cfg` mit folgendem Inhalt und passe die Werte entsprechend an.
```
SQLALCHEMY_DATABASE_URI=postgresql://user:password@host:5432/database
```
Bei Bedarf musst du noch die `wsgi.ini` anpassen.

View File

@@ -23,7 +23,7 @@
"@rollup/plugin-node-resolve": "^7.1.1",
"rollup": "^1.32.1",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-scss": "^2.1.0",
"rollup-plugin-scss": "^3.0.0",
"rollup-plugin-terser": "^5.3.0"
},
"dependencies": {
@@ -31,6 +31,7 @@
"datatables.net-bs4": "^1.10.20",
"jquery": "^3.4.1",
"leaflet": "^1.6.0",
"node-sass": "^7.0.1",
"popper.js": "^1.16.1"
}
}

View File

@@ -1,7 +1,5 @@
#!/usr/bin/env python3
from wetter.config.db import db as config_db
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_excel as excel
@@ -10,7 +8,9 @@ app = Flask(__name__)
excel.init_excel(app)
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config["SQLALCHEMY_DATABASE_URI"] = config_db['uri']
# override configs from file
app.config.from_envvar('WETTER_SETTINGS')
db = SQLAlchemy(app)

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env python3
db = {}
db['uri'] = "postgresql://user:password@host:5432/database"

View File

@@ -40,7 +40,7 @@
zoomOffset: -1
}).addTo(mymap);
$.getJSON("/api/station", (stations) => {
$.getJSON("/api/station/", (stations) => {
if(stations.length == 1) {
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
}

View File

@@ -86,7 +86,7 @@
zoomOffset: -1
}).addTo(mymap);
$.getJSON("/api/station?s={{ station.dwd_id }}", (stations) => {
$.getJSON("/api/station/?s={{ station.dwd_id }}", (stations) => {
if(stations.length == 1) {
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
}

1432
yarn.lock

File diff suppressed because it is too large Load Diff