forked from ScoDoc/ScoDoc
tests avec gunicorn
This commit is contained in:
parent
545274c562
commit
3dc94775a1
14
README.md
14
README.md
@ -21,14 +21,12 @@ on s'efforce à ce que rien ne soit visible des utilisateurs Web.
|
||||
**Work in Progress (WIP)**: développement en cours, certaines pages fonctionnent, d'autres pas:
|
||||
merci de signaler les erreurs.
|
||||
|
||||
### État actuel (30 juillet 21)
|
||||
### État actuel (15 août 21)
|
||||
|
||||
- serveur de développement fonctionnel (pas testé en mode "production" sous gunicorn+nginx).
|
||||
|
||||
- logs à revoir (tropverbeux), dans `/opt/scodoc-data/log`
|
||||
|
||||
- pas d'import/export excel.
|
||||
- serveur de développement fonctionnel (tests en mode "production"
|
||||
sous gunicorn+nginx en cours).
|
||||
|
||||
- logs à revoir (trop verbeux), dans `/opt/scodoc-data/log`
|
||||
|
||||
**En cours:**
|
||||
|
||||
@ -193,6 +191,10 @@ Dans un terminal, lancer le serveur:
|
||||
export FLASK_ENV=development
|
||||
flask run --host=0.0.0.0
|
||||
|
||||
Test avec gunicorn:
|
||||
|
||||
gunicorn -b 0.0.0.0:8000 -w 4 scodoc:app
|
||||
|
||||
## Organisation des fichiers
|
||||
|
||||
L'installation comporte les fichiers de l'application, sous `/opt/scodoc/`, et les fichiers locaux (archives, photos, configurations, logs) sous `/opt/scodoc-data`. Par ailleurs, il y a évidemment les bases de données postgresql et la configuration du système.
|
||||
|
@ -81,10 +81,11 @@ class ScoDocCache:
|
||||
@classmethod
|
||||
def get(cls, oid):
|
||||
"""Returns cached object, or None"""
|
||||
key = cls._get_key(oid)
|
||||
try:
|
||||
return CACHE.get(cls._get_key(oid))
|
||||
return CACHE.get(key)
|
||||
except:
|
||||
log("XXX CACHE Warning: error in get")
|
||||
log(f"XXX CACHE Warning: error in get(key={key})")
|
||||
log(traceback.format_exc())
|
||||
return None
|
||||
|
||||
|
@ -1,63 +1,75 @@
|
||||
openpyxl
|
||||
alembic==1.6.5
|
||||
attrs==21.2.0
|
||||
Babel==2.9.1
|
||||
blinker==1.4
|
||||
certifi==2021.5.30
|
||||
cffi==1.14.6
|
||||
chardet==4.0.0
|
||||
charset-normalizer==2.0.3
|
||||
click==8.0.1
|
||||
cracklib==2.9.3
|
||||
cryptography==3.4.7
|
||||
dnspython==2.1.0
|
||||
dominate==2.6.0
|
||||
email-validator==1.1.3
|
||||
Flask==2.0.1
|
||||
Flask-Babel==2.0.0
|
||||
Flask-Bootstrap==3.3.7.1
|
||||
Flask-Caching==1.10.1
|
||||
Flask-Login==0.5.0
|
||||
Flask-Mail==0.9.1
|
||||
Flask-Migrate==3.0.1
|
||||
Flask-Moment==1.0.2
|
||||
Flask-SQLAlchemy==2.5.1
|
||||
Flask-WTF==0.15.1
|
||||
greenlet==1.1.0
|
||||
icalendar==4.0.7
|
||||
idna==3.2
|
||||
importlib-metadata==4.6.1
|
||||
iniconfig==1.1.1
|
||||
itsdangerous==2.0.1
|
||||
Jinja2==3.0.1
|
||||
jwt==1.2.0
|
||||
Mako==1.1.4
|
||||
MarkupSafe==2.0.1
|
||||
packaging==21.0
|
||||
Pillow==8.3.1
|
||||
pkg-resources==0.0.0
|
||||
pluggy==0.13.1
|
||||
psycopg2==2.9.1
|
||||
py==1.10.0
|
||||
pycparser==2.20
|
||||
pydot==1.4.2
|
||||
pyOpenSSL==20.0.1
|
||||
pyparsing==2.4.7
|
||||
pytest==6.2.4
|
||||
python-dateutil==2.8.2
|
||||
python-dotenv==0.18.0
|
||||
python-editor==1.0.4
|
||||
pytz==2021.1
|
||||
redis==3.5.3
|
||||
reportlab==3.5.68
|
||||
requests==2.26.0
|
||||
rq==1.9.0
|
||||
six==1.16.0
|
||||
SQLAlchemy==1.4.22
|
||||
toml==0.10.2
|
||||
typing-extensions==3.10.0.0
|
||||
urllib3==1.26.6
|
||||
visitor==0.1.3
|
||||
Werkzeug==2.0.1
|
||||
WTForms==2.3.3
|
||||
zipp==3.5.0
|
||||
alembic==1.6.5
|
||||
astroid==2.6.5
|
||||
attrs==21.2.0
|
||||
Babel==2.9.1
|
||||
blinker==1.4
|
||||
certifi==2021.5.30
|
||||
cffi==1.14.6
|
||||
chardet==4.0.0
|
||||
charset-normalizer==2.0.3
|
||||
click==8.0.1
|
||||
coverage==5.5
|
||||
cracklib==2.9.3
|
||||
cryptography==3.4.7
|
||||
dnspython==2.1.0
|
||||
dominate==2.6.0
|
||||
email-validator==1.1.3
|
||||
et-xmlfile==1.1.0
|
||||
Flask==2.0.1
|
||||
Flask-Babel==2.0.0
|
||||
Flask-Bootstrap==3.3.7.1
|
||||
Flask-Caching==1.10.1
|
||||
Flask-Login==0.5.0
|
||||
Flask-Mail==0.9.1
|
||||
Flask-Migrate==3.0.1
|
||||
Flask-Moment==1.0.2
|
||||
Flask-SQLAlchemy==2.5.1
|
||||
Flask-WTF==0.15.1
|
||||
greenlet==1.1.0
|
||||
gunicorn==20.1.0
|
||||
icalendar==4.0.7
|
||||
idna==3.2
|
||||
importlib-metadata==4.6.1
|
||||
iniconfig==1.1.1
|
||||
isort==5.9.3
|
||||
itsdangerous==2.0.1
|
||||
Jinja2==3.0.1
|
||||
jwt==1.2.0
|
||||
lazy-object-proxy==1.6.0
|
||||
Mako==1.1.4
|
||||
MarkupSafe==2.0.1
|
||||
mccabe==0.6.1
|
||||
openpyxl==3.0.7
|
||||
packaging==21.0
|
||||
Pillow==8.3.1
|
||||
pkg_resources==0.0.0
|
||||
pluggy==0.13.1
|
||||
psycopg2==2.9.1
|
||||
py==1.10.0
|
||||
pycparser==2.20
|
||||
pydot==1.4.2
|
||||
pylint==2.9.6
|
||||
pyOpenSSL==20.0.1
|
||||
pyparsing==2.4.7
|
||||
PyRSS2Gen==1.1
|
||||
pytest==6.2.4
|
||||
pytest-cov==2.12.1
|
||||
python-dateutil==2.8.2
|
||||
python-dotenv==0.18.0
|
||||
python-editor==1.0.4
|
||||
pytz==2021.1
|
||||
redis==3.5.3
|
||||
reportlab==3.5.68
|
||||
requests==2.26.0
|
||||
rq==1.9.0
|
||||
six==1.16.0
|
||||
SQLAlchemy==1.4.22
|
||||
toml==0.10.2
|
||||
typed-ast==1.4.3
|
||||
typing-extensions==3.10.0.0
|
||||
urllib3==1.26.6
|
||||
visitor==0.1.3
|
||||
Werkzeug==2.0.1
|
||||
wrapt==1.12.1
|
||||
WTForms==2.3.3
|
||||
zipp==3.5.0
|
||||
|
@ -117,6 +117,8 @@ def import_scodoc7_dept(dept_id: str, dept_db_uri=None):
|
||||
logging.info(f"All table imported: clearing app caches...")
|
||||
clear_scodoc_cache()
|
||||
logging.info(f"Done.")
|
||||
logging.warning(f"Un redémarrage du serveur postgresql est conseillé")
|
||||
logging.warning(f"systemctl restart postgresql"
|
||||
|
||||
|
||||
def get_class_for_table(table):
|
||||
|
Loading…
Reference in New Issue
Block a user