Save symbol price in database

This commit is contained in:
2022-04-05 15:08:57 +02:00
parent 852dedfc0c
commit 695b7593be
9 changed files with 151 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
import os
import random
import faker
import requests
url = 'http://127.0.0.1:5000/api'
username = ''
password = ''
@@ -12,7 +12,7 @@ shares = ["TWTR", "GOOG", "AAPL", "MSFT", "AMZN", "FB", "NFLX", "TSLA", "BABA",
fake = faker.Faker()
token = requests.post(url + '/user/login', json={"email": username, "password": password}).json()['data']['token']
token = requests.post(os.getenv("API_URL") + '/user/login', json={"email": username, "password": password}).json()['data']['token']
for i in range(1, 1000):
payload = {
@@ -22,4 +22,4 @@ for i in range(1, 1000):
"time": fake.date_time().isoformat() + ".000Z"
}
response = requests.post(url + '/transaction', json=payload, headers={'Authorization': 'Bearer ' + token})
response = requests.post(os.getenv("API_URL") + '/transaction', json=payload, headers={'Authorization': 'Bearer ' + token})