Compare commits

...

6 Commits

Author SHA1 Message Date
clerie 3193c6d507 Avoid redirect 2022-03-05 13:34:17 +01:00
clerie 4cfac906ac Update rollup-plugin-scss 2022-02-26 12:05:56 +01:00
clerie 61918546b7 Add node-sass as dependency 2022-02-26 11:45:36 +01:00
clerie bb50382809 Move config object to config file 2021-01-24 16:28:18 +01:00
clerie b7134dbc0f Move from npm to yarn 2021-01-24 14:12:26 +01:00
clerie 74b8a6b411 Add setup.py 2021-01-24 13:56:53 +01:00
10 changed files with 2189 additions and 2137 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.

2125
package-lock.json generated

File diff suppressed because it is too large Load Diff

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"
}
}

18
setup.py Normal file
View File

@ -0,0 +1,18 @@
#!/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(),
)

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);
}

2159
yarn.lock Normal file

File diff suppressed because it is too large Load Diff