diff --git a/README.md b/README.md index 49ca9ea..c32ec55 100644 --- a/README.md +++ b/README.md @@ -1 +1,18 @@ # Clarity Portal + +## Install +```bash +python3.11 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +## Development server +```bash +flask --app portal run --debug +``` + +## Production server +```bash +gunicorn -w 4 portal:app +``` diff --git a/clarity_portal.py b/clarity_portal.py deleted file mode 100644 index bd384b1..0000000 --- a/clarity_portal.py +++ /dev/null @@ -1,8 +0,0 @@ -from flask_script import Manager - -from portal import app - -manager = Manager(app) - -if __name__ == "__main__": - manager.run() diff --git a/clarity_portal.wsgi b/clarity_portal.wsgi deleted file mode 100644 index 4200720..0000000 --- a/clarity_portal.wsgi +++ /dev/null @@ -1,14 +0,0 @@ -"""Clarity Portal wsgi.""" -activate_this = '/var/www/html/clarity_portal/venv/bin/activate_this.py' -execfile(activate_this, dict(__file__=activate_this)) - -# Add app to the path -import sys -sys.path.insert(0, "/var/www/html/clarity_portal") - -# Load app -from portal import app as application -from portal.utils import WSGIMiddleware - -# Setup prefix -application.wsgi_app = WSGIMiddleware(application.wsgi_app, "/clarity_portal") diff --git a/portal/forms.py b/portal/forms.py index 206aa2f..7b00019 100644 --- a/portal/forms.py +++ b/portal/forms.py @@ -30,7 +30,7 @@ class SubmitSampleForm(FlaskForm): parsed_samples = [] sum_exome_count = 0 - def validate(self): + def validate(self, extra_validators=[]): """Extra validation, used to validate submitted samples.""" self.parsed_samples = [] self.sum_exome_count = 0 @@ -154,7 +154,7 @@ class SubmitDXSampleForm(FlaskForm): parsed_samples = [] sum_exome_count = 0 - def validate(self): + def validate(self, extra_validators=[]): """Extra validation, used to validate submitted samples.""" self.parsed_samples = {} self.parsed_worklist = {} @@ -265,6 +265,7 @@ def validate(self): } for line in self.helix_worklist.data: + line = line.decode('utf-8') if not header: header = line.rstrip().split(',') for udf in udf_column: diff --git a/requirements.txt b/requirements.txt index d3774b8..ea7dfe4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ -Flask==1.0.2 +Flask==2.3.3 Flask-Bootstrap==3.3.7.1 -Flask-Script==2.0.6 -Flask-WTF==0.14.2 -genologics==0.3.24 +Flask-WTF==1.2.1 +genologics==1.0.0 +gunicorn==21.2.0 +six==1.16.0