Live data from Hacker News

Django 1.9 Released

djangoproject.com

61–70 of 91 posts

Re: Django 1.9 Released

#61

Not looking to start a fanboy-war here; but i would like to hear some opinions. If you were to start a new small to medium sized web app today, would choose Ruby on Rails or Django?

If you like Ruby, Rails. If you like Python, Django. Both are full featured with active communities. The 10,000ft view of each is very similar.

I mostly agree. At this point they are both excellent frameworks with all similar features. Django has a really nice admin out of the box that some people love.

Rails is built with a "convention over configuration" philosophy. Rails apps tend to look similar whereas Django apps tend to be setup in a number of different ways. The downside of Rail's "convention over configuration" setup is that devs can get things up and running fast and then get frustrated and lost if something breaks....but it's really not that hard to dig around the code. With Django new devs get lost first and figure everything out. After a few months of heavy use and breaking things you won't notice much of a difference between the two. I find rails a bit easier to work with but I like python so I use django/flask.

Re: Django 1.9 Released

#62

Earlier quoted context omitted.

Do you mean that usernames/emails aren't normalised to a single case to prevent "duplicates" of "jarshwah" and "Jarshwah"? If so, this was recently brought up on the mailing list: https://groups.google.com/forum/#!topic/django-developers/SW... I agree this should probably have a solution or at least documentation to be wary of.

Yeah, I actually hadn't seen that, but I know there are also longstanding tickets for this. I actually don't like the solutions in those threads, I think better to just add an extra field to the models, so have something like 'db_email' and 'display_email'. I realize you can do this with a functional index or whatever, but I think that's actually kind of hacky given the lack of ORM support for functional indexes. My…

FWIW I agree the solutions in that thread aren't good enough, especially since most of them are postgres specific. Now that migrations can be shipped with contrib.auth, a better solution might be possible.

I'd probably prefer a functional unique index since it would be easier to maintain (rather than duplicate fields). We just need to get expression support into indexes.

Re: Django 1.9 Released

#63

Not looking to start a fanboy-war here; but i would like to hear some opinions. If you were to start a new small to medium sized web app today, would choose Ruby on Rails or Django?

Neither, I would choose Elixir with Phoenix Framework

Re: Django 1.9 Released

#64
post #40

Not looking to start a fanboy-war here; but i would like to hear some opinions. If you were to start a new small to medium sized web app today, would choose Ruby on Rails or Django?

I'm shocked, frankly, at how lousy both are out-of-the-box. I just don't get why a simple CRUD app (which many/most apps are) has to be so difficult. I had trouble figuring out how to do email login on Django and just gave up. At first, Rails seems like it's going to be a lot better. I don't care for generating files. Don't like TDD. And found the migrations very confusing (if I make a typo in a field name, I delete…

I've been using only email-based auto for years with Django. It's fully supported and very easy to use[1].

1. https://docs.djangoproject.com/en/1.9/topics/auth/customizin...

Re: Django 1.9 Released

#65
post #40

Earlier quoted context omitted.

I'm shocked, frankly, at how lousy both are out-of-the-box. I just don't get why a simple CRUD app (which many/most apps are) has to be so difficult. I had trouble figuring out how to do email login on Django and just gave up. At first, Rails seems like it's going to be a lot better. I don't care for generating files. Don't like TDD. And found the migrations very confusing (if I make a typo in a field name, I delete…

I've been using only email-based auto for years with Django. It's fully supported and very easy to use[1]. 1. https://docs.djangoproject.com/en/1.9/topics/auth/customizin...

So that's it? I've never seen that before. Everything I saw seemed more complicated from installing various auth addons to multi-file edits and finger-crossing.

And I don't see how assertions like this can be made: "This will usually be a username of some kind, but it can also be an email address"

Except for HN, Twitter & Reddit, are there any services that don't use email for login?

Re: Django 1.9 Released

#66
post #65

Earlier quoted context omitted.

I've been using only email-based auto for years with Django. It's fully supported and very easy to use[1]. 1. https://docs.djangoproject.com/en/1.9/topics/auth/customizin...

So that's it? I've never seen that before. Everything I saw seemed more complicated from installing various auth addons to multi-file edits and finger-crossing. And I don't see how assertions like this can be made: "This will usually be a username of some kind, but it can also be an email address" Except for HN, Twitter & Reddit, are there any services that don't use email for login?

> Except for HN, Twitter & Reddit, are there any services that don't use email for login?

I guess sites that use the username as a form of identity within a site. Email address usernames are just identifiers and contact information, without really being linked to an identity.

I would think if auth was being written from scratch it'd probably default to email based usernames. That ship has sailed though.

Re: Django 1.9 Released

#67
post #40

Earlier quoted context omitted.

I'm shocked, frankly, at how lousy both are out-of-the-box. I just don't get why a simple CRUD app (which many/most apps are) has to be so difficult. I had trouble figuring out how to do email login on Django and just gave up. At first, Rails seems like it's going to be a lot better. I don't care for generating files. Don't like TDD. And found the migrations very confusing (if I make a typo in a field name, I delete…

Unfortunately it looks like you hit a bit of a sore spot with regards to django auth. There isn't a good out of the box solution for email based usernames. There are patterns available, and the "swappable" user framework is there to allow email based usernames. But an email based model isn't available. I'm fairly sure there are tickets or ideas to make this happen, but we're not there yet. Django really is quick and…

It's comforting to know that I'm not the only one who struggled to get email-based authentication working in Django. It had me feeling totally incompentent a few weeks ago and I ended up implementing something very hackish to set the username equal to the email address.

Re: Django 1.9 Released

#68
post #65

Earlier quoted context omitted.

So that's it? I've never seen that before. Everything I saw seemed more complicated from installing various auth addons to multi-file edits and finger-crossing. And I don't see how assertions like this can be made: "This will usually be a username of some kind, but it can also be an email address" Except for HN, Twitter & Reddit, are there any services that don't use email for login?

> Except for HN, Twitter & Reddit, are there any services that don't use email for login? I guess sites that use the username as a form of identity within a site. Email address usernames are just identifiers and contact information, without really being linked to an identity. I would think if auth was being written from scratch it'd probably default to email based usernames. That ship has sailed though.

But it shouldn't have sailed. Frameworks need to keep up with the times. That should be a benefit of frameworks. Should be possible while preserving backwards compatibility.

Re: Django 1.9 Released

#70
post #54

Earlier quoted context omitted.

Unfortunately it looks like you hit a bit of a sore spot with regards to django auth. There isn't a good out of the box solution for email based usernames. There are patterns available, and the "swappable" user framework is there to allow email based usernames. But an email based model isn't available. I'm fairly sure there are tickets or ideas to make this happen, but we're not there yet. Django really is quick and…

Do you know how well cookiecutter-django [0] handles email logins? I've been meaning to play around with cookiecutter, but I haven't started a new project recently. Cookiecutter uses django-allauth [1], which seems to offer email login methods, from what I see in a cursory look at the docs [2]. [0] - https://github.com/pydanny/cookiecutter-django [1] - https://github.com/pennersr/django-allauth [2] - http://django-al…

I asked pydanny on twitter and he says yes, thanks to django-allauth. Requires a setting in your settings.py file and it should just work.
Post reply on HN