diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | README.md | 13 | ||||
| -rw-r--r-- | main.py | 1 |
3 files changed, 15 insertions, 0 deletions
| @@ -1,3 +1,4 @@ | |||
| 1 | __pycache__ | 1 | __pycache__ |
| 2 | config.py | ||
| 2 | custom_templates | 3 | custom_templates |
| 3 | uploads | 4 | uploads |
| @@ -190,12 +190,25 @@ The `key` parameter is the key from a previously uploaded file. | |||
| 190 | ``` | 190 | ``` |
| 191 | 191 | ||
| 192 | # Docker | 192 | # Docker |
| 193 | |||
| 193 | There are two Dockerfiles present in this repository. The file called `Dockerfile.development` is used for development | 194 | There are two Dockerfiles present in this repository. The file called `Dockerfile.development` is used for development |
| 194 | and `Dockerfile.production` is used for production deployments. | 195 | and `Dockerfile.production` is used for production deployments. |
| 195 | 196 | ||
| 196 | You can find the automated docker builds in the registry of this | 197 | You can find the automated docker builds in the registry of this |
| 197 | repository: https://0xacab.org/jvoisin/mat2-web/container_registry | 198 | repository: https://0xacab.org/jvoisin/mat2-web/container_registry |
| 198 | 199 | ||
| 200 | # Configuration | ||
| 201 | |||
| 202 | The default settings from `main.py` may be overridden by adding a `config.py` | ||
| 203 | file and add custom values for the relevant flask config variables. E.g.: | ||
| 204 | |||
| 205 | ``` | ||
| 206 | MAX_CONTENT_LENGTH = 32 * 1024 * 1024 # 32MB | ||
| 207 | ``` | ||
| 208 | |||
| 209 | See [Flask configuration docs](http://exploreflask.com/en/latest/configuration.html) | ||
| 210 | for further information. | ||
| 211 | |||
| 199 | # Custom templates | 212 | # Custom templates |
| 200 | 213 | ||
| 201 | You can override the default templates from `templates/` by putting replacements | 214 | You can override the default templates from `templates/` by putting replacements |
| @@ -25,6 +25,7 @@ def create_app(test_config=None): | |||
| 25 | app.config['UPLOAD_FOLDER'] = './uploads/' | 25 | app.config['UPLOAD_FOLDER'] = './uploads/' |
| 26 | app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB | 26 | app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB |
| 27 | app.config['CUSTOM_TEMPLATES_DIR'] = 'custom_templates' | 27 | app.config['CUSTOM_TEMPLATES_DIR'] = 'custom_templates' |
| 28 | app.config.from_object('config') # optionally load settings from config.py | ||
| 28 | 29 | ||
| 29 | app.jinja_loader = jinja2.ChoiceLoader([ # type: ignore | 30 | app.jinja_loader = jinja2.ChoiceLoader([ # type: ignore |
| 30 | jinja2.FileSystemLoader(app.config['CUSTOM_TEMPLATES_DIR']), | 31 | jinja2.FileSystemLoader(app.config['CUSTOM_TEMPLATES_DIR']), |
