Closes #6
This commit is contained in:
parent
de094d4bed
commit
bda624e4dc
3 changed files with 14 additions and 4 deletions
|
|
@ -21,3 +21,9 @@ Suggested way of generating the key is `python -c 'import secrets; print(secrets
|
||||||
|
|
||||||
### Registration
|
### 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.
|
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 = '<name>'` in the config file replaces "Flaskr" with "<name>".
|
||||||
|
|
||||||
|
### 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 = '<absolute/path/to/folder>'` in the config file.
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,13 @@ def create_app(test_config=None):
|
||||||
app.config.from_mapping(
|
app.config.from_mapping(
|
||||||
SECRET_KEY='dev',
|
SECRET_KEY='dev',
|
||||||
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
|
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 = ProxyFix(
|
||||||
app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1
|
app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<title>{% block title %}{% endblock %} - Flaskr</title>
|
<title>{% block title %}{% endblock %} - {{ config['NAME'] }}</title>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}">
|
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}">
|
||||||
<nav>
|
<nav>
|
||||||
<h1>Flaskr</h1>
|
<h1>{{ config['NAME'] }}</h1>
|
||||||
<ul>
|
<ul>
|
||||||
{% if g.user %}
|
{% if g.user %}
|
||||||
<li><span>{{ g.user['username'] }}</span>
|
<li><span>{{ g.user['username'] }}</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue