Thomas' Blog Tales of a geek globetrotter

4Feb/120

Run Django from a VM and access it from the host

If you try to run Django development mode from a Virtual Machine and access the website from the host, you need to specify the global IP address in the "runserver" command.

For example if your VM IP address is 192.168.31.128 (in NAT mode):
IP_address_of_the_VM

You should run the server by calling (you can change the port):

python manage.py runserver 192.168.31.128:8000

Run_server_from_VM

Now you need to connect to the website specifying the IP address like that: http://192.168.31.128:8000.

Both from the VM:
Access_server_in_VM

And the Host:
Access_server_from_host

The server running on Linux is much faster than the one running on Windows :)
Filed under: IT, Linux, Programming No Comments
1Dec/110

Package a Python Qt (PySide) application for Windows (.exe)

That's fairly easy to package a Python Qt (PySide) application for Windows (and even easier on Linux with cxfreeze).

Let see two different ways of doing so.

10May/110

Python Qt4 recipe: QSingleApplication (PySide)

Thanks to Renato Filho who helped me in this thread on the Qt Forums, I made a simple QSingleApplication class for PySide that allows you to be sure your program will be started only once.

In addition to start the application only once, we can send the arguments of the later calls of your program to the first (and only remaining) instance.

The following video summarizes the features:

4Apr/117

Python VS Ruby through a concrete GUI example (Qt)

In a previous post, I was justifying my choice to start learning Ruby instead of Python, and in another previous post I was praising QtRuby.

Now it's time to challenge QtRuby (and Ruby in general) with PyQt/PySide (and Python in general).

Due to some reasons, I had to write the same program in both languages.
Thanks to that, I better understood myself the pros and cons of both languages and will try to share my thoughts with you.

A very brief summary would be: Ruby is the winner for programming pleasure and private applications while Python is the winner when it gets serious.
For more information, read the whole post!

22Jan/1113

Quickly build smartphone applications (iPhone, Android, WP7, BB, Symbian) with Rhomobile Rhodes

Yesterday, I had no idea about how to write programs for smartphones such as iPhone, Android, Windows Phone or BlackBerry.
Today, my first application is already running on my Android phone...

As a first attempt to write a mobile application, I just tried to build an application that retrieves the latest news from my school's atom feed and displays it in a native way on a smartphone (Keio University, Graduate School of SDM).
Yesterday, I had absolutely no knowledge about mobile development, except "iPhone is using the ugly Objective-C and Android is using the heavy Java".
Today, the application looks like that...

...is written in pure Ruby and is 100% native on iPhone, Android, Windows Mobile and BlackBerry!
How come?! Thanks to a powerful, light, easy and intuitive mobile framework: Rhodes (from Rhomobile).
Let see in this post how to do that.

Page 1 sur 212