This has to be at the top in this case, as the environment variable must be set before importing taarifa_backend. Just another example which shows that using environment variables is a bit of a hack