If you followed this article series until now, I can safely assumed that you have already registered to Openshift and able to use RHC client tool to create a Python application there. If not, you may want to follow the first article here. In Part II of series of this article, I would like to create a solid ground understanding of what the application we built like.
The application that we are going to build, is not just a some kind of Hello World application, a kind of application that serve as a proof of concept only. It will be created as an answer to many employer candidates who are asking, "Okay, I got a Python job for you, but what is your qualifications? Any work samples?". Generally, we start to send them our Curriculum Vitae in form of PDF/DOC with links on them pointing to our work already done/samples. And maybe our public Linked In profile or a less formal page in about.me. But, hey, why not give them an awe experience, by letting them explore our online interractive CV built with Python stack of technologies on top of Openshift ? I bet it will be an amazing experience to our employer candidates...
Now, let's create a concise application features by listing them out here, which are :
- Although I want this application to display my personal CV, I would also like others to signup to the application, have their own URL and lets them populate it with their CV. In this regard, this application will be like http://about.me, where you can have your own URL at http://about.me/<your_name>. This application will have that same behaviour. TIPS : type any name after about.me/ ... it's fun. For example, .. God does exist!
- Upon having their own page, user can populate it with their biography, but will be more toward professional data, such as current employment status, education, technology mastered, github activity, work samples/already done, etc.
In this regard, the application will be more like LinkedIn.
- Visitor of user page, will be able to filter its data based on Technology Mastered. For example, it will make your employer candidate easier in finding what previous work have you done with Python Django?
- User interaction will be designed and implemented as interactive as possible. For example, user page will consisted of series of Technology Mastered tag, that when clicked, user data will be filtered using AJAX request without the need of refreshing the page. An already accepted behaviour as common approach in the current Web 2.0 era.
- User can signup/signing using social media account such as Facebook/Twitter or Gmail.
- PDF version of user page can be downloaded.
Great! We already have a complete list of what our application capable of. It will make us work more focus toward its realization. If you can picture this application features inside your mind, then it's feasible to be built, right? If not, let's follow series of this articles. It will guide you toward it.
Having been able defining our application features, now I will list what technologies to be use, which are:
- Openshift free plan.
With a generous 3 free applications, each with 1GB free space including application code, library/framework and user uploaded file, we can really create a real world application in it.
- Python 2.7
I know that we already have Python 3.x, but up until now, I still want to explore more on 2.x version of the language. To be precise, I want to explore Twisted Framework, which is still using Python 2.x. I think a migration to 3.0 is not going to be hard.
- Python Flask
Flask is fun! It's a micro framework. All your code (view, model, unit test, etc) can be inside one single file. Although at first inception its creator wants Flask to be a really compact framework, but along the way, its supporter create a whole set of extensions that allows one can really create a sophisticated web application. We still able to use Flask as minimum as possible, but if we want, we can use its phletora of extension so that our application can use ORM, secure Login, a better Views management, Open ID, Form Handling and many more! It's quite different in Django approach, where you get all technologies stack wired to Django. In Flask, you can opt to use what stack of technology that you willing to wired to your flask application
Currently, SQLAlchemy maybe the de-facto standard in ORM (Object Relational Mapping) technology for Python application. It has its Flask extension, so you can leverage all of its ORM power. If you still unwilling to learn ORM, and still want to use the old plain SQL query, .. well, you are not alone. At first I also don't think that learning a new layer, ORM, will be beneficial to my career as software developer. But turns out, SQLAlchemy really saves my day. Starting from its schema definition, database creation/migration and database query, all is really intuitive. Sometime I just guest the method that will likely be called by SQLAlchemy... and there it is.
I got to confess something : I am not an expert in layout, design or CSS. If you ask me to design a web from scratch, well, I think I am gonna scratch my head instead. But things changed when Bootstrap came. It is an open source CSS framework that let you build a great Web 2.0 style web application by reusing the already commonly accepted web UI element such as fluid layout, navigation bar, search box, cool button, lightbox, header/footer, etc. Think of Bootstrap as saviour of the CSS soulless creatures like me, then you got the idea...
Now that we already use SQLAlchemy, the real relational database technology that we use is not an important matter anymore. For example we can switch it anytime with SQLite3 or MySQL, and our code will not have any impact whatsoever. But the matter will be different if we try to use a NoSQL approach such as MongoDB or Redis. Yeah, but after all a NoSQL approach really is a _no_sql way, so SQLAlchemy and its related technology will be out of scope if we try to use MongoDB/Redis.
As I already laying out a solid ground for the application and technology about to use, we can move on to start coding for the application. It will be in Part III of this articles...