config.example.py: add NAME attribute

- static: give inst_name on context
 - static/index: use inst_name
This commit is contained in:
Luna Mendes 2018-11-21 21:40:56 -03:00
parent 2852f57f96
commit b629fcace2
3 changed files with 15 additions and 3 deletions

View File

@ -6,6 +6,9 @@ class Config:
#: Main URL of the instance. #: Main URL of the instance.
MAIN_URL = 'discordapp.io' MAIN_URL = 'discordapp.io'
#: Name of the instance
NAME = 'Litecord/Nya'
#: Enable debug logging? #: Enable debug logging?
DEBUG = False DEBUG = False
@ -36,6 +39,7 @@ class Config:
class Development(Config): class Development(Config):
DEBUG = True DEBUG = True
POSTGRES = { POSTGRES = {
'host': 'localhost', 'host': 'localhost',
'user': 'litecord', 'user': 'litecord',
@ -47,3 +51,10 @@ class Development(Config):
class Production(Config): class Production(Config):
DEBUG = False DEBUG = False
IS_SSL = True IS_SSL = True
POSTGRES = {
'host': 'some_production_postgres',
'user': 'some_production_user',
'password': 'some_production_password',
'database': 'litecord_or_anything_else_really',
}

View File

@ -18,4 +18,5 @@ async def static_pages(path):
async def index_handler(): async def index_handler():
"""Handler for the index page.""" """Handler for the index page."""
index_path = Path.cwd() / Path('static') / 'index.html' index_path = Path.cwd() / Path('static') / 'index.html'
return await render_template_string(index_path.read_text()) return await render_template_string(
index_path.read_text(), inst_name=app.config['NAME'])

View File

@ -1,7 +1,7 @@
{% block body %} {% block body %}
<center> <center>
<h1> <h1>
welcome to a Litecord instance welcome to {{ inst_name }}, a Litecord instance
</h1> </h1>
<p> <p>
@ -10,7 +10,7 @@
</p> </p>
<p> <p>
It supports nodeinfo, despise not being part It supports nodeinfo, despite not being part
in any federated network. in any federated network.
</p> </p>