/images/avatar.webp

mrtn.me

Running Django Under Windows With Iis Using Fcgi

Update: The configuration process described in this post can be achieved with only one management command if you install the django-windows-tools application.

Windows is probably not the best production environment for Django but sometimes one doesn’t have the choice. In that case, a few options aleardy exist, most notably the one developed by helicontech that relies on Microsoft’s Web Platform Installer. This solution, which is described here, relies on the installation of a specific native Handler developed by Helicontech.

Using Eclipse Templates to Ease Android Logging

Adding logs to your Android source code is sometimes the only way to really understand what happens , especially in asynchronous situations.

If you are lazy like me, you may insert lazy logs like this one:

  Log.v("#LOOK#", "onStart()");

Instead of having less lazy code like:

public class SomeActivity extends Activity {
    private static final String LOG_TAG = SomeActivity.class
            .getSimpleName();
    private static final int LOG_LEVEL = Log.VERBOSE;
...

    @Override
    public void onStart() {
        if (LOG_LEVEL <= Log.VERBOSE)
            Log.v(LOG_TAG, "onStart()");

But Eclipse can easily help you to avoid this and then the need to clean up your code after debbuging.

Get the Height of the Status Bar in Android

Sometimes in Android, the flexible layout system is not flexible enough and you need to make some computations inside your code. In these computations, you may need to subtract the size of the status bar. Stackoverflow gives you some answers, but they all rely on the fact that te status bar is shown at the time you make your computation. If you are in full screen mode, by having called for instance:

Start a Virtualenv Django Shell From the Linux Desktop

If you are tired to fire a terminal window, cd to your project directory and activate your python virtualenv to get to your Django project, you will find here some tips to improve things a little bit.

This tip is divided in two parts :

  1. First we create a shell startup script that activates the virtualenv, bash completion and cd in the project directory.
  2. Then we create a Linux Desktop Entry file That spawns a console in our environment.

Here you have the startup script:

Checking Google Play Signatures With Django

Google play, formerly known as the Android Market, provides in-app billing in several countries. In the Security and Design page, Google states the following:

If practical, you should perform signature verification on a remote server and not on a device. Implementing the verification process on a server makes it difficult for attackers to break the verification process by reverse engineering your .apk file. If you do offload security processing to a remote server, be sure that the device-server handshake is secure.