mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-14 05:29:27 +08:00
up
This commit is contained in:
@@ -10,3 +10,4 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdweb/master/install/instal
|
||||
- pip install pip==9.0.3
|
||||
- pip install flask
|
||||
- pip install gunicorn
|
||||
- pip install -r requirements.txt
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
# coding:utf-8
|
||||
|
||||
from flask import Flask
|
||||
from flask import Blueprint,render_template
|
||||
from views import frontend
|
||||
from views import dashboard,site
|
||||
|
||||
app = Flask(__name__)
|
||||
app.debug = True
|
||||
|
||||
DEFAULT_MODULES = (
|
||||
(frontend, ""),
|
||||
(dashboard, "/"),
|
||||
(site, "/site"),
|
||||
)
|
||||
|
||||
def setting_modules(app, modules):
|
||||
@@ -15,5 +18,6 @@ def setting_modules(app, modules):
|
||||
|
||||
setting_modules(app, DEFAULT_MODULES)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
flask
|
||||
gunicorn
|
||||
@@ -1,4 +1,7 @@
|
||||
$def with (tData)
|
||||
{% extends "default/layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="main-content pb55">
|
||||
<div class="container-fluid">
|
||||
<div class="pos-box bgw mtb15">
|
||||
@@ -63,4 +66,5 @@ $def with (tData)
|
||||
},500);
|
||||
|
||||
setCookie('serverType','$web.ctx.session.webserver');
|
||||
</script>
|
||||
</script>
|
||||
{% endblock %}
|
||||
+2
-1
@@ -1,2 +1,3 @@
|
||||
from frontend import *
|
||||
from dashboard import *
|
||||
from site import *
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# coding:utf-8
|
||||
|
||||
from flask import Flask
|
||||
from flask import Blueprint,render_template
|
||||
|
||||
|
||||
frontend = Blueprint('frontend', __name__, template_folder='templates')
|
||||
dashboard = Blueprint('dashboard', __name__, template_folder='templates')
|
||||
|
||||
@frontend.route("/")
|
||||
@dashboard.route("/")
|
||||
def index():
|
||||
return render_template('default/index.html')
|
||||
@@ -0,0 +1,11 @@
|
||||
# coding:utf-8
|
||||
|
||||
from flask import Flask
|
||||
from flask import Blueprint,render_template
|
||||
|
||||
|
||||
site = Blueprint('site', __name__, template_folder='templates')
|
||||
|
||||
@site.route("/")
|
||||
def index():
|
||||
return render_template('default/site.html')
|
||||
Reference in New Issue
Block a user