我尝试在烧瓶中使用 upwork api 来获取一些信息,但它不起作用。我怎么能通过它的 api 从 upwork 中得到一些东西?
文件 app.py
import os
from flask import *
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_sqlalchemy import SQLAlchemy
from config import Configuration
from upwork import *
import upwork
# Create Flask app
app = Flask(__name__)
app.config.from_object(Configuration)
db = SQLAlchemy(app)
conn = db.engine
#os.environ['HTTPLIB_CA_CERTS_PATH'] = app.config.get('PATH_PEM')
# Create Migration db
migrate = Migrate(app, db, compare_type=True)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
UP_PUBLIC_KEY = app.config.get('UP_PUBLIC_KEY')
UP_SECRET_KEY = app.config.get('UP_SECRET_KEY')
UP_ACCESS_TOKEN = app.config.get('UP_ACCESS_TOKEN')
UP_ACCEES_TOKEN_SECRET = app.config.get('UP_ACCEES_TOKEN_SECRET')
文件视图.py:
from app import *
@app.route('/')
def get_from_api():
client = upwork.Client(UP_PUBLIC_KEY, UP_SECRET_KEY)
client = upwork.Client(UP_PUBLIC_KEY, UP_SECRET_KEY, oauth_access_token=UP_ACCESS_TOKEN,
oauth_access_token_secret=UP_ACCEES_TOKEN_SECRET)
request_token = client.auth.get_request_token()
print(request_token)
pass
当我调用“print(request_token)”时,它会打印“null:null”