flashingpumpkin's comments

flashingpumpkin | 13 years ago | on: Django Best Practices

I've got to disagree with the chapter about settings files. Instead of maintaining multiple different settings for different environments, make your default settings file pull modifications for each environment from os.environ, e.g.:

  STATIC_URL = os.environ.get('STATIC_URL', '/static/')
This is a lot saner and won't descend into a mess that is keeping multiple settings files around. It's also a lot easier to explain.

flashingpumpkin | 13 years ago | on: Sol — a sunny little homemade virtual machine

I think it's also worth linking to David Beazley's Curious Course on Coroutines and Concurrency [1]. It's exploring the ideas of a task scheduler implemented in Python. This article reminded me of it. It's not a full VM, but about half way into the PDF he goes into quite some detail on how to build a task scheduler modelled after an OS and how it works in an actual OS. Give it a read.

[1] http://www.dabeaz.com/coroutines/

flashingpumpkin | 13 years ago | on: Pyjaco - Python to JavaScript translator.

The issue I had with Pyjamas is that the whole tool-chain and compilation was a bit borked and the documentation a bit vague. After playing around with it for a day I decided it was too cumbersome so I ditched it in the end and tried py2js which Pyjaco is forked from. Mind you that was 2 years ago so a lot might have improved in that time but it convinced me that writing JS in Python is (was) not really feasible.

flashingpumpkin | 14 years ago | on: Pallet, Clojure Dev Ops like Chef and Puppet

I really like that they opted to do everything over SSH in contrast to both Chef and Puppet that need a client/server configuration or at least some of their packages installed locally.

We do all of our deployments with Chef Solo and push our Cookbooks via Fabric over SSH to our servers. Pallet is definitely something to have a deeper look at as I don't like installing more than the bare essentials of what our apps need on our servers for various reasons.

flashingpumpkin | 14 years ago | on: The Facebook Platform Is A Trainwreck

Sigh. I feel your pain. They've deleted the Python SDK unanounced from Github two weeks ago. Not really responsible if you consider there were dozens of watchers and possibly at least as many other sites / projects depending on it. (Also that's ignoring the fact that their docs state 90 days warning period :()

edit Typos, writing on the phone and it's late.

flashingpumpkin | 14 years ago | on: Ask HN: Where is the Django community?

I've got to disagree with you.

It's clumsy, inflexible and restrictive.

Pretty much anything can be swapped out with custom code. Need a custom auth backend? Just write a class. Need custom session backends? Just write a class. Need to customise a certain view of an application? Just override the url. Don't like the ORM? Just use something else. Have special caching needs? Write a backend.

A look at the release notes are full of good things and following them is definitely worth it. Since 1.3 you've got class based views that make it dead easy to create RESTful views for example. There's new logging support, you can have multiple databases with different backends.

The community is pretty much dead.

It's true that there was a lot more blogging happening in the earlier days. I suspect that the community is simply busy building new things - but a look at the CheeseShop shows on any day a healthy amount of new and updated Django components. Right now there are 7 Django projects on the main page.

All my Django projects ended up being a big mess, and I had to undjango my way out of the various restrictions it placed on me.

I'm a big fan of how Django creates structure through its applications. It makes it very easy to build parts of functionality on a plug and play basis and use them across projects.

Django offers a lot of functionality and it can be difficult to pick the right ones being a newcomer. But once you get the hang around applications and repositories and start working with "advanced" Django and Python features and apps like the built in signals, Celery, Fabric, GUnicorn, etc building and deploying apps becomes a breeze.

flashingpumpkin | 15 years ago | on: I love async, but I can't code like this

We've adopted a way that allows us to do basically this:

    mainWindow.menu "File", (err, file)->
        openMenu err, (err, menu)->
            getItem err, "Open", (err, item)->
                click err, item, (err)->
                    getChild err, getChildType("Window"), (err, dialog)->
                        if err? and err instanceof NoFileError
                            # do stuff
                        if err? and err instanceof InvalidClickError
                            # do other stuff
                        if err?
                            throw err
                        # do stuff with dialog if no err
                        
Each function takes as first argument an error and as last a callback. If there's an error, the function just passes the error up the callback stack until it gets dealed with.

    fun = (err, args..., callback)
You can't pull that off if your code is heavily object oriented though:

    mainWindow.menu "File", (err, file)->
        # If mainWindow.menu errors, file is undefined 
        # and the call to openMenu throws an error
        file.openMenu err, (err, menu)-> 
            # ...
Breaking your code/api up with modules instead into classes fixes that.

flashingpumpkin | 16 years ago | on: Ask PG: Please stop the opaque voting policies

Hm yeah. I second that. My votes didn't have an effect on anything for a couple of months now, which is very disappointing when coming across good stories and comments. Voting degraded for me just to keep bookmarks around in my saved stories. :(
page 1