189 points · by jsmeaton · 12y ago · 107 comments
Anyone know if there are any plans to update the HTML/CSS for the Admin app? Functionally it rocks, but visually it feels like you're revisiting 2001. I'd LOVE to see it rebuilt based on Zurb's Foundation or Bootstrap. I think we'd see a lot of innovation inside the admin.
We then add in Bootstrap CSS+JS so we can some of the handy UI components and then our own CSS on top of that.
[0] http://grappelliproject.com/ [1] https://github.com/sehmaschine/django-filebrowser
https://github.com/django-admin-bootstrapped/django-admin-bo...
Both are trivial to set up and install.
That said, there seems to be a slight hiccup in third-party apps moving towards 1.7, since those that have existing South migrations are in the dilemma of whether to break backwards compatibility in moving to the native migrations framework. Also there is a nice chunk of deprecated APIs (such as @transaction.atomic) that many projects will throw warnings about now, until those are patched.
Personaly, I've already started migrating projects to 1.7 in anticipation of an upcoming release in the next few weeks.
Kudos!
It's better to have it built in, sure, but it wasn't a nuisance before.
Edit: Why the downvotes? The templates are slow[1] and restrictive (no function calls with parameters in templates. wat). and the ORM is utter rubbish compared to SQLAlchemy. Django shines because it is convenient (and there is a large ecosystem) - relationships are easy to configure and everything just works together. Which is nice I guess, but it does force you to use all of Django's inferior stuff.
I keep hearing it's slow, but I haven't had to run at a scale that it's a pain point, so I wouldn't know.
I still think it could be made more user friendly for designers, though. We need some sort of app that will autofill django templates' context variables with test data so that designers can see how it all looks and edit them under different circumstances without having to deal with the messiness or state of the system underneath.
I like the ORM - the design philosophy is about making the simple things easy and the hard things possible and it think it succeeds at that.
Here's a gist I made the other day demonstrating this. https://gist.github.com/jawnb/cd7a899cac5300c01709
The poor abstraction really causes problems when you need to do anything beyond the simplest of use cases. To achieve even modest performance gains, you're better off hand writing your SQL. Additionally, doing even the most trivial of trivial aggregate queries will also mean that you're hand writing SQL.
SQLAlchemy is light years beyond the django ORM in this regard.
Don't take just my word for it though, here's a talk Alex Gaynor gave saying the same things. https://www.youtube.com/watch?v=GxL9MnWlCwo
I do love the relationship stuff - making a m2m field is super easy and it just works. Also manager/queryset extensions are super easy.
Pyramid + SQLAlchemy + Alembic (migrations) + Deform (...forms) + your choice of (jinja2/mako/etc) == happiness
There's just two commands [0]:
makemigrations - to create migrations
migrate - to (un)apply migrations
Adding migrations to an existing app is just running the `makemigrations` command for that app [1]: python manage.py makemigrations your_app_label
It will create a migrations/ folder in the app folder and you're good to go. When you change your models and run `makemigrations` again, it will make migrations for the changes you made and you can apply them with the `migrate` command. For migrations that can't be detected automatically (like renaming models/fields) you can create an empty migration file (by supplying `--empty` to the `makemigrations` command) and edit the migration file yourself. With the great documentation this is easily done [2].They also support data migrations (migration for the data in your database instead of the scheme of the tables). So I think it replaces pretty much all features of South. BTW, the original creator of South (Andrew Godwin) helped create the migration framework in Django, so no hard feelings ;).
[0] https://docs.djangoproject.com/en/1.7/topics/migrations/#two...
[1] https://docs.djangoproject.com/en/1.7/topics/migrations/#add...
[2] https://docs.djangoproject.com/en/1.7/ref/migration-operatio...
A friend recommended: http://www.amazon.com/Two-Scoops-Django-Best-Practices/dp/09... but looking for other recommendations as well.
If you want to use GAE, I recommend just starting with web.py or whatever is the default framework there. It's fairly easy to learn. If you need a place to host Django, a good chunk of the Django documentation is dedicated to discussing how to do that. There's also Heroku and what not as well.
Of course you can include the lib yourself in the project but that's a burden specially with large apps because you get restricted by the number of files you can upload, so adding large libs is not the best world.
https://developers.google.com/appengine/docs/python/tools/li...
If you have few dependencies other than Django, the upgrade from South should be fairly smooth. You essentially start your migrations from scratch: Delete the South ones, let Django re-generate migration 0.
Please make it a lot more modular. Maybe a kickstarter (like South did & Postgres improvement is doing)
P.S. I know there's flask, but it's still a while before it reaches that point for some of us.
There is a small number of ways I could imagine Django being MORE modular.
The ORM/SQLAlchemy is a more difficult issue. To some extent, Django _is_ its ORM, and making that modular is extremely difficult. You can remove the ORM, but you'll obviously lose everything on top of it - admin, migrations, generic views, etc.
I personally believe that while the ORM is not as configurable as SQLAlchemy, that's one of its strengths; having a relatively fixed target makes writing things that rely on it a lot easier (migrations would have been much harder given SQLAlchemy as a base, for example).
Now, if you want views and middleware too, well that's core Django and you probably want django as well.
What parts of it see too rigid to you?
Flask was written on top of Werkzeug as an example of how to build a "roll-your-own" web framework. It has a few shortcomings, but overall, it's OK and you can contour it to whatever you need done. After all, if Flask starts to "wear you out," you can always graduate to just Werkzeug.
I think there's an opportunity here for something like this to be built on top of Pyramid, which I've found to have a very extensible API. The main problem with Pyramid is the perception to newcomers - there is more than one way to do it and it doesn't have any opinions on how you should go about doing something. It leaves it up to your imagination. There's a slight trade off here between an opinionated framework and the extensibility of Pyramid.
That's where I think Django shines. It might not have the best templating library, ORM, or routes frameworks. But app developers and library developers know exactly what they have to integrate with. This encourages a better ecosystem.
It's been eight years now and I haven't got worn out. When should I expect that feeling?
https://www.youtube.com/watch?v=aFRH-oHcbn8
slides: https://speakerdeck.com/jacobian/django-minus-django-djangoc...
if you take time to really look into it, it's pretty modular...
EDIT: I need to read things more carefully. My bad. Good job Django.
Most likely I am living in a bubble that making apps same language both sides specially in frameworks like Meteor which revolutionises the workflow is the best way to go.
Please break my bubble and enlighten me why we should still be using these framweworks and not js only alternatives.
I don't mean to start a flame war (or may be I do), I just want my perspective changed. It is sitting pretty stubbornly in my head that meteor like start-to-end pipelined flows are the way to go (read all-sides javascript frameworks).
Advantages to me would be much more mature ORM support (e.g. others are talking about how good the migrations are; there are some cool efforts in js e.g. Knex but they're still very primitive in comparison to what Django can now do automatically), better templating (certainly arguable, but I find none of the js approaches encourage proper separation of markup and logic), and a much more comfortable language for writing business logic in. Python has nowhere near as many "gotchas" as js, and is much more readable for a less-technical domain expert.
For me it's about hitting a balance between readability and brevity and having clear community norms so that other people's code is immediately comprehensible.
There's just Too Many Ways To Do It in javascript.
I'm not interested in language wars, just genuinely curious about your statement.