No one can deny that Python is powerful, which is why it is well-loved. You can write a small app very quickly, have it connect to a database or to web APIs. String manipulation is powerful. It’s quick and easy to learn.
To be honest, I was a little apprehensive of it for a long time. First, it seems to be limited in how it can be used in web interfaces out of the box. Printing to Terminal is not a long-term strategy, especially if you’re trying to make something that is user friendly. The backend is one thing, and I am passionate about making things work behind the scenes, but an interface can’t be ignored forever.
When I first started learning PHP, things got interesting. I finally found a way to query a database and output information onto a website. I followed a tutorial on how to set up a development environment for it on the Mac, and it worked well. I found that you could execute a Python script in PHP, but it’s pretty static.
This guy is particularly inspiring. He created his own startup by learning how to code on his own, a step-by-step process that did not happen overnight. With patience and persistence, he realized a personal goal that many people never do. I came across this post while searching for more information on ‘Django’, a web interface that utilizes Python
In a nutshell, this is what Django does: runs a development web server, syncs to a database, stores database structure information/code work, outputs code onto a webpage of your design. I know, I’m missing many technical terms here. You can keep all of the little applets you’ve started to make, as the logic contained within them is important, but by choosing to work within the “Django stack”, you have options to do so much more.
This almost seems like a battle I’ve had with myself for months. I’ve read about Django all the time, but never wanted to commit to an interface for my code work. I wanted to get something quick and dirty, but that’s not always going to be possible. After spending about a month with it, I can say that Django is worth knowing if you’re already loving Python. The developers already made one of the best tutorials that I’ve ever used.
I think the thing to realize here is that it’s just not another thing to learn, it’s really essential to start taking your code and your projects to the next level. While you can and should use MySQLdb and play around with it (especially because Django requires it), you’ll soon outgrow it and wonder what the next step will be.
Django states that you should really start to building a web app from scratch using their platform, and I’m inclined to agree. If you have something small in mind that you want to see from start to finish, you should use their tools to get it done. It builds and maintains your MySQL tables for you, or any other database of your choosing.
If you already have a large database you want to tap into, you can use a command on Django to help you in setting up the models to talk with it. Then, you start adding your logic, and the tables to Django’s admin panel view.
It’s still something that I’m in the process of mastering, so I don’t have a lot of good advice on how to proceed, but it is the next step once you’ve learned how to use Python and MySQLdb successfully.
I can’t speak of Ruby or full PHP development. Certainly websites have been using both for ages. But the flexibility of Python being an extremely easy-to-read and powerful language is something I am naturally drawn to, and will promote for a long time.
Django: A Content Management System?
Then, I was thinking about it. I’m so used to WordPress, but what about switching to a Django-based CMS for my own website? Digging through Google, I found a great one called Mezzanine.
When I went to install it, I found that I needed Xcode. You can grab this with the following Terminal command:
Once installed, there is a simple quick start guide on the front of Mezzanine’s website.
Alternatively, there is Wagtail, which looks a lot better and was built from developers that used Mezzanine. You have to get it working in a special environment that I haven’t figured out yet, but it looks fantastic. One day, it will be plug-and-play just like WordPress is, and when that happens, it will be a big deal.
But it seems that if you’re building your own web app, you want to make your environment yours, so these solutions will not necessarily fit your agenda (unless you want some kind of side blog for your project).
Stay tuned for the final installation of my “Trading in Excel for Good” series, and perhaps a Django-based website some day.