Skip to content

Commit

Permalink
chg: [core] Renamed runserver.py to app.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Mar 11, 2024
1 parent db9d588 commit 47f059d
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 20 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ COPY --from=node_modules /opt/node_modules/ mosp/static/npm_components/

RUN pybabel compile -d mosp/translations

COPY runserver.py .
COPY app.py .
COPY entrypoint.sh .

ENV MOSP_VERSION=latest

ENV HOST=0.0.0.0
ENV PORT=5000
ENV DEBUG=0
ENV FLASK_APP=runserver.py
ENV MOSP_CONFIG=docker.py

VOLUME [ "/app/var" ]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ activate:
poetry shell

run:
python runserver.py
flask run --debug

migrate:
flask db upgrade
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: pybabel compile -d mosp/translations; python runserver.py
web: pybabel compile -d mosp/translations; python app.py
init: flask db_init
1 change: 0 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
],
"env": {
"HEROKU": "1",
"FLASK_APP": "runserver.py",
"ADMIN_EMAIL": "info@example.org",
"ADMIN_URL": "https://www.example.org"
}
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions contrib/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ NC='\033[0m' # No Color
set -e
#set -x

export FLASK_APP=runserver.py

git pull origin master --tags
npm ci
poetry install --only main
Expand Down
2 changes: 1 addition & 1 deletion contrib/webserver.wsgi.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ activate_this = python_home + '/bin/activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))

from runserver import application
from app import application

__all__ = [
"application"
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ services:
working_dir: /mosp
tty: true
environment:
- FLASK_APP=runserver.py
- FLASK_DEBUG=0
- MOSP_CONFIG=docker.py
- HOST=0.0.0.0
- PORT=5000
Expand Down
12 changes: 5 additions & 7 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,19 @@ Get the source code and install the software:
$ poetry install --only main
$ poetry shell
$ pybabel compile -d mosp/translations
$ export FLASK_APP=runserver.py
$ export FLASK_DEBUG=1
$ export MOSP_CONFIG=production.py
$ flask db_create
$ flask db_init
$ flask import_licenses_from_spdx
$ flask create_admin --login <login> --password <password>
$ flask run
* Serving Flask app "runserver" (lazy loading)
* Environment: development
$ flask run --debug
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 221-873-938
* Debugger PIN: 834-369-202
For production you should use `Gunicorn <https://gunicorn.org>`_ or ``mod_wsgi``.
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ for try in 1 2 3 4 5 6; do
[ "$try" = "6" ] && exit 1
done

gunicorn --chdir /app --workers 2 --bind 0.0.0.0:5000 runserver:application
gunicorn --chdir /app --workers 2 --bind 0.0.0.0:5000 app:application
2 changes: 1 addition & 1 deletion mosp/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def set_logging(
if not modules:
modules = (
"bootstrap",
"runserver",
"app",
"web",
)
handler: Union[logging.Handler, None] = None
Expand Down

0 comments on commit 47f059d

Please sign in to comment.