request logs

This commit is contained in:
Łukasz Jędyk 2022-01-31 17:10:35 +01:00
parent aeb87ec272
commit 61096f0c4f
2 changed files with 7 additions and 2 deletions

View File

@ -21,13 +21,19 @@ def create_app():
twitter_db.init_app(app) twitter_db.init_app(app)
campaign_db.init_app(app) campaign_db.init_app(app)
twitter_db.drop_all(app=app)
twitter_db.create_all(app=app) twitter_db.create_all(app=app)
campaign_db.drop_all(app=app) twitter_db.drop_all(app=app)
campaign_db.create_all(app=app) campaign_db.create_all(app=app)
app.register_blueprint(twitter, url_prefix='/twitter') app.register_blueprint(twitter, url_prefix='/twitter')
app.register_blueprint(campaign, url_prefix='/campaign') app.register_blueprint(campaign, url_prefix='/campaign')
@app.before_request
def log_request_info():
app.logger.debug('Headers: %s', request.headers)
app.logger.debug('Body: %s', request.get_data())
@app.route('/hello') @app.route('/hello')
def hello(): def hello():
return "Hello world!" return "Hello world!"

View File

@ -1,4 +1,3 @@
import os
from requests_oauthlib import OAuth1Session from requests_oauthlib import OAuth1Session
from flask import Blueprint, Response, current_app, request, jsonify from flask import Blueprint, Response, current_app, request, jsonify
from ayct_backend.twitter.models import * from ayct_backend.twitter.models import *