How to read question mark in the URL of django framework?

I am developing a Django app that stores the user input in the database. Now the problem is that when the user writes the ? in the input field, Django treats it as the part of querystring so it doesn’t save it.

here is my file:

urlpatterns = [
     path('add/<str:text>',views.add, name='add'),

in , I have:

def add(request,text):
    field = Text(text=text)
    return HttpResponse('')

the JavaScript code:

    text = $("#input").val();

The problem isn’t Django. A normal form submission will encode such
characters, even a GET form. The problem is your JavaScript:

    text = $("#input").val();

That is the wrong way to pass text. There’ll be a correct way to pass
text as the query string contents. You’re just wacking it onto the end
of the URL, which is wrong.

My JavaScript is pretty rusty. Look up how to do form submissions with
the toolkit you’re using.

Cameron Simpson