Skip to content

Commit

Permalink
FLASK_APP not set correctly fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan7 committed Jul 12, 2020
1 parent 7119491 commit fa2235c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ $ cd src/
3. With `virtual environment` activated, install requirements, init db,

```bash
[venv]$ pip install -r requirements.txt
[venv]$ pip install -r requirements.txt
[venv]$ export FLASK_APP="FlaskRTBCTF:create_app()"
[venv]$ chmod +x init_db.sh && ./init_db.sh # Only required on first run
```

Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
}
},
"scripts": {
"postdeploy": "bash src/init_db.sh"
"postdeploy": "cd /app/src && export FLASK_APP='FlaskRTBCTF:create_app()' && sh init_db.sh"
}
}
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.8.2
python-3.8.3
1 change: 1 addition & 0 deletions src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

chmod +x init_db.sh runserver.sh
export FLASK_APP="FlaskRTBCTF:create_app()"
# init/ migrate DB
./init_db.sh
# run gunicorn production server
Expand Down
1 change: 0 additions & 1 deletion src/init_db.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

export FLASK_APP="FlaskRTBCTF:create_app()"
flask db init
flask db migrate
flask db upgrade
Expand Down

0 comments on commit fa2235c

Please sign in to comment.