How I Learnt enough Python/Django to be Dangerous in 1 Month
eddychan.com
eddychan.com
After a few months of working with Python/Django I realized how much else there is to learn and how shitty my first attempts really were. I keep going back over my old scripts every time I learn something new to see if I can improve the code. It's sometimes depressing thinking about how much there is to learn, but the power to create whatever you want is totally worth it!
My advice: stop worrying about being "dangerous", and be bold! Experiment with any wild ideas you have and see if you can figure out a way to implement them in the language as well as (or perhaps even especially) the libraries that are included with the language. When you bring on a "real" programmer, they may want to kill you, but that's how you learn. Plus, if you're really that bad, you probably won't have written enough code to make that programmer's life miserable for long.
What he means by "being dangerous" are things like os.remove(), os.removedirs(), os.chmod(), etc. He wasn't talking about crashing your own Python code, but being able to do dangerous things to the OS you're running it on.
Python's os module is not exempt from permissions - it's obviously "dangerous" if you run the interpeter as root then start doing silly things like passing GET parameters to os.remove() directly... But that, IMHO, is no longer dangerous - that's just stupidity.
Really, there's nothing remotely dangerous about Python - in terms of using import os (excluding the above example which I consider idiocy), it's no more dangerous than elevating to root!?
[EDIT] I would argue that not knowing how something works is more dangerous, but that typically falls under the banner of ignorance.
To screw up is human. To screw up a million times per second takes a computer.
In absolute terms, the two are equivalent. But the capacity for your Python program using os.whatever to unpleasantly surprise you is much greater.
At first I was really scared about modifying other people's code but as I read it through again and again it started making sense and I realized what I needed to change to make it hook into mine.
edit:
Or just using the standard "gets" function really. There's an example on StackOverflow here: http://stackoverflow.com/questions/3026361/performing-simple...
Not saying you're wrong, I was just very surprised by it.
It feels like there are amazing Ruby resources everywhere you turn. I guess I hadn't clued into the Python world enough to notice.
This excellent culture is enabled by Sphinx, which makes it easy to publish documentation as static html content (and pdf and epub). Hosting on python.org and readthedocs.org makes it even easier to put great documentation online, and it is one of the best ways to brand a project as something people can build on.
I would love to the see the author go a step (or maybe multiple steps) further and do some simple scale/performance testing. Essentially, how easy was it to develop and then deploy a Django app into production? What happened when too many requests came in? What did you do to diagnose?
Generally, I would love to see some simple performance measurement baseline to compare experiences with diagnosing and scaling. Like a best practices guide, maybe specific to certain frameworks of where to even begin when you're preparing to deploy an app.
How difficult was it to learn the principles of web development? Did you just learn that in the background as you learned Django?
As for web programming practices i picked up the stuff on cookies, stateless servers, sessions by reading up on django middleware along the way as i started coding the app and had to add things like user registration.
Also thanks for pointing me to Django by Example. I hadn't run into that resource before.
But now I can set up ubuntu server from scratch, and set it to serve django apps. Learned how from this link: http://blog.stannard.net.au/2010/12/11/installing-django-wit... Which is lean enough to get me up quick, but detailed enough to let me follow up and learn what's happening behind the scenes.
I'm building my own model as we speak as well. I have to say, Django is pretty damned awesome. It's worth it for the free admin interface and user system alone. Plus as a bonus I get to continue learning python.
'Django by Example' seems like it's what I've been looking for, surprised I missed it when gathering resources.
Good luck building your app and thanks for sharing, will be keeping watch of your blog!
Nice post. I'm curious how many total hours did you put in during the 4 weeks? Thinking about doing the same but I might have some time off and not sure if you did as well.
Thanks for your time. I also have videos but I want to redo them so they're better. Any insight will help.
http://learnpythonthehardway.org/book/
The same person that did Django by Example also did one for Python:
There are some NumPy tutorials online (and I seem to remember on Github too) which are worth tackling if that's the direction you're going in.
If by the "Google Code Course" you mean the course that is instructed by the guy with the Netscape shirt (Nick Parlante), yes, I would recommend it above the tutorials at python.org for a first round of Python knowledge gathering. Reason being: He brings up a bunch of problems and quirks of Python at the get-go, as well as a bunch of tricks and shortcuts. Overall, I think it's a very well-structured course.
Personally, I think that the tutorial and overall docs at python.org help only when you have most of the basics of Python hammered down. I found myself using them more once I started /getting/ the Pythonic way.
I just skimmed the python.org tutorial for the first time and it reads like the tl:dr version of full reference docs.
However I understand where he is coming from, it reminds me of when I learned Objective C / iPhone. I made a decent (Read:Not Great) game in 3 months of programming in my free time (Das Boot:The Hunt for U-505) The code was ugly and terribly dependent but I made 3k right out of the gate and I still get a deposit of around $50 a month from Apple 3.5 years later!
Objective C feels "easy" now and my code is clean, however it's hard not to be humbled by what you still don't know. I have been doing a lot of Server/Php/JSON/iPhone in my bootstrapping and it's really amazing how far I've come.
The journey of a thousand miles begins with a single step. Keep it up!
There's also the dunning-kruger angle. He doesn't yet know what he doesn't know.