Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is great and showcases Django's talent for basic CRUD apps with handy admin interfaces.

One catch: I like to deploy static sites to GitHub Pages. It turns out the Django ecosystem has an answer for that in the form of Django Distill [1]. Distill adds a new management command that generates static content by repeatedly invoking your views.

I've used Distill to build quite a few static sites. It's great to be able to deploy to Pages but use Django's admin UI locally. Typically, for these sites, I check in my 'production' SQLite database directly to my git repo.

(Combine this pattern with GitHub actions and you can do a lot with a little. For instance, here's a toy I built to summarize upcoming Seattle city council meetings [2].)

[1] https://github.com/meeb/django-distill

[2] https://scc.frontseat.org/ -- source at https://github.com/front-seat/engage



Your use case and workflow is exactly why I originally developed django-distill, glad to see it resonates with other developers. Thanks!


Thanks for Distill. The approach you took (specialized URL routes and custom management commands) is simple and elegant.


This sounds like an awesome pattern, and I had no idea it exists!


It’s a good one.

Simon Willison calls it the “baked data pattern” — where a read-only copy of your data is checked into your repo alongside your code. [1]

(And, just to tie the threads together, that’s the same Simon who wrote the OP we’re all commenting on, and who is also the co-creator of Django and more recently of the very handy Datasette!)

[1] https://simonwillison.net/2021/Jul/28/baked-data/


I say this as someone that does like Django.

I had the opposite opinion. If you were trying to convert Rails, Laravel or CakePHP users, this would just convince them that Django was more manual and involved than those frameworks. It would be better to utilize extensions like `scaffolding` to give a more equivalent workflow. It does demonstrate general MVC benefits and architecture, however.


Your links may be broken

I was recently looking for a static site generator for a local relay race I help organize and django-distill was the top of my list. I ended up writing my own SSG because I had very little HTML that actually had to be generated on the site. But might check out django-distill in the future if you found it worth learning.


Can you think of a complicated app that utilizes Django to its fullest extent? I'm trying to get a better view of what Django is capable of and I find it's helpful to see both the simplest example possible and the most complicated example possible. "Design for the extremes" as Don Norman would say.


Instagram's backend is a Django monolith "with several million lines of code and a few thousand Django endpoints" as of 2019, and the same architecture was used for Threads! They now run Django on a JIT-enabled fork of CPython, and leverage a ton of internal tooling for static analysis and strong typing.

https://instagram-engineering.com/types-for-python-http-apis...

https://engineering.fb.com/2023/09/07/culture/threads-inside...

https://engineering.fb.com/2022/05/02/open-source/cinder-jit...

https://engineering.fb.com/?s=django

Django is also excellent for e-commerce with projects like https://github.com/saleor/saleor - or you can roll your own e-commerce system quite easily, which we've done at my travel startup.


23andMe is also a Django app, at least the logged in site[0] and the API[1]. The API actually started off with Django 0.96. I had the distinct pleasure(?) of upgrading it to Django 3.

[0] https://you.23andme.com/ [1] https://api.23andme.com/


Was the blog post titled Django3andMe? :)


Lots of interesting links; thanks!

Here in Seattle, Rover (a $1B+ market cap company) also uses Django extensively. As do lots of interesting local startups.


That is sufficiently complicated. Thank you!


Whats your travelling startup?


I generally try not to publicly link my HN activity to my IRL identity, but my email's in my bio if you have any specific inquiries!

To the larger point about Django and e-commerce, though, I'll share that we do a large volume of complex transactions where multiple funds flows for different parties need to be coordinated, so it's been vital to be able to have a dynamic data model to track the payables/receivables lifecycle of a given booking and add overrides/configurability to handle unique situations as they come along. Django's been a perfect match for that, the framework source code is very approachable (IMO much less "magical" than Rails in this regard while having the same level of expressivity and shorthand), and since it's Python, it works extremely well with data science tooling as well.


The wagtail CMS would be a good example of more complex systems built on top of Django. https://wagtail.org/

One of the many more complex sites we've used it to build is https://www.business-humanrights.org/en/ which tracks over 10k companies, 100k+ articles in 15 or so languages. We've also built internal dashboards, live updating forums, donations platforms and so on. Another interesting one might be https://www.achurchnearyou.com/ which is used by the church of England to provide "mini sites" for all their congregations around England, so several thousand church administrators use that every week.


Thank you! I'll give that a gander.


You can also use wagtail with django-distill!



I've been involved with several enterprise applications based off of Django - leveraging signals, custom models, tasks, etc. to power insurtech and fintech applications.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: