forked from psychemedia/jupyter-datasette-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try using --config base_url and absolute_url: True
Also formatted using Black. Refs #1.
- Loading branch information
Showing
1 changed file
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
import os | ||
|
||
|
||
def setup_datasette(): | ||
dbpath = os.path.join(os.environ['HOME'], 'dakar_sql.sqlite') | ||
return { | ||
#datasette does look like it supports static references, but I'm missing something somewhere? | ||
# https://github.com/simonw/datasette/issues/160 | ||
#If we set static refererncing, do we also need ;absolute_url': False ? | ||
#I may (also) be misunderstanding {base_url}. Is that the domain, the domain+path, or the path? | ||
#If it's the path, then can it be used to set the static element (once I figure out what args --static takes) | ||
#I am so in the land of so-tired I have no idea what anything does. | ||
#'command': ['datasette', 'serve', '-p', '{port}', '--static', 'static:{base_url}', dbpath], | ||
'command': ['datasette', 'serve', '-p', '{port}', dbpath], | ||
#With absolute_url True we get infinite redirects? | ||
'absolute_url': False, | ||
#The following needs a the labextension installing. | ||
#eg in postBuild: jupyter labextension install jupyterlab-server-proxy | ||
'launcher_entry': { | ||
'enabled': True, | ||
#'icon_path': '/home/jovyan/.jupyter/datasette.svg', | ||
'title': 'Datasette', | ||
}, | ||
} | ||
dbpath = os.path.join(os.environ["HOME"], "dakar_sql.sqlite") | ||
return { | ||
"command": [ | ||
"datasette", | ||
"serve", | ||
"-p", | ||
"{port}", | ||
"--config", | ||
"base_url:{base_url}", | ||
dbpath, | ||
], | ||
"absolute_url": True, | ||
# The following needs a the labextension installing. | ||
# eg in postBuild: jupyter labextension install jupyterlab-server-proxy | ||
"launcher_entry": { | ||
"enabled": True, | ||
#'icon_path': '/home/jovyan/.jupyter/datasette.svg', | ||
"title": "Datasette", | ||
}, | ||
} |