Forums

PythonAnywhere domain changes to localhost with form submission

I have my project upload to PythonAnywhere: https://binnybit.pythonanywhere.com/

However there is an issue when a form submission is made. The form I'm referring to is at the top of the page with the placeholder Search...

When the submission is made, the domain changes from binnybit.pythonanywhere to localhost. As I'm digging for answers as to why this is happening the following error is raised in the browser dev tools: 'crbug/1173575, non-JS module files deprecated.'

What is causing this to happen and how can it be resolved so that the domain doesn't change to localhost?

urls.py

posts_patterns = ([
    re_path(r"questions/search$", pv.SearchResultsPage.as_view(), name="search_results"),
], "posts")

index.html

      <form method="get" action="{% url 'posts:search_results' %}" novalidate>
      {% for field in search_form %}
        {{ field }}
      {% endfor %}
      </form>

We need more context to help you. Is there some url that we can visit and take a look?