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

Create composable Django project template #318

Closed
hancush opened this issue Mar 9, 2023 · 4 comments
Closed

Create composable Django project template #318

hancush opened this issue Mar 9, 2023 · 4 comments
Assignees
Labels

Comments

@hancush
Copy link
Member

hancush commented Mar 9, 2023

Background

The contours of what's Django, what's Wagtail, and what's React/JavaScript blurry when you don't set it up yourself. Our current template management paradigm also requires us to have separate Django and Wagtail templates, which means we have to update things in two places.

Let's spend some time looking into options for a composable template that allows us to separate concerns, such that it's easier to learn what pieces of a project belong to what tool and we only have to make updates in one place.

Proposal

Research available approaches for composing templates into a single project; and pilot the one that looks best.

Deliverables

A composable Django project template. If we like it, we can adopt it and create one for vanilla JavaScript, as well.

Timeline

Two investment days.

@hancush hancush added the R&D label Mar 9, 2023
@hancush hancush self-assigned this Mar 9, 2023
@hancush
Copy link
Member Author

hancush commented Mar 9, 2023

I considered https://github.com/callowayproject/cookie-composer and https://github.com/pyscaffold/pyscaffoldext-cookiecutter, but the former is still in beta and the latter would require a more profound shift from our current practices.

Ultimately, after reading this thread, I decided to pursue an approach that uses one Cookiecutter template with subdirectories containing what we need for Django, React, and Wagtail, respectively, and a post_project_gen hook to rsync the included tools into the root project directory; concatenate READMEs, requirements, and Django settings; and remove the cruft. https://github.com/datamade/how-to/tree/hcg/composable-template/work-practices/project-templates

Entering into test phase now, but curious to hear feedback on this approach from the team.

@smcalilly
Copy link
Contributor

The ultimate goal is one single Django template, with the option to include Wagtail. We'll decide what we need to do to accomplish this.

@hancush
Copy link
Member Author

hancush commented May 22, 2024

I have a renewed interest in this after fighting with the Wagtail cookiecutter. (Related #370)

Minimal app running Wagtail 6.1 here: https://github.com/datamade/tpc-ihs-noah-map/tree/ba9d491e8a6263d0395f7031075920599dc90860

@hancush
Copy link
Member Author

hancush commented May 22, 2024

Closing in favor of #371

@hancush hancush closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants