Hi Django community! Iām excited to share a tool Iāve been working on to help make Django even more welcoming to newcomers.
What is DJ Beat Drop?
DJ Beat Drop is a modern project initializer for Django that aims to provide a smoother getting-started experience. It was inspired by my experiences teaching Django and the project initialization patterns from other modern web frameworks.
Iāve also written about it in detail here and you find the repository here.
Features
Intuitive project structure with dedicated config directory
Built-in support for .env files
Modern Python tooling support (like uv)
Smooth CLI experience
Try It Out!
pip install dj-beat-drop
# Reload your shell to make the command available.
beatdrop new example_project
The new folder structure for config is only documented in the demo movie. But it went past so fast that I couldnāt see it, and I couldnāt pause the movie. I had to take a screenshot to see it.
The resulting structure still uses the project name for configuration files:
This complaint is a bit weird. You put config as the module name. Donāt you think thatās a bitā¦presumptious? This will clash with config Ā· PyPI which is the package that has taken that name.
config.urls is pretty weird as the module name for your projectās urls. Thereās a reason itās your_project.urls by default. I think you might just be unused to python, and think this is not ābest practicesā when in fact it is.
The Django CLI experience has some rough edges - error messages arenāt consistently formatted, and simple issues like hyphens in project names result in errors rather than automatic conversion to underscores.
This I 100% agree with though. Iāve hit that myself a few times.
The new folder structure for config is only documented in the demo movie. But it went past so fast that I couldnāt see it, and I couldnāt pause the movie. I had to take a screenshot to see it.
I went ahead and added what the directory structure looks like after the command. Thank you for the suggestion.
This complaint is a bit weird. You put config as the module name. Donāt you think thatās a bitā¦ presumptuous? This will clash with config Ā· PyPI which is the package that has taken that name.
config.urls is pretty weird as the module name for your projectās urls. Thereās a reason itās your_project.urls by default. I think you might just be unused to Python, and think this is not ābest practicesā when in fact it is.
So another friend made some similar comments, and this was my response:
I appreciate the perspective on namespacing - itās one of the things I love about Python. Let me share my thinking on this:
I fully agree that namespacing is important. The question is whether the project configuration code needs to live in that namespace. Most modern frameworks separate configuration from application code while maintaining proper Python namespacing for the application modules.
Project naming presents a practical challenge. In my experience, initial project names often change as requirements evolve. Having this name baked into the configuration structure can lead to technical debt when teams need to rename projects. Engineers usually hesitate to refactor this due to the risk and effort involved.
A standardized config directory could improve tooling integration. Many tools (IDEs, deployment platforms like AppPack) could provide better default support without relying on DJANGO_SETTINGS_MODULE configuration.
While Djangoās current approach works, adopting common patterns from the broader web development ecosystem (Laravel, Rails) could lower the learning curve for developers who are new to Django.
For application-level namespacing, Iāve found that an apps directory with a base app (apps/base/) effectively provides the namespace benefits you mentioned. For example, our PEARS project has 39 apps cleanly organized under the apps directory. This maintains good namespacing while keeping the project root clean and configuration separate.
Regarding your specific comment about distribution on PyPI: I would say that I was thinking that DJ Beat Drop is more about creating new Django web applications, not a third-party open-source Django plugin package. For that, I would start by doing the following:
How would a user module or a config module conflict with other packages that have a user module (e.g., foo_package.user)? I understand how it could conflict if you wanted to publish it to PyPI, but again, that goes back to what I was saying: if I was going to distribute on PyPI, then I wouldnāt have my package called config. I would probably name my package according to its branding/name. However, I would probably still put my config code in a config directory. So, my layout would be something like the following if I used PyPI for distribution.
How would a user module or a config module conflict with other packages that have a user module (e.g., foo_package.user )?
They wouldnāt. Thatās what āfoo_package.ā is for. Your āconfigā module does NOT have such a prefix, which is my objection.
(In Python 2, there was a standard library module called user, thatās why that was a problem, you donāt want to have namespace collisions with the standard library!)
It seems like youāre not understanding me. If you look at the directory output above, what Iām suggesting, there wouldnāt be a conflict because the package would be called, example_project.
I believe the structure Iām proposing in my blog and what is created with DJ Beat Drop is still a better and more preferred way, especially for developers new to Django. I acknowledge that some, like yourself, might want to distribute their project using PyPI. I donāt have any data supporting it, but my guess is that isnāt how most people want to deploy their projects. It wouldnāt be practical to try to help someone new to Django or Python learn all the intricacies of Python packaging. If you want to do it that way, youāre probably more advanced and will want to manually set up your project. I would consider adding an argument like --use-pypi-structure that would create a structure similar to what I showed above if there was a demand for it.
This complaint is a bit weird. You put config as the module name. Donāt you think thatās a bitā¦presumptious? This will clash with config Ā· PyPI which is the package that has taken that name.
PyPI has 579,524 projects as of today which means there are very few apps names that one could pick that wouldnāt clash. Especially one that hasnāt been updated in over three years.
config.urls is pretty weird as the module name for your projectās urls. Thereās a reason itās your_project.urls by default. I think you might just be unused to python, and think this is not ābest practicesā when in fact it is.
I have used config for years. I worked on dozens of projects a week and most use this convention. The few that donāt are harder to work with because your_project takes longer to scan for and find. Even when searching, it easier if a project name sorts closer to the top than the bottom.
Either way, this smells of bike shedding, and you should name your projectās config folder whatever sparks joy.
The few that donāt are harder to work with because your_project takes
longer to scan for and find. Even when searching, it easier if a
project name sorts closer to the top than the bottom.
I also switched using config a long time ago for the same reasons.
Hmm. I still donāt understand that. For common stuff I prefer ābaseā, but I namespace that under the project name. So for work now I have dryft.base for example, and dryft.planning for the planning app. You would have that as base and planning at the top level? Donāt you risk namespace conflicts a lot then? And making the imports everywhere quite hard to read as they donāt clearly delineate what is stdlib or 3rd party from the project?
Iāve been using a config folder for configuration files and then an apps folder for all my projects apps for over 12 years or more and Iāve never had a single namespace conflict.
That āappsā namespace would be the reason for no conflicts. I just think that if you are doing apps.foo for app names, why not project_name.foo, and then logically project_name.config for the config. Itās the config for the project after all.
In any case, the part I object to is the term ābest practicesā, and the idea of moving such cultural habits over from one culture to another and declaring it an improvement. Itās not imo, itās just different.
And I think as many others I got that from āDjango for Beginnersā by
Will Vincent.
I hope itās ok to quote from my copy here
āChapter 1: Initial Set Upā
[ā¦]
Create a new Django project called config with the following command.
Donāt forget that period . at the end.
(django) $ django-admin startproject config .
[ā¦] By running django-admin startproject config . with the period at
the end - which says, install in the current directory - the result is
instead this:
The takeaway is that it doesnāt really matter if you include the
period or not at the end of the command, but I prefer to include the
period and so thatās how weāll do it in this book. As you progress in
your journey learning Django, youāll start to bump up more and more
into similar situations where there are different opinions within the
Django community on the correct best practice. Django is eminently
customizable, which is a great strength, however the tradeoff is that
this flexibility comes at the cost of seeming complexity. Generally
speaking, itās a good idea to research any such issues that arise,
make a decision, and then stick with it!