HNHacker News
TopNewBestAskShowJobs

tomchristie

2,252 karma · joined January 31, 2011

submissionscomments
tomchristie··on Flask API – Browsable Web APIs for Flask
The most obvious feature difference is the browsable API.

Flask API also shares the same architecture as the core of Django REST framework, which I think just has a really nice separation of concerns.

Also the interface of `request.data` means is easy to transparently support both JSON and form requests, and the nice content negotiation on responses means it's easy to build services that power both an HTML front-end and an API from the same endpoints.

Right now Flask RESTful is more mature of course, but I've got high hopes for this, and it's been super fun to build so far.

tomchristie··on Flask API – Browsable Web APIs for Flask
> It should be straightforward to use a decorator to protect restricted pages.

Authentication policies will use a similar style to the renderers and parsers (and all of REST framework). You'll be able to set them per-view with a decorator, or set them system-wide in the config. You'll also be able to support multiple authentication policies.

tomchristie··on Announcing Two Scoops of Django 1.6
No, I understand why you might want a digital version. What I don't understand is why you think you're entitled to a digital version. These are two independent authors making their own informed decision about which medium they'd like to publish in. Their work, their choice.
tomchristie··on Announcing Two Scoops of Django 1.6
I don't really understand this point of view. If you'd prefer not to purchase their book then that's cool - but only Audrey and Daniel are in a position to assess if it was worth their effort to publish an ebook or not, surely you can respect their decision not to do so.
tomchristie··on Announcing Two Scoops of Django 1.6
If you want a schema database backed Web App or API then yeah, sure, both Rails & Django are clearly still the most mature and fully featured frameworks. Yes, there's plenty of other interesting things happening, and yes Django is only going to be one part of many in your stack, but it's still got a hell of a lot going for it.
tomchristie··on Adrian and Jacob retiring as Django BDFLs
Absolutely this, yes. Projects need an initial strong voice to set the voice and direction. Once a community forms around that and starts reinforcing that identity the leaders can move into more of a passive maintainer role.
tomchristie··on RJS leaking vulnerability in multiple Rails applications
If you believe you've found a security issue in Django REST framework I suggest raising emailing the security contact as listed here: http://django-rest-framework.org/#security

Having said that, it's worth pointing out that Django REST framework does not return JSONP by default, and although it does for historical reasons include a JSONP renderer, the documentation recommends the use of CORS instead.

tomchristie··on Women's magazines ignore technology and demean women
> How much of Men's magazines column inches are given to tech?

As a rule, shit loads.

tomchristie··on Django 1.6 released
If anyone's interested in pushing that forward a good place to start would be this thread on the django-dev mailing list: https://groups.google.com/forum/#!searchin/django-developers...
tomchristie··on Django 1.6 released
Worth noting that it's an explicit aim of vanilla views to exactly replicate the functionality of Django's GCBVs.

For the docs: "If you believe you've found some behaviour in Django's generic class-based views that can't also be trivially achieved in django-vanilla-views, then please open a ticket, and we'll treat it as a bug."

You shouldn't be losing any flexibility by using it instead of using Django's existing GCBV implementation.

tomchristie··on Django Vanilla Views 1.0 released.
No problem :)
tomchristie··on Django Vanilla Views 1.0 released.
> We should fork django-extra-views and see what we can come up with.

Yup, that'd be interesting. Hopefully you've seen my comment to that effect here: http://django-vanilla-views.org/topics/django-extra-views-co...

tomchristie··on Django Vanilla Views 1.0 released.
Uh, whatcha talking about? It's a standard BSD 2-clause license.

http://opensource.org/licenses/BSD-2-Clause

tomchristie··on Django Vanilla Views 1.0 released.
Hi Andrew, the migration notes cover the removal of `get_form_kwargs()`.

The simple answer here is that you're actually much better off just overriding `get_form()`. It's no more complicated, and it's much more direct and obvious. We can do away with `get_form_kwargs()`, `get_initial()` etc - they're unnecessarily granular.

> you need to know the implementation details to know it's not worth calling super

The simplicity is self re-inforcing here - the implementation is trivial, so it's easy to figure out how to totally override a method if you want too. Of course this doesn't prevent you from using a `super` style if you want to.

tomchristie··on Django Vanilla Views 1.0 released.
Thanks!

The documentation source is markdown.

The styling and documentation building script is custom, and taken from the documentation for Django REST framework.

I'd like to build it into a proper markdown docs tool someday if I can find the time.

