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.

14Oct/111

Install Google Chrome Web Browser in Ubuntu 11.10 Oneiric Ocelot

Ubuntu 11.10 final is here!

But some of you might be having troubles to install the nonfree google chrome web browser.
To install it, just follow the following steps:

1. Download the deb package on http://www.google.com/chrome
2. Open a command prompt and try to install it: sudo dpkg -i google-chrome-stable_current_amd64.deb

You will have the following normal errors:
Selecting previously deselected package google-chrome-stable.
(Reading database ... 127754 files and directories currently installed.)
Unpacking google-chrome-stable (from .../google-chrome-stable_current_amd64.deb) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
google-chrome-stable depends on libnspr4-0d (>= 4.7.3-0ubuntu1~); however:
Package libnspr4-0d is not installed.
google-chrome-stable depends on libxss1; however:
Package libxss1 is not installed.
google-chrome-stable depends on libcurl3; however:
Package libcurl3 is not installed.
dpkg: error processing google-chrome-stable (--install):
dependency problems - leaving unconfigured
Processing triggers for gnome-menus ...
Processing triggers for desktop-file-utils ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for man-db ...
Errors were encountered while processing:
google-chrome-stable

3. Now just type the following command: sudo apt-get install -f

And Google Chrome will install!

Filed under: IT, Linux 1 Comment
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:

12Apr/110

20 years of Linux

Let celebrate the 20 years of Linux!

Filed under: IT, Linux No Comments
Page 1 sur 41234