website online working
This commit is contained in:
@@ -39,12 +39,8 @@ app.jinja_env.autoescape = True
|
||||
|
||||
|
||||
# configuration
|
||||
UPLOADED_FILES_DEST_ITEM = ApplicationConfig.UPLOADED_FILES_DEST_ITEM
|
||||
UPLOADED_FILES_ALLOW = ApplicationConfig.UPLOADED_FILES_ALLOW
|
||||
CURRENT_SETTINGS = ApplicationConfig.CURRENT_SETTINGS
|
||||
WHITE = ApplicationConfig.WHITE
|
||||
|
||||
app.config['CORS_ORIGIN_WHITELIST'] = ApplicationConfig.CORS_ORIGIN_WHITELIST
|
||||
app.config['CORS_ALLOWED_ORIGINS'] = ApplicationConfig.CORS_ALLOWED_ORIGINS
|
||||
app.config['UPLOADED_FILES_DEST_ITEM'] = ApplicationConfig.UPLOADED_FILES_DEST_ITEM
|
||||
app.config['UPLOADED_FILES_ALLOW'] = ApplicationConfig.UPLOADED_FILES_ALLOW
|
||||
app.config['MAX_CONTENT_LENGTH'] = ApplicationConfig.MAX_CONTENT_LENGTH
|
||||
@@ -54,7 +50,6 @@ app.config['SESSION_COOKIE_HTTPONLY'] = ApplicationConfig.SESSION_COOKIE_HTTPONL
|
||||
app.config['SESSION_COOKIE_SAMESITE'] = ApplicationConfig.SESSION_COOKIE_SAMESITE
|
||||
app.config['SESSION_PERMANENT'] = ApplicationConfig.SESSION_PERMANENT
|
||||
app.config['SESSION_USE_SIGNER'] = ApplicationConfig.SESSION_USE_SIGNER
|
||||
app.config['ORIGIN_URL'] = ApplicationConfig.ORIGIN_URL
|
||||
app.config['CURRENT_SETTINGS'] = ApplicationConfig.CURRENT_SETTINGS
|
||||
app.config['SECRET_KEY'] = ApplicationConfig.SECRET_KEY
|
||||
|
||||
@@ -99,15 +94,18 @@ def load_user_from_request(request):
|
||||
return None
|
||||
|
||||
|
||||
api_main = {
|
||||
"origins": [ApplicationConfig.ORIGIN_URL],
|
||||
"methods": ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"],
|
||||
"allow_headers": ['Authorization', 'application/json', 'authorization', 'Content-Type',
|
||||
'Access-Control-Allow-Headers', 'Origin,Accept',
|
||||
'X-Requested-With', 'Content-Type', 'Access-Control-Request-Method',
|
||||
'Access-Control-Request-Headers']
|
||||
}
|
||||
cors = CORS(app, supports_credentials=True, resources={r'/*': api_main})
|
||||
# api_main = {
|
||||
# "origins": [ApplicationConfig.ORIGIN_URL],
|
||||
# "methods": ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"],
|
||||
# "allow_headers": ['Authorization', 'application/json', 'authorization', 'Content-Type',
|
||||
# 'Access-Control-Allow-Headers', 'Origin,Accept',
|
||||
# 'X-Requested-With', 'Content-Type', 'Access-Control-Request-cMethod',
|
||||
# 'Access-Control-Request-Headers']
|
||||
# }
|
||||
cors = CORS(app,
|
||||
supports_credentials=True,
|
||||
resources={r"/*": {"origins": ApplicationConfig.CORS_ALLOWED_ORIGINS}
|
||||
})
|
||||
|
||||
|
||||
# bind a function after each request, even if an exception is encountered.
|
||||
@@ -171,7 +169,6 @@ app.register_blueprint(main_blueprint, url_prefix='/main')
|
||||
from .customer import customer as customer_blueprint
|
||||
app.register_blueprint(customer_blueprint, url_prefix='/customer')
|
||||
|
||||
|
||||
from .delivery import delivery as delivery_blueprint
|
||||
app.register_blueprint(delivery_blueprint, url_prefix='/delivery')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user