Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flask-covid19
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Wöhlke
flask-covid19
Commits
a50fd3bc
Commit
a50fd3bc
authored
3 years ago
by
thomaswoehlke
Browse files
Options
Downloads
Patches
Plain Diff
working on: 0.0.32 Release
parent
8d4b431d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
requirements/dev.txt
+0
-5
0 additions, 5 deletions
requirements/dev.txt
src/config.py
+2
-2
2 additions, 2 deletions
src/config.py
src/covid19/blueprints/admin/admin_service.py
+6
-6
6 additions, 6 deletions
src/covid19/blueprints/admin/admin_service.py
src/database.py
+3
-12
3 additions, 12 deletions
src/database.py
with
11 additions
and
25 deletions
requirements/dev.txt
+
0
−
5
View file @
a50fd3bc
...
@@ -174,8 +174,6 @@ more-itertools==8.0.2
...
@@ -174,8 +174,6 @@ more-itertools==8.0.2
# via
# via
# jaraco.functools
# jaraco.functools
# pytest-enabler
# pytest-enabler
mysql-connector-python==8.0.24
# via -r requirements/dev.in
nodeenv==1.5.0
nodeenv==1.5.0
# via pre-commit
# via pre-commit
numba==0.52.0
numba==0.52.0
...
@@ -235,8 +233,6 @@ prettytable==2.0.0
...
@@ -235,8 +233,6 @@ prettytable==2.0.0
# via pyecharts
# via pyecharts
prompt-toolkit==3.0.16
prompt-toolkit==3.0.16
# via click-repl
# via click-repl
protobuf==3.15.8
# via mysql-connector-python
psutil==5.8.0
psutil==5.8.0
# via mirakuru
# via mirakuru
psycopg2-binary==2.8.6
psycopg2-binary==2.8.6
...
@@ -348,7 +344,6 @@ six==1.15.0
...
@@ -348,7 +344,6 @@ six==1.15.0
# cycler
# cycler
# flask-cors
# flask-cors
# flask-fixtures
# flask-fixtures
# protobuf
# python-dateutil
# python-dateutil
# sqlalchemy-utils
# sqlalchemy-utils
# virtualenv
# virtualenv
...
...
This diff is collapsed.
Click to expand it.
src/config.py
+
2
−
2
View file @
a50fd3bc
...
@@ -9,11 +9,11 @@ SQLALCHEMY_DATABASE_USER = 'covid19data'
...
@@ -9,11 +9,11 @@ SQLALCHEMY_DATABASE_USER = 'covid19data'
SQLALCHEMY_DATABASE_PW
=
'
covid19datapwd
'
SQLALCHEMY_DATABASE_PW
=
'
covid19datapwd
'
SQLALCHEMY_DATABASE_HOST
=
'
localhost
'
SQLALCHEMY_DATABASE_HOST
=
'
localhost
'
SQLALCHEMY_DATABASE_DB
=
'
covid19data
'
SQLALCHEMY_DATABASE_DB
=
'
covid19data
'
SQLALCHEMY_ITEMS_PER_PAGE
=
1
0
SQLALCHEMY_ITEMS_PER_PAGE
=
2
0
SQLALCHEMY_TRACK_MODIFICATIONS
=
True
SQLALCHEMY_TRACK_MODIFICATIONS
=
True
FLASK_ADMIN_SWATCH
=
'
superhero
'
FLASK_ADMIN_SWATCH
=
'
superhero
'
FLASK_APP_DEBUGGER_ACTIVE
=
True
FLASK_APP_DEBUGGER_ACTIVE
=
True
PORT
=
9090
USER_ADMIN_LOGIN
=
'
admin@admin.de
'
USER_ADMIN_LOGIN
=
'
admin@admin.de
'
USER_ADMIN_USERNAME
=
'
admin
'
USER_ADMIN_USERNAME
=
'
admin
'
USER_ADMIN_PASSWORD
=
'
pbkdf2:sha256:150000$O4SZaWF5$85ad348809215aa7fe0a16f79dc61228e7d0fb214c24df68b0745f1570ffc148
'
USER_ADMIN_PASSWORD
=
'
pbkdf2:sha256:150000$O4SZaWF5$85ad348809215aa7fe0a16f79dc61228e7d0fb214c24df68b0745f1570ffc148
'
PORT
=
9090
This diff is collapsed.
Click to expand it.
src/covid19/blueprints/admin/admin_service.py
+
6
−
6
View file @
a50fd3bc
...
@@ -24,9 +24,9 @@ class AdminService:
...
@@ -24,9 +24,9 @@ class AdminService:
def
run_admin_database_dump
(
self
):
def
run_admin_database_dump
(
self
):
app
.
logger
.
info
(
"
run database dump [begin]
"
)
app
.
logger
.
info
(
"
run database dump [begin]
"
)
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
user
=
app
.
config
[
'
SQLALCHEMY_
POSTGRES
_USER
'
]
user
=
app
.
config
[
'
SQLALCHEMY_
DATABASE
_USER
'
]
url
=
app
.
config
[
'
SQLALCHEMY_
POSTGRES_URL
'
]
url
=
app
.
config
[
'
SQLALCHEMY_
DATABASE_HOST
'
]
db
=
app
.
config
[
'
SQLALCHEMY_
POSTGRES
_DB
'
]
db
=
app
.
config
[
'
SQLALCHEMY_
DATABASE
_DB
'
]
cmd
=
'
pg_dump -U
'
+
user
+
'
-h
'
+
url
+
'
'
+
db
\
cmd
=
'
pg_dump -U
'
+
user
+
'
-h
'
+
url
+
'
'
+
db
\
+
'
--clean --if-exists --no-tablespaces
'
\
+
'
--clean --if-exists --no-tablespaces
'
\
+
'
--on-conflict-do-nothing --rows-per-insert=1000 --column-inserts
'
\
+
'
--on-conflict-do-nothing --rows-per-insert=1000 --column-inserts
'
\
...
@@ -58,9 +58,9 @@ class AdminService:
...
@@ -58,9 +58,9 @@ class AdminService:
flash
(
"
run database dump reimport [begin]
"
)
flash
(
"
run database dump reimport [begin]
"
)
app
.
logger
.
info
(
"
run database dump reimport [begin]
"
)
app
.
logger
.
info
(
"
run database dump reimport [begin]
"
)
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
user
=
app
.
config
[
'
SQLALCHEMY_
POSTGRES
_USER
'
]
user
=
app
.
config
[
'
SQLALCHEMY_
DATABASE
_USER
'
]
url
=
app
.
config
[
'
SQLALCHEMY_
POSTGRES_URL
'
]
url
=
app
.
config
[
'
SQLALCHEMY_
DATABASE_HOST
'
]
db
=
app
.
config
[
'
SQLALCHEMY_
POSTGRES
_DB
'
]
db
=
app
.
config
[
'
SQLALCHEMY_
DATABASE
_DB
'
]
cmd_list
=
[
cmd_list
=
[
'
psql -U
'
+
user
+
'
-h
'
+
url
+
'
'
+
db
+
'
<
'
+
self
.
file_path
'
psql -U
'
+
user
+
'
-h
'
+
url
+
'
'
+
db
+
'
<
'
+
self
.
file_path
]
]
...
...
This diff is collapsed.
Click to expand it.
src/database.py
+
3
−
12
View file @
a50fd3bc
...
@@ -8,10 +8,6 @@ from flask_login import LoginManager
...
@@ -8,10 +8,6 @@ from flask_login import LoginManager
from
logging.config
import
dictConfig
from
logging.config
import
dictConfig
from
flask_admin
import
Admin
from
flask_admin
import
Admin
from
celery
import
Celery
from
celery
import
Celery
import
sqlalchemy.dialects
from
sqlalchemy.dialects
import
postgresql
,
mysql
,
sqlite
# TODO: #210 database.py: logging for Celery on Windows
# TODO: #210 database.py: logging for Celery on Windows
from
celery.utils.log
import
LoggingProxy
from
celery.utils.log
import
LoggingProxy
...
@@ -28,18 +24,13 @@ def create_app():
...
@@ -28,18 +24,13 @@ def create_app():
login_manager
.
login_view
=
'
usr.login
'
login_manager
.
login_view
=
'
usr.login
'
login_manager
.
init_app
(
my_app
)
login_manager
.
init_app
(
my_app
)
my_app
.
config
.
from_object
(
"
config
"
)
my_app
.
config
.
from_object
(
"
config
"
)
my_db_url_mariadb
=
"
mysql+mysqldb://{user}:{pw}@{url}/{db}
"
.
format
(
my_db_url
=
'
postgresql+psycopg2://{user}:{pw}@{url}/{db}
'
.
format
(
user
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_USER
'
],
pw
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_PW
'
],
url
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_HOST
'
],
db
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_DB
'
])
my_db_url_postgresql
=
'
postgresql+psycopg2://{user}:{pw}@{url}/{db}
'
.
format
(
user
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_USER
'
],
user
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_USER
'
],
pw
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_PW
'
],
pw
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_PW
'
],
url
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_HOST
'
],
url
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_HOST
'
],
db
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_DB
'
])
db
=
my_app
.
config
[
'
SQLALCHEMY_DATABASE_DB
'
])
my_app
.
config
[
'
SQLALCHEMY_DATABASE_URI
'
]
=
my_db_url
_mariadb
my_app
.
config
[
'
SQLALCHEMY_DATABASE_URI
'
]
=
my_db_url
my_app
.
config
[
'
SQLALCHEMY_TRACK_MODIFICATIONS
'
]
=
Tru
e
# silence the deprecation warning
my_app
.
config
[
'
SQLALCHEMY_TRACK_MODIFICATIONS
'
]
=
Fals
e
# silence the deprecation warning
my_app
.
config
[
'
FLASK_ADMIN_SWATCH
'
]
=
'
superhero
'
my_app
.
config
[
'
FLASK_ADMIN_SWATCH
'
]
=
'
superhero
'
# cache.init_app(app)
# cache.init_app(app)
return
my_app
return
my_app
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment