diff --git a/README.md b/README.md index e734e45..8e141c3 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,10 @@ The config file must contain a line `SECRET_KEY = '`, which must be Suggested way of generating the key is `python -c 'import secrets; print(secrets.token_hex())'`, which returns a hexadecimal string with length 64. You may choose to randomly generate a key using a different method, but ensure that it is resistant to brute-force attacks. ### Registration -Since this blog is meant to be updated by a limited number of people, registration is forbidden (403) by default. In addition, registration (/auth/register) and login (/auth/login) URLs are not hyperlinked anywhere. Registration can be opened by including `REGISTER = True`, or closed by including `REGISTER = False`, in the config file. \ No newline at end of file +Since this blog is meant to be updated by a limited number of people, registration is forbidden (403) by default. In addition, registration (/auth/register) and login (/auth/login) URLs are not hyperlinked anywhere. Registration can be opened by including `REGISTER = True`, or closed by including `REGISTER = False`, in the config file. + +### Name +The default app name is "Flaskr", and it is visible on the header bar as well as the page title. Including a line `NAME = ''` in the config file replaces "Flaskr" with "". + +### Static folder +The default static folder is the one included in the repository. You can use a separate static folder to use your own assets by including a line `STATIC_FOLDER = ''` in the config file. diff --git a/flaskr/__init__.py b/flaskr/__init__.py index d3f29f9..7f5869b 100644 --- a/flaskr/__init__.py +++ b/flaskr/__init__.py @@ -8,9 +8,13 @@ def create_app(test_config=None): app.config.from_mapping( SECRET_KEY='dev', DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'), - REGISTER=False + REGISTER=False, + NAME='Flaskr' ) + if app.config.get('STATIC_FOLDER') is not None: + app.static_folder = app.config.get('STATIC_FOLDER') + app.wsgi_app = ProxyFix( app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1 ) diff --git a/flaskr/templates/base.html b/flaskr/templates/base.html index 89fd567..0944d7d 100644 --- a/flaskr/templates/base.html +++ b/flaskr/templates/base.html @@ -1,9 +1,9 @@ -{% block title %}{% endblock %} - Flaskr +{% block title %}{% endblock %} - {{ config['NAME'] }}