🎨 feat: add management command to generate sample content#169
🎨 feat: add management command to generate sample content#169ArcaneIRE merged 3 commits intoPythonIreland:masterfrom
Conversation
adds a management command using Factory Boy to generate sample data for development.
Changes:
- add factory-boy to dev dependencies
- create core/factories.py with factories for models
- create generate_sample_data management command
- fix root_page() template tag returning None
- update README with sample data generation steps
Closes PythonIreland#81
|
Thanks Saurabh, I'll try to take a look at this today |
Add the missing package information to `requirements/dev.txt`. They were included in `dev.in` but had not yet been locked. Also mentioned environment variable setup in the README, as that is a necessary step. uv pip compile docs: [docs.astral.sh / Locking Environments](https://docs.astral.sh/uv/pip/compile/)
This package was removed due to the addition of a new similar package, but there are still test dependencies on it. For now, this commit adds the package back. Note: this package seems to be deprecated due to a naming issue, we may consider switching to model-bakery. [link](https://pypi.org/project/model-mommy/)
|
When pulling this locally to verify, I ran into an error while following the docker instructions. While you correctly added the new package to After I made that change, I pushed the commit here - which immediately failed tests! I didn't know we had tests! It also turns out the removed Otherwise, seems good! Thanks for making the change! |
|
Hi @ArcaneIRE Thanks a lot for the detailed review and for fixing the dependency locking and model_mommy issues, that was really helpful. I’ve learned a bit more about the project’s tooling and tests from this, and I’ll keep it in mind for future contributions. |
No problem!
Same here! |
adds a management command using Factory Boy to generate sample data for development.
Changes:
- add factory-boy to dev dependencies
- create core/factories.py with factories for models
- create generate_sample_data management command
- fix root_page() template tag returning None
- update README with sample data generation steps