WebFaction
Community site: login faq
0
1

If settings.py ends with this code:

if is_production(): # TODO: how is implemented?
    try:
        from production_settings import *
    except:
        pass

which implementation of is_production() can return True only if the code is running on WebFaction, and not for example on my local box?

asked 26 Feb '12, 20:09

Guandalino
3711318
accept rate: 0%


The host name,

>>> import socket
>>> print socket.gethostname()
webXXX.webfaction.com
...    if socket.gethostname() == 'webXXX.webfaction.com':
permanent link

answered 26 Feb '12, 21:05

johns
5.4k312
accept rate: 23%

edited 26 Feb '12, 21:06

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×32
×11
×5
×4

question asked: 26 Feb '12, 20:09

question was seen: 2,220 times

last updated: 26 Feb '12, 21:06

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM