mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-04 20:30:39 +00:00
Start adding pip setup package requirements (setup.py, __init__.py, use pkg_resource)
This commit is contained in:
parent
9191524c04
commit
90d743796b
7 changed files with 146 additions and 46 deletions
|
@ -3,6 +3,7 @@ from flask_swagger import swagger
|
|||
from flask_swagger_ui import get_swaggerui_blueprint
|
||||
from langdetect import detect_langs
|
||||
from langdetect import DetectorFactory
|
||||
from pkg_resources import resource_filename
|
||||
DetectorFactory.seed = 0 # deterministic
|
||||
|
||||
def get_remote_address():
|
||||
|
@ -67,7 +68,7 @@ def create_app(char_limit=-1, req_limit=-1, batch_limit=-1, ga_id=None, debug=Fa
|
|||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template('index.html', gaId=ga_id, frontendTimeout=frontend_timeout)
|
||||
return render_template(resource_filename('app', 'templates/index.html'), gaId=ga_id, frontendTimeout=frontend_timeout)
|
||||
|
||||
@app.route("/languages")
|
||||
def langs():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue