Skip to content

Commit

Permalink
currency scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
Seyedsahel committed Apr 9, 2024
1 parent 2e88f03 commit 66be5af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'media/db.sqlite3',
'NAME': BASE_DIR / 'data/db.sqlite3',
}
}

Expand Down
1 change: 1 addition & 0 deletions server/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
urlpatterns = [
path('scraper/', ScraperAPIView.as_view(),name="scraper"),
path('clinet/', ClientAPIView.as_view(),name="clinet"),
path('currency/', CurrencyAPIView.as_view(), name='currency'),
]
9 changes: 8 additions & 1 deletion server/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from rest_framework.views import APIView
from temsah import Temsah
from temsah import Temsah , Currency
from rest_framework.response import Response
from .serializers import *
from rest_framework import status
Expand Down Expand Up @@ -29,4 +29,11 @@ def post(self, request):

return Response({ 'data': response.json(),})
#---------------------------
class CurrencyAPIView(APIView):
def get(self,request):
object_currency = Currency()
data = object_currency.scrape()
print(data)
return Response({ 'data': data,})


0 comments on commit 66be5af

Please sign in to comment.