mirror of
https://github.com/ION606/static-site-hosting.git
synced 2026-05-14 22:16:54 +00:00
added server name env var
This commit is contained in:
@@ -8,6 +8,7 @@ from flask import (
|
||||
flash,
|
||||
abort,
|
||||
jsonify,
|
||||
session
|
||||
)
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_login import (
|
||||
@@ -46,7 +47,7 @@ PORT = 5121
|
||||
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////app/instance/db.sqlite"
|
||||
app.config["UPLOAD_FOLDER"] = "sites"
|
||||
app.config["SERVER_NAME"] = "tinysite.cloud"
|
||||
app.config["SESSION_COOKIE_DOMAIN"] = ".tinysite.cloud"
|
||||
# app.config["SESSION_COOKIE_DOMAIN"] = ".tinysite.cloud"
|
||||
db = SQLAlchemy(app)
|
||||
|
||||
|
||||
@@ -104,6 +105,12 @@ class Site(db.Model):
|
||||
def page_not_found(_):
|
||||
return render_template("404.html", domain=request.host), 404
|
||||
|
||||
@app.context_processor
|
||||
def inject_global_variable():
|
||||
return {
|
||||
"SERVERNAME": app.config["SERVER_NAME"],
|
||||
}
|
||||
|
||||
|
||||
# Auth setup
|
||||
login_manager = LoginManager()
|
||||
|
||||
Reference in New Issue
Block a user