I haven't been using Django for very long .I'm still early on that road. But I've always liked practical things, and one thing bugged me fast: every time you need to create a new app, there's a ton of manual editing involved — creating folders, creating files, organizing everything from zero.
Imagine having to build one or more APIs. Each one might need 5 to 8 extra files (serializers, permissions, selectors, services, tests...). Every time, the same repeated work.
That's why I built DjReframe: you set up the structure you want once, and after that it's just one command ,the whole architecture comes out ready. You can have several predefined structures and use whichever you want, whenever you want.
How it works
Install it:
pip install dj-reframe
And generate the app already in the architecture you need:
# Traditional web app
dj-reframe blog sitev1
# API with Django REST Framework
dj-reframe api drf
# App with WebSockets
dj-reframe chat websockets
No more creating files one by one by hand.
Available architectures
DjReframe already ships with several ready-made options, including:
- sitev1 / sitev2 — traditional web app (with or without a service layer)
- api — full DRF setup (serializers, permissions, pagination, tests)
- api-graphql — GraphQL API with Strawberry/Graphene
- websockets — consumer/routing-based apps
- celery-tasks — apps focused on async tasks
- microservice, admin-centric, ml-integration ,and more
Custom templates
If none of the built-in architectures fit, you can create your own:
dj-reframe --my-templates
This opens the folder where you build your own structure — you just need to name Python files with .py-tpl (Django/DjReframe automatically converts them to .py when generating).
Requirements
Python >= 3.10
Django >= 4.0
The project is open source, MIT licensed, and open to contributions — PRs are welcome.
🔗 Repo: https://github.com/DougVikt/dj-reframe
📦 PyPI: pip install dj-reframe
If you find it useful, drop a ⭐ on the repo. And if you have ideas for new architectures or templates, open an issue.
Top comments (3)
The 5-to-8-files-per-endpoint tax is real, and it's the part of 'fat models, thin views' nobody writes down: the files are cheap individually, the cost is the ceremony of touching six places to add one boring endpoint.
Having several predefined structures and picking per app is the design decision I'd push on. Structure templates drift from what the framework currently recommends - Django itself changed its settings layout between versions - so the maintenance question is who updates the templates when the framework moves and you haven't started a new app in six months.
How do you handle the escape hatch? Most scaffolding fights happen when a service genuinely doesn't fit selectors-services-serializers, and the tool either gets bypassed or bends the service into the shape it expects.
Thank you for your comment! It’s true ,the framework is very practical, but during development, you need to take into account the time it takes to create each file and directory according to the project. As you mentioned, updates also affect these structures, many updates intended to simplify the code remove the more robust features, leaving it as “basic” as possible.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.