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

Custom templates directory in sub-folder not usable #41

Closed
rclement opened this issue May 10, 2021 · 0 comments · Fixed by #42
Closed

Custom templates directory in sub-folder not usable #41

rclement opened this issue May 10, 2021 · 0 comments · Fixed by #42

Comments

@rclement
Copy link
Contributor

rclement commented May 10, 2021

When using a custom templates directory within a sub-folder, the templates are not used at runtime. For instance:

  • With a template folder at project/templates
  • Deploying using datasette publish vercel --template-dir project/templates ...

Inspecting the generated code using --generate-dir option yields:

  • A templates directory is generated at the root of the distribution folder (with the proper content)
  • Serverless function in index.py is referencing the templates folder with the wrong path:
app = Datasette(..., template_dir="project/templates", ...).app()

I think the fix is to simply set template_dir="templates" in index.py.

Note: it seems the same issue exists for plugins too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant