Python for Codeigniter developers

So, you use codeigniter and  want to develop something in python ? And you have following things in mind :

1. An MVC framework which has almost zero installation.

2. A framework that behaves quite in the same fashion like Codeigniter.

3. Small footprint

4. Has Similar or even easier libraries than codeigniter.

5. And you want something which works both in Windows/mac/Linux.

You have probably heard of developing web apps using python and python frameworks like django. But the installation on your windows machine or linux machine along with apache is a big headache. You want something short and sweet, something works out of the box.

OKKEYS, the name is web2py – an enterprise web development framework – entirely written in python. If i start to write all good things about it, the post might become really big. So let’s jump into the installing of this framework and see some actions.

Things needed

Python 2.5.2

web2py Framework

Steps :

1. For windows XP, install python 2.5.2 – the .msi package. It’ll probably install in your c:/Python25 directory. Now you have to add 2 environment variables.  Right click “My Computer” -> Properties ->Advanced -> Environment Variables (at the bottom).  Under the “System Variables” double click “Path” and put ;C:\python25;C:\python25\scripts at end of the Variable Value.  For windows users, a restart is sometimes necessary to propagat

For Ubuntu, if you have already installed python latest version which is 3.X, you have to install python 2.5.2. They can run simultanously. So in terminal,

sudo apt-get install python2.5

2. Unzip the folder from you have downloaded http://www.web2py.com/examples/static/web2py_src.zip to some place. May be c:/web2py or in Ubuntu /home/username/web2py [or anything you like ]

3. Now it’s assumed that python runs from command prompt or terminal. To verify type python in command prompt in windows (not in CYGWIN or any Bash Shell) or in terminal in linux. If you get something like this

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on
win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

It means you have successfully installed python. Now from the command prompt go to your web2py directory using cd web2py

4. TIME FOR ACTION!!! Now that you’re into the web2py directory, simply type

python web2py.py

You’ll get a greeting screen and the a screen like this both in windows and linux.


web2py_server

It asks for an admin password. Choose anything simple for the time being and hit “Start Server”. That’s it. A window will open with the web2py admin panel like this.

welcome_1247640873997

Alright, from this point, i think you can start playing with the links and most of the options are self explanatory. Click the links, go deeper and have fun with an easy MVC framwork in Python.

Keep discovering!!

Author's gravatar

Md. Mahbubur Rahman

4 thoughts on “Python for Codeigniter developers

    Author's gravatar

    So, which one do you prefer? CodeIgniter or Web2Py? And why?

    Author's gravatar

    I work with Both, it depends. Like if you don’t have a good budget to host the app in a dedicated server, python is not a good choice. I’ve been doing php for over 10 years and playing with python for 3 years. Web2py definitely gives a good momentum in python development. There are hell lot of things that python can do which php can’t. I remember, there were lot of ocassions when i started (in initial days) python but discontinued because of the server setup, hosting , environment setup, deployment etc. Web2Py removes the entry barriers and takes you straight into the development.

    In plain words, i don’t have to make choice between CI and Web2Py. They both have their own field of implementation.

Your email address will not be published. Required fields are marked *