Put personal pages into subdomains
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
from os import system as console
|
||||
from configparser import ConfigParser
|
||||
from htmlmin import minify
|
||||
|
||||
from blueprints.root import bp as root_bp
|
||||
from blueprints.risdeveau import bp as rdv_bp
|
||||
|
||||
import blueprints.root.modules.style
|
||||
import blueprints.risdeveau.modules.style
|
||||
|
||||
from flask import (
|
||||
Flask,
|
||||
g,
|
||||
request,
|
||||
render_template,
|
||||
)
|
||||
|
||||
|
||||
@@ -29,7 +33,9 @@ def load_translations(lang):
|
||||
def get_locale():
|
||||
return request.accept_languages.best_match(('en', 'ru', 'de', 'fr', 'ja'), 'en')
|
||||
|
||||
app = Flask(__name__)
|
||||
app = Flask(__name__, static_folder=None, subdomain_matching=True)
|
||||
app.register_blueprint(root_bp)
|
||||
app.register_blueprint(rdv_bp)
|
||||
|
||||
|
||||
@app.before_request
|
||||
@@ -59,21 +65,9 @@ def inject_translations():
|
||||
|
||||
|
||||
if app.debug:
|
||||
console("sass static/style/main.scss static/style/main.css")
|
||||
console("sass static/style/risdeveau.scss static/style/risdeveau.css")
|
||||
blueprints.root.modules.style.compile_styles()
|
||||
blueprints.risdeveau.modules.style.compile_styles()
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return minify(render_template('index.html'), remove_empty_space=True)
|
||||
|
||||
@app.route("/host")
|
||||
def host():
|
||||
return minify(render_template('host.html'), remove_empty_space=True)
|
||||
|
||||
@app.route("/us")
|
||||
def us():
|
||||
return minify(render_template('us.html'), remove_empty_space=True)
|
||||
|
||||
@app.route("/risdeveau")
|
||||
def risdeveau():
|
||||
return minify(render_template('personal/risdeveau.html'), remove_empty_space=True)
|
||||
app.config['SERVER_NAME'] = "localhost:5000"
|
||||
else:
|
||||
app.config['SERVER_NAME'] = "lair.moe"
|
||||
|
||||
Reference in New Issue
Block a user