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

Teach "datasette publish" about custom template directories #157

Closed
simonw opened this issue Nov 30, 2017 · 1 comment
Closed

Teach "datasette publish" about custom template directories #157

simonw opened this issue Nov 30, 2017 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented Nov 30, 2017

The following command should copy the custom templates into the deployment and ensure datasette serve correctly serves them:

datasette publish now mydb.db --template-dir=custom-templates/
@simonw
Copy link
Owner Author

simonw commented Dec 9, 2017

Example usage:

datasette package --static css:extra-css/ --static js:extra-js/ \
	sf-trees.db --template-dir templates/ --tag sf-trees --branch master

This creates a local Docker image that includes copies of the templates/,
extra-css/ and extra-js/ directories. You can then run it like this:

docker run -p 8001:8001 sf-trees

For publishing to Zeit now:

datasette publish now --static css:extra-css/ --static js:extra-js/ \
	sf-trees.db --template-dir templates/ --name sf-trees --branch master

Example: https://sf-trees-wbihszoazc.now.sh/sf-trees-02c8ef1/Street_Tree_List

For publishing to Heroku:

datasette publish heroku --static css:extra-css/ --static js:extra-js/ \
	sf-trees.db --template-dir templates/ --branch master

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

No branches or pull requests

1 participant