commit
This commit is contained in:
3
backend/thirdparty/trading212/apps.py
vendored
3
backend/thirdparty/trading212/apps.py
vendored
@@ -3,4 +3,5 @@ from django.apps import AppConfig
|
||||
|
||||
class Trading212Config(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'trading212'
|
||||
name = 'thirdparty.trading212'
|
||||
label = "trading212"
|
||||
|
||||
4
backend/thirdparty/trading212/urls.py
vendored
4
backend/thirdparty/trading212/urls.py
vendored
@@ -1,6 +1,6 @@
|
||||
from django.urls import path
|
||||
from .views import YourTrading212View # Replace with actual view class
|
||||
from .views import Trading212AccountCashView # Replace with actual view class
|
||||
|
||||
urlpatterns = [
|
||||
path('your-endpoint/', YourTrading212View.as_view(), name='trading212-endpoint'),
|
||||
path('your-endpoint/', Trading212AccountCashView.as_view(), name='trading212-endpoint'),
|
||||
]
|
||||
2
backend/thirdparty/trading212/views.py
vendored
2
backend/thirdparty/trading212/views.py
vendored
@@ -1,7 +1,6 @@
|
||||
# thirdparty/trading212/views.py
|
||||
import os
|
||||
import requests
|
||||
from decouple import config
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
@@ -18,6 +17,7 @@ class Trading212AccountCashView(APIView):
|
||||
)
|
||||
def get(self, request):
|
||||
api_key = os.getenv("API_KEY_TRADING212")
|
||||
|
||||
headers = {
|
||||
"Authorization": f"Bearer {api_key}",
|
||||
"Accept": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user