Today marked the day where I am took my first steps to expanding my horizons through learning the Python language. A couple of weeks ago, during a meeting at work, a few other developers and I discussed plans to design and develop a new CRM for the company.
The CRM was broken up into three pieces: a database, a web-service, and a front-end. The database piece is to store our data such as: users, tasks, events, and discussions. The web-service piece is for syncing up various web services across some of the online systems the company uses. The front-end part of the CRM is a means to provide a easy interface to enter time, create projects, and display information stored within the database.
Choice to move
My task was to lead a small team in the development of the web-service portion of the CRM. The various programming languages that came across the table were: PHP, Ruby, and Python. The developers of my team, including myself, are all extremely comfortable using PHP—since we use that as our primary go-to language for web development. Though we were comfortable with PHP, we saw this as an opportunity to expand our knowledge and we eventually decided on using Python for this portion of the CRM.
We choose Python over PHP for a couple of reasons. The primary reason we chose Python was because of the scope of the project. The scope calls for parallel processing because the web-service needs to sync data across many web-based applications. The more services that are added to the project, the slower the syncing and processing. Since PHP does not handle forking and threading very nicely, Python seemed to be the optimal choice. The second reason we chose Python was because of the ability to add technologies on the fly. This will be important through the development process.
A part of the web-service piece is to be able to accept and parse webhooks that are passed to it by the web services. Clearly, there had to be a way to serve python files over the internet. Instead of designing a system to accept and serve python files, I came to the conclusion of using the mod_wsgi for Apache combined with CherryPy. To avoid re-inventing the wheel.
Since this was the first time ever considering Python for a web project, I had to overcome the learning curve of installing and setting up wsgi_mod. To some, this may be an easy task, but as a first-timer I had some difficulties.
I did not begin the process by installing it on my own hosted server, instead I wanted to try installing it on my local development. Since MacOSX is my primary development platform I did the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
And there it was…Hello World! was displayed on my screen at
I have not gotten into the installation of CherryPy just yet, but that is a post for another day.