craig-rueda commented on a change in pull request #8418: Flask App factory PR #1
URL: 
https://github.com/apache/incubator-superset/pull/8418#discussion_r337149036
 
 

 ##########
 File path: superset/app.py
 ##########
 @@ -0,0 +1,251 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import logging
+import os
+
+from flask_appbuilder import IndexView, expose
+from flask_compress import Compress
+from flask import Flask, redirect
+from superset.extensions import (
+    _event_logger,
+    APP_DIR,
+    appbuilder,
+    cache_manager,
+    db,
+    feature_flag_manager,
+    manifest_processor,
+    migrate,
+    results_backend_manager,
+    talisman
+)
+from flask_wtf import CSRFProtect
+
+from superset.connectors.connector_registry import ConnectorRegistry
+from superset.security import SupersetSecurityManager
+from superset.utils.core import pessimistic_connection_handling
+from superset.utils.log import get_event_logger_from_cfg_value, DBEventLogger
+import wtforms_json
+
+
+logger = logging.getLogger(__name__)
+
+
+def create_app():
 
 Review comment:
   Yea, the thinking here is that an end user can simply extend the 
`SupersetAppInitializer` and override only the parts they're interested in.
   
   Although I could just do all the work in `app:create_app()`, it's a bit more 
OO to break the task of initialization into a set of phases.
   
   I think a good example of this need would be someone that wanted to override 
something specific, such as the configuration of FAB, but wanted to carry 
forward the rest of Superset's config. `SupersetAppInitializer` allows you to 
compose your config from reusable bits as an end user.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to