0

Without storing anything to a database, I want for the user to be able to enter a name (NAME) into my form and hit a submit button. Upon hitting submit, the name entered will be appended at the end of my URL like so: http://127.0.0.1:8000/username=NAME

All I have is this basic form:

<form method="post">
{% csrf_token %}
{% bootstrap_form form %}
  <input type="submit" value='Enter Name'></input>
</form>

I am also trying to make it so that if the user types directly into the URL, they would be able to find the same page as if they were typing into the form.

Example: A user types 'Joe' at the end of an URL as http://127.0.0.1:8000/username=Joe and gets a page about Joe. I expect the same resulting page about Joe when I enter 'Joe' into my form.

  • 1
    Are you talking about querystring parameters (the part after the `?` in the URL) ? Those are normally only appended to the ULR in GET requests, not in POST. – Ralf Apr 10 '19 at 21:04
  • Yes! I am talking about querystring parameters. Specifically how would I implement that into a class based view's "get" function. – Robin Nguyen Apr 10 '19 at 22:35
  • [This question](https://stackoverflow.com/q/150505/9225671) talks about accessing GET parameters, maybe that helps. – Ralf Apr 10 '19 at 23:12

0 Answers0