from .models import MerchantStoresfrom django.db.models.signals import post_savefrom django.dispatch import receiver
@receiver(post_save, sender = MerchantStores, weak=False)def ensure_store_id_exists(sender, **kwargs): print ("check fucntion") ex = kwargs.get("instance").store_id print ("store id:",ex) import requests URL = "http://example.cloud/rmsservice/resetPin?storeId="+str(ex) print("url:",URL) data = {'Content-Type': 'application/json', 'app-id': 'APP_ID', 'secret-key': 'SECRET_KEY', 'aid': 'PG'}
r = requests.post(url=URL, headers=data) response_text = r.text print(response_text)
from django.apps import AppConfig
class AdminappConfig(AppConfig):
name = 'adminapp'
def ready(self):
import adminapp.signals
[21/Nov/2018 14:18:03] "GET /jsi18n/ HTTP/1.1" 200 3185check fucntionstore id: 1533{"success":false,"code":"8050","message":"Merchant not active","response":null}[21/Nov/2018 14:18:29] "POST /adminapp/merchantstores/add/ HTTP/1.1" 302 0[21/Nov/2018 14:18:32] "GET /adminapp/merchantstores/ HTTP/1.1" 200 12659[21/Nov/2018 14:18:34] "GET /jsi18n/ HTTP/1.1" 200 3185
--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9edd586b-604b-4734-ab1d-28f7fda9d527%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/92aa3ade-9525-4f99-a85f-aef4c57172ba%40googlegroups.com.
kwargs.get("created")
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9f6d3cc5-3976-4278-bd1e-be086a8c9d7d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%2Be-ZUrgHW7WoVMJ1zHV1j3fDOq16V0n%2BM2NOXjVZiixT8Zng%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL1UH0vAqtzQB7DCE3Sx_BqRRtNgKjXvMAn33F2Aa8J%2BaQQEsw%40mail.gmail.com.
|
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL1UH0vAqtzQB7DCE3Sx_BqRRtNgKjXvMAn33F2Aa8J%2BaQQEsw%40mail.gmail.com.