Skip to content
Snippets Groups Projects
Commit 547be9df authored by CHAMONT David's avatar CHAMONT David
Browse files

Merge branch 'master' of gitlab.in2p3.fr:MaitresNageurs/README/LabelsTower

parents 18f51857 93b73c5f
No related branches found
No related tags found
1 merge request!63Master
......@@ -20,3 +20,25 @@ run the application
./run_dev.sh
# Code Guards
Some python code for management of user accounts within a Flask application.
## Directories
Most directories have their own `README.md`.
* `codeguards` : main code, i.e. a blueprint for Flask.
* `docker` : anything for building docker images with all the needed externals.
* `dist` : where we build and store wheel distributions of the main codeguards code.
* `test/instance` : where we initialize a test sqlite database.
* `test/demo_blog` : web demo application.
* `test/scripts` : various command-line test.
## Demonstration from scratch, with Docker
With the help of Docker :
1. Build the dev Docker image : `docker/build_externals.sh`
1. Build the codeguards distribution : `docker/run_externals.sh dist/build.sh`
1. Build the demo Docker image : `docker/build_latest.sh` (it includes the above distribution)
1. Initialize a database : `docker/run_latest.sh instance/init_db.sh`
1. Starts the flask server : `docker/run_latest.sh`
......@@ -6,4 +6,4 @@ SCRIPT_NAME=${BASH_SOURCE[0]}
cd `dirname ${SCRIPT_NAME}`
# Flask opère sur le port 5000
docker run -it --rm -p 5000:5000 -v $PWD/..:/work -w /work codeguards:dev $*
\ No newline at end of file
docker run -it --rm -p 5000:5000 -v $PWD/..:/work -w /work labelstower:dev $*
\ No newline at end of file
......@@ -2,5 +2,5 @@ from flask import Blueprint
bp = Blueprint('sort', __name__)
from app.labels_system import routes
from labelstower import routes
File moved
from typing import Dict, List
from app import db
from labelstower import db
def send_query_to_db(query: str) -> List[Dict[int, str]] :
'''
......
from typing import Dict, List
import json
from app.labels_system.getter import get_selected_elements, get_discriminating_labels, get_high_discriminating_labels, get_user_selection
from app.labels_system import bp
from labelstower.getter import get_selected_elements, get_discriminating_labels, get_high_discriminating_labels, get_user_selection
from labelstower import bp
#URLs call to update labels and elements along researchs
......
......@@ -25,7 +25,7 @@ def create_app():
app.config.from_object(os.environ['LABELSTOWER_ENV'])
from app.labels_system import bp
from labelstower import bp
app.register_blueprint(bp, url_prefix='/sort')
@app.route('/')
......
#!/usr/bin/env bash
# This ensures that we are in this script directory,
# even if we call it from another one.
SCRIPT_NAME=${BASH_SOURCE[0]}
cd `dirname ${SCRIPT_NAME}`
rm -f codeguards.sqlite
cd .. # so to see demo_blog
python3 -c 'from demo_flask.models import db; from demo import create_app; db.create_all(app=create_app());'
cd instance
sqlite3 codeguards.sqlite '.read insert_roles.sql'
sqlite3 codeguards.sqlite '.read insert_data.sql'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment