Compare commits
1 Commits
master
...
dependabot
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | 87d245ca37 |
|
@ -12,14 +12,11 @@ Nur ein Mal zu initialisieren:
|
||||||
git clone https://github.com/clerie/wetter.git
|
git clone https://github.com/clerie/wetter.git
|
||||||
cd wetter/
|
cd wetter/
|
||||||
virtualenv -p python3 ENV
|
virtualenv -p python3 ENV
|
||||||
|
cp wetter/config/db.py.example wetter/config/db.py
|
||||||
cd ..
|
cd ..
|
||||||
```
|
```
|
||||||
|
|
||||||
Erstelle eine `config.cfg` mit folgendem Inhalt und passe die Werte entsprechend an.
|
Passe nun `wetter/config/db.py` mit deinen Datenbankzugangsdaten an.
|
||||||
|
|
||||||
```
|
|
||||||
SQLALCHEMY_DATABASE_URI=postgresql://user:password@host:5432/database
|
|
||||||
```
|
|
||||||
|
|
||||||
Bei Bedarf musst du noch die `wsgi.ini` anpassen.
|
Bei Bedarf musst du noch die `wsgi.ini` anpassen.
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -23,15 +23,14 @@
|
||||||
"@rollup/plugin-node-resolve": "^7.1.1",
|
"@rollup/plugin-node-resolve": "^7.1.1",
|
||||||
"rollup": "^1.32.1",
|
"rollup": "^1.32.1",
|
||||||
"rollup-plugin-copy": "^3.3.0",
|
"rollup-plugin-copy": "^3.3.0",
|
||||||
"rollup-plugin-scss": "^3.0.0",
|
"rollup-plugin-scss": "^2.1.0",
|
||||||
"rollup-plugin-terser": "^5.3.0"
|
"rollup-plugin-terser": "^5.3.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^4.4.1",
|
"bootstrap": "^4.4.1",
|
||||||
"datatables.net-bs4": "^1.10.20",
|
"datatables.net-bs4": "^1.10.20",
|
||||||
"jquery": "^3.4.1",
|
"jquery": "^3.5.0",
|
||||||
"leaflet": "^1.6.0",
|
"leaflet": "^1.6.0",
|
||||||
"node-sass": "^7.0.1",
|
|
||||||
"popper.js": "^1.16.1"
|
"popper.js": "^1.16.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
18
setup.py
18
setup.py
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import setuptools
|
|
||||||
|
|
||||||
with open("README.md", "r") as fh:
|
|
||||||
long_description = fh.read()
|
|
||||||
|
|
||||||
setuptools.setup(
|
|
||||||
name="wetter",
|
|
||||||
version="0.0.1",
|
|
||||||
author="clerie",
|
|
||||||
author_email="hallo@clerie.de",
|
|
||||||
description="Wetter",
|
|
||||||
long_description=long_description,
|
|
||||||
long_description_content_type="text/markdown",
|
|
||||||
url="https://git.clerie.de/clerie/wetter",
|
|
||||||
packages=setuptools.find_packages(),
|
|
||||||
)
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from wetter.config.db import db as config_db
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_sqlalchemy import SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
import flask_excel as excel
|
import flask_excel as excel
|
||||||
|
@ -8,9 +10,7 @@ app = Flask(__name__)
|
||||||
excel.init_excel(app)
|
excel.init_excel(app)
|
||||||
|
|
||||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
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)
|
db = SQLAlchemy(app)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
db = {}
|
||||||
|
db['uri'] = "postgresql://user:password@host:5432/database"
|
|
@ -40,7 +40,7 @@
|
||||||
zoomOffset: -1
|
zoomOffset: -1
|
||||||
}).addTo(mymap);
|
}).addTo(mymap);
|
||||||
|
|
||||||
$.getJSON("/api/station/", (stations) => {
|
$.getJSON("/api/station", (stations) => {
|
||||||
if(stations.length == 1) {
|
if(stations.length == 1) {
|
||||||
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
|
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
zoomOffset: -1
|
zoomOffset: -1
|
||||||
}).addTo(mymap);
|
}).addTo(mymap);
|
||||||
|
|
||||||
$.getJSON("/api/station/?s={{ station.dwd_id }}", (stations) => {
|
$.getJSON("/api/station?s={{ station.dwd_id }}", (stations) => {
|
||||||
if(stations.length == 1) {
|
if(stations.length == 1) {
|
||||||
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
|
mymap.setView([stations[0]["lat"], stations[0]["lon"]], 6);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue