I'm building a custom function to pull the data from mongodb and want to see the data what it is look like before the manipulation.
say I have a function to request the data from mongodb
Here is how my models.py looks like
from bson import json_util
from django.db import models
from django.http import JsonResponse
from pymongo import MongoClient
from bson.json_util import dumps
from bson.json_util import loads
import json
import pymongo
def data_pull(request):
request_data = request.POST.get('Hello', None)
if __name__ == "__main__":
data_pull(request)
to run the models.py I do python models.py from the command line but getting this error
NameError: name 'request' is not defined
So basically I want to test this data_pull function from models.py and see that what the data looks like. How can I feed this request call into the function and see the output from commandline?