mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-19 14:59:28 +00:00
rearrange Python files
This commit is contained in:
@@ -132,7 +132,7 @@ params = {
|
||||
|
||||
### Using Flask server
|
||||
|
||||
See [flask_server.py](examples/flask_server.py) for embedding the error pages into the server
|
||||
See [flask_demo.py](examples/flask_demo.py) for embedding the error pages into the server
|
||||
|
||||
|
||||
## Full Parameter Reference
|
||||
|
||||
@@ -57,7 +57,7 @@ def create_app(test_config=None) -> Flask:
|
||||
from . import models
|
||||
from . import examples
|
||||
from . import editor
|
||||
from . import shared
|
||||
from . import share
|
||||
|
||||
if app.config["SQLALCHEMY_DATABASE_URI"].startswith('sqlite'):
|
||||
app.config["SQLALCHEMY_ENGINE_OPTIONS"] = {
|
||||
@@ -83,7 +83,7 @@ def create_app(test_config=None) -> Flask:
|
||||
|
||||
app.register_blueprint(editor.bp, url_prefix=f'{url_prefix}/editor')
|
||||
app.register_blueprint(examples.bp, url_prefix=f'{url_prefix}/examples')
|
||||
app.register_blueprint(shared.bp, url_prefix=f'{url_prefix}/s')
|
||||
app.register_blueprint(share.bp, url_prefix=f'{url_prefix}/s')
|
||||
|
||||
return app
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from . import models
|
||||
# root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../')
|
||||
# examples_dir = os.path.join(root_dir, 'examples')
|
||||
|
||||
bp = Blueprint('shared', __name__, url_prefix='/')
|
||||
bp = Blueprint('share', __name__, url_prefix='/')
|
||||
|
||||
|
||||
rand_charset = string.ascii_letters + string.digits
|
||||
@@ -50,7 +50,7 @@ def create():
|
||||
return jsonify({
|
||||
'status': 'ok',
|
||||
'name': item.name,
|
||||
'url': request.host_url[:-1] + url_for('shared.get', name=item.name),
|
||||
'url': request.host_url[:-1] + url_for('share.get', name=item.name),
|
||||
# TODO: better way to handle this
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user