I recently took on a project where I needed to graph some data on a webpage using data I had queried from a database. Since I love Python, I decided to use it to accomplish this task. I went with Flask for serving the webpage and pygal for creating the graphs. In this tutorial, I will show you how to do that too, but without the database logic. Instead, we’ll get weather data from the Weather Underground and graph that. Let’s get started!
Last week I was contacted about a cool sounding book project on Kickstarter: Real Python for Web Development, featuring web2py by Michael Herman. I have to admit that I’m not familiar with Mr. Herman or the person who originally contacted me about the book, but since I enjoy reading Python books and this one sounded interesting, I thought I’d let my readers know about it too. You can support the project yourself if you want. He’s recently added some tutorials for Flask to the book, so you can learn a little about two Python web frameworks!
TurboGears is one of several web frameworks for Python that are available. The most popular by far is Django. Where I work, we chose TurboGears because of its integration with SQLAlchemy which supports composite keys. At that time, Django did not support that feature and I am not sure if it does yet. Anyway, I develop almost exclusively on a Windows box and have found the TurboGears’ documentation on the subject a little confusing. So here’s how I do it.
Note: We’ll be using TurboGears 2.1 in this tutorial Continue reading TurboGears 2: Setting up on Windows
On Thursday, July 1st, we had our July Pyowa meeting. It was hosted by Matt Morrison at the IMT Group’s building in Des Moines, IA. We had our largest attendance ever with a total of 15 men showing up. Tavern Pizza and pop were served, which was also a first…we’ve had pop before, just not any food!
We had two presentations. The first was an around 70 minutes in length and covered introductory materials about Django, a full-stack web framework written in Python. It was given by our host and he also included anecdotes about how his company uses Django and what challenges that has presented him. Next up we had a quick talk about TurboGears, another web framework. TurboGears is actually a collection of various Python modules that have been pieced together, which makes it much more modular than Django. However, Django has a lot more users behind it and there are some definite advantages to having everything builtin. Anyway, the TurboGears presentation covered a group of different web sites (or web applications) that the presenter had created. It was interesting to compare and contrast the two frameworks and see how they differed or stayed the same.
We are currently looking for presenters for our August and September meetings, so if you want to talk about how you’re using Python now, in the past or even what you plan to do with it in the future, let me know by emailing me or in the comments!
Last week, I embarked on an adventure into the world of web application programming. Since my work place uses Python as much as possible and my boss likes TurboGears, I chose it for this endeavor. I have worked through various TurboGears tutorials and thought it looked pretty cool. However, it doesn’t take long to discover that there is a lot of undocumented functionality. In this case, I needed a web application that could access multiple databases. I knew SqlAlchemy could do it and since TG2 uses SqlAlchemy, I figured it would too. In this article you will get to travel down the rabbit hole with me as I explain how I figured it out. Continue reading Using Multiple Databases in TurboGears 2
I received Ayman Hourieh’s Django 1.0 Web Site Development from Packt Publishers a few weeks ago for review. I had worked with Django before when I went through another book on Python web frameworks as well as one of their official tutorials. I had my doubts about this book because it was only 257 pages long and I didn’t think it would be able to teach me much in so few pages.
Continue reading Book Review: Django 1.0 Web Site Development