def send_to_user(user, subject, body): if in_dev(): logging.info("Sending email '%s' to '%s'", subject, user.email) sys.stderr.write("Message body: %s\n" % body) return mail.send_mail(sender=_MAILBOT_EMAIL, to=user.email, subject=subject, body=body)
def _push_notify(url_key): url = dbconfig.get(url_key) if not url: msg = 'No value in dbconfig for %r' % url_key if in_dev(): log.warning(msg) else: raise ValueError(msg) resp = urlfetch.fetch(url) log.info('Push response from %r: %s' % (url, resp.status_code)) if resp.status_code != 200: log.error(resp.content) return resp.status_code == 200
def _push_notify(url_key): url = dbconfig.get(url_key) if not url: msg = 'No value in dbconfig for %r' % url_key if in_dev(): log.warning(msg) else: raise ValueError(msg) # A task has 10 minutes to execute. This tells urlfetch to time out after 8 # minutes. deadline = 60 * 8 resp = urlfetch.fetch(url, deadline=deadline) log.info('Push response from %r: %s' % (url, resp.status_code)) if resp.status_code != 200: log.error(resp.content) return resp.status_code == 200
# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Django settings for chirpradio project. import os import sys from common import in_dev IN_DEV = in_dev() DEBUG = IN_DEV # DEBUG = False TEMPLATE_DEBUG = DEBUG ROOT_PATH = os.path.dirname(__file__) ROOT_ABSPATH = os.path.abspath(ROOT_PATH) ADMINS = ( # fixme: make this a CHIRP distribution list maybe? ('Kumar McMillan', '*****@*****.**'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'appengine' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.