tomchristie··on Django Vanilla Views 1.0 released.
> I may not be 100% convinced just yet but I'm willing to try this out and it seems like a definite step in the right direction to me.

Thanks po - that's exactly the kind of response I was hoping for.

tomchristie··on Django Vanilla Views 1.0 released.
I thought the design seemed reasonable at the time, the strict separation of concerns that the mixin classes provide is valid enough.

It's only now that we've been using CBVs for a while that it's become more apparent that they're somewhat over-designed, and can be awkward to get to grips with.

tomchristie··on Django Vanilla Views 1.0 released.
Hiya, I think you've misread the example. The `account` variable doesn't come from anywhere outside the method. It's being instantiated right there.
tomchristie··on Schema migrations merged into Django master
Noted, apologies. 1.6 is in beta and feature frozen, and it's certainly been the plan for a while to target 1.7.

I wouldn't sweat it tho - the 1.5-1.6 cycle has been pretty quick, and I'm sure as soon as the migrations work is ready and tested the Django core team will be pretty eager to push a 1.7 release.

tomchristie··on Schema migrations merged into Django master
It's for 1.7, always has been.
tomchristie··on Lavabit.com owner: 'I could be arrested' for resisting surveillance order
Say what you think and say it loud. If everyone stays quiet, nothing changes.
tomchristie··on GitHub's on your phone
Mostly pretty great, but it'd be nice to see a couple of controls that have now disappeared.

I can't close or reopen issues anymore, which is something that's super useful to be able to do on the go.

Also there's no way to edit files from the mobile view. Again, something I've often found really useful for quick docs fixes, or adding contributors to the credits after merging a pull request.

tomchristie··on DecryptoCat
Nonsense - the article comes across more weakly by taking a personal tone.
tomchristie··on Stellar Wind (code name)
Journalist Glenn Greenwald obtained documents from a leak that confirm the NSA has secretly been requiring Verizon (and presumably the same for other networks) to provide the complete information (location, duration, id) of every single call, national or international, on an ongoing daily basis.

There is no discrimination - this is everybody, all the time.

That's kind of a big deal.

It's also pretty damn brave of whoever leaked the document.

His original article is here...

http://www.guardian.co.uk/world/2013/jun/06/nsa-phone-record...

tomchristie··on Django REST framework 2.3 released: ViewSets and Routers
> Honestly I just got annoyed by the CBV part.

There's a bunch of things in 2.3 that should make working with the CBVs a much more pleasant experience.

* There's no longer any inheritance from Django's GCBV machinery, specifically SingleObjectMixin, and MultipleObjectMixin. The base class was simple enough that it wasn't really necessary. That means no more browsing across multiple codebases, and less class hierarchy to think about.

* Previously there were three base classes, now there's just a single simplified GenericAPIView.

* Several attributes and methods have been moved to pending deprecation or refactored and simplified.

* Using ViewSets means less verbose, repeated view code and easier URL configuration.

Additionally, all the changes are covered by the deprecation policy, so upgrading from 2.2 should be seamless, despite the tweaks to the GCBV implementation.

tomchristie··on Django REST framework 2.3 released: ViewSets and Routers
The ability in 2.3 to use multiple filter backends is partly intended to address queryset permissions adequately. It means you can setup a filter backend to deal with any permissions-based filtering, while still including client-determined field filtering/searching etc...
tomchristie··on Django REST framework 2.3 released: ViewSets and Routers
You might want to take a look at this: https://github.com/mjumbewu/django-rest-framework-gis
tomchristie··on Django REST framework 2.3 released: ViewSets and Routers
Ooops. Fixed now - thank you!
tomchristie··on Django REST framework 2.3 released: ViewSets and Routers
Thanks, appreciated.
tomchristie··on Django REST framework 2.3 released: ViewSets and Routers
Author here...

The boilerplate comment is definitely valid, and is pretty much what this release was intended to address.

We've now introduced ViewSets (an extension of class based views that is similar to Rail's controllers) and Routers, which make it super quick and easy to get your API up and running.

The updated README should give you a good idea how simple the APIs can be now:

https://github.com/tomchristie/django-rest-framework

I get the impression that what TastyPie does really well is convention-over-configuration - making a bunch of really sensible design decisions on your behalf. What (I hope) REST framework does really well is staying close to Django's conventions, and being easy to customize all the way through, plus of course the browseable API. Either way, there's certainly plenty of folks happy with both frameworks.

← PreviousPage 4 of 5Next →