Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Datasette's --base-url setting #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dogsheep_beta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ async def execute_search(searchmode_raw):
if column in request.args:
args[column] = request.args[column]

path_with_query_string = "/{}/search_index.json?{}".format(
path_with_query_string = datasette.urls.path("/{}/search_index.json?{}".format(
database_name,
urllib.parse.urlencode(
args,
doseq=True,
),
)
))
inner_response = await datasette.client.get(
path_with_query_string, cookies=request.cookies
)
Expand Down
2 changes: 1 addition & 1 deletion dogsheep_beta/templates/beta.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</style>
<h1>Dogsheep Beta{% if q %}: {{ q }}{% endif %}</h1>

<form action="/-/beta" method="get"><div>
<form action="{{ base_url }}-/beta" method="get"><div>
<input type="search" name="q" value="{{ q }}" id="q">
{% if sorted_by != "relevance" %}
<input type="hidden" name="sort" value="{{ sorted_by }}">
Expand Down