How to access function inside class from Ajax?

Hey I want to call upon a function inside a class in views.py from within an Ajax call.

How would I go about it? An example would be great.

Thanks!

An AJAX call is the submission of either a GET or POST request to a URL.

That URL is mapped to a view in the urls.py file.

The view handling the request from that URL can access any class / method like any other python code.

1 Like