Django to WordPress without api?

98 views
Skip to first unread message

Danish Nagori

unread,
Feb 1, 2024, 12:21:44 PMFeb 1
to django...@googlegroups.com
I have scrapping project which is.develop in django 
Now.iwant to integrate to WordPress so how

Luciano Martins (luxu)

unread,
Feb 1, 2024, 1:20:44 PMFeb 1
to Django users
Este projeto se assemelha ao Wordpress...wagtail...pesquise sobre ele.

Mordecai Etukudo

unread,
Feb 1, 2024, 8:35:37 PMFeb 1
to django...@googlegroups.com
Make and API with it get the endpoint and call the API on you WordPress template one way 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4813ca0c-d846-4e4e-af8c-d8fff14c6815n%40googlegroups.com.

Ryan Nowakowski

unread,
Feb 3, 2024, 2:03:13 PMFeb 3
to django...@googlegroups.com
What do you want the end result to be? Do you want your Django content
to sit insite an existing Wordpress site? The other way around?


On Thu, Feb 01, 2024 at 10:20:30PM +0500, Danish Nagori wrote:
> I have scrapping project which is.develop in django
> Now.iwant to integrate to WordPress so how
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKa3baYswMcoKJs85E5Ydrv8uF4OZ-qGbRQT73CR0s-nTFPthQ%40mail.gmail.com.

Space1 Technology

unread,
Feb 3, 2024, 4:15:08 PMFeb 3
to django...@googlegroups.com
I have issues trying to settup an api endpoint in my Django DRF server using Flutterwave by calling their Api in my view function. When I wrote my code and tested it with Postman client I got payment failed error. I believe I set everything well but I don’t know why am getting the error. This is my code snippet for the test mode implementation, I need quick help:

from rest_framework.response import Response from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.decorators import api_view import logging import requests logger = logging.getLogger(__name__)

 @api_view(['POST']) @csrf_exempt def wallet_top_up_view(request, *args, **kwargs): try: # Required variables amount = float(request.data.get('amount', 600.0)) ko_test_email = 'space1...@gmail.com' ko_test_name = 'Kaka Olawale' # Required API variables/parameters api_url = 'https://api.flutterwave.com/v3/charges?type=card' qms_redirect_url = 'http://localhost:8000/api/payment/success/' qms_ref = 'Welcome to Quickmed Platform, kindly proceed with payment' secret_key = 'FLWSECK_TEST-869279d145197389f77808be9187e4a3-X' # Replace with your actual secret key card_number = '5531886652142950' cvv = '564' expiry_month = '09' expiry_year = '32' headers = { 'Authorization': f'Bearer {secret_key}', 'Content-Type': 'application/json', } payload = { "tx_ref": qms_ref, "amount": amount, "currency": "NGN", "redirect_url": qms_redirect_url, "order_id": "your_order_id", "order_ref": "your_order_reference", "payment_type": "card", "customer": { "email": ko_test_email, "name": ko_test_name, }, "card": { "number": card_number, "cvv": cvv, "expiry_month": expiry_month, "expiry_year": expiry_year, } } # Make the POST request and store in the response variable response = requests.post(api_url, headers=headers, json=payload) # Check if the response was successful if response.ok: payment_link = response.json().get("data").get("link") return Response({"payment_link": payment_link}, status=201) else: return Response({"error": "Payment failed"}, status=response.status_code) except Exception as e: logger.exception("An error occurred in WalletTopUpView") return JsonResponse({"error": str(e)}, status=500)

Sunday Ajayi

unread,
Feb 3, 2024, 7:30:40 PMFeb 3
to django...@googlegroups.com
Hi 

If you are still having the challenge, we could schedule a call via meets and review your code .
Sounds cool ? 

Regards


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages