I have a script which pretend to create a form in my site and receive the response, let's call it script.py.
This script needs to call a function in views.py:
opc = newproject.views.Menu_Options(request, ask, Options)
This function needs to use request.POST, so needs to receive "request" as parameter.
The problem is:
Script.py doesn't know what is "request". I imported this:
import newproject.views
import django
from django.http import request
I ran the project but simply ignored the parameter "request" and gave me an error in this line:
opc = newproject.views.Menu_Options(ask, Options)
Exception Type: TypeError at /
Exception Value: Menu_Opctions() missing 1 required positional argument: 'Options'
Did I import a "wrong request"?
Is there any other way in views.py to import in a function the object "request" without passing it as parameter?
Thanks in advance! :)
What I have tried:
I tried to import this:
import newproject.views
import django
from django.http import request
to Script.py but don't seems to work