Learning Python – Day 1

Step one: Does my server have python? Yes.

Great, I have python. Now what? I don’t know. I google “python web development”. I click the first link. Python webservers! I have to embed python into apache! Duh!

sudo apt-get install libapache2-mod-python

Now I have mod python running. Two hours later I have a hello world on my development site. That took way too long. I’m annoyed. I start asking people for recommendations. I just want to code! I’m sick of setting up my server. With PHP it’s cake. One call to apt-get install and off you go.

98% of the people I ask recommend Django. So I install django via apt-get install, head over to djangoproject.com, and start reading the tutorials.

Page 1 is pretty straight forward. I do some creation/configuring and create/activate my models. Then I get to play with my models. Django’s ORM is pretty nice. I usually prefer to write all my own SQL, but I could get used to this.

I get to page 2 of the tutorial where they start talking about the automatic admin. I’m shocked. This is amazing. Are frameworks in PHP this awesome? I’ve always used my own PHP framework. I’ll have to check that out. Back to Django.

This admin app is amazing I have to try this with SVO. I go back to page 1 on the tutorial and start following it but with SVO details. I get to page 2 and then import all my data into my newly created tables. I have a fully functioning admin in 10 minutes!

That’s all for day one.


Good: Django, Django’s automatic admin

Bad: Server setup not so easy

Notes:

1. To view the Django development server on a host other than localhost bind it to your server’s IP address

sudo python manage.py runserver 0.0.0.0:8000

Leave a Reply

You must be logged in to post a comment.