This repository has been archived by the owner on Jan 12, 2022. It is now read-only.
forked from fwenzel/secret-squirrel
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:mozilla/secret-squirrel
- Loading branch information
Showing
4 changed files
with
85 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Update script for staging server. Takes care of updating code repo, vendor | ||
# dir, and running DB migrations. | ||
|
||
HERE=`dirname $0` | ||
GIT=`which git` | ||
PYTHON=`which python2.6` | ||
|
||
pushd "$HERE/../" > /dev/null | ||
|
||
# pull actual code | ||
$GIT pull -q origin master | ||
$GIT submodule update --init | ||
|
||
# pull vendor repo | ||
pushd vendor > /dev/null | ||
$GIT pull -q origin master | ||
$GIT submodule update --init | ||
popd > /dev/null | ||
|
||
# Run database migrations. | ||
#$PYTHON vendor/src/schematic/schematic migrations/ | ||
|
||
# Minify assets. | ||
#$PYTHON manage.py compress_assets | ||
|
||
popd > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,40 @@ | ||
import os | ||
import site | ||
from datetime import datetime | ||
|
||
import django.core.handlers.wsgi | ||
os.environ["CELERY_LOADER"] = "django" | ||
|
||
# Remember when mod_wsgi loaded this file so we can track it in nagios. | ||
wsgi_loaded = datetime.now() | ||
|
||
# Add the parent dir to the python path so we can import manage | ||
# Add the main dir to the python path so we can import manage. | ||
wsgidir = os.path.dirname(__file__) | ||
site.addsitedir(os.path.abspath(os.path.join(wsgidir, '../../'))) | ||
site.addsitedir(os.path.abspath(os.path.join(wsgidir, '../'))) | ||
|
||
# manage adds /apps, /lib, and /vendor to the Python path. | ||
import manage | ||
|
||
import django.conf | ||
import django.core.handlers.wsgi | ||
import django.core.management | ||
import django.utils | ||
|
||
# Do validate and activate translations like using `./manage.py runserver`. | ||
# http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html | ||
utility = django.core.management.ManagementUtility() | ||
command = utility.fetch_command('runserver') | ||
command.validate() | ||
|
||
# This is what mod_wsgi runs. | ||
django_app = django.core.handlers.wsgi.WSGIHandler() | ||
|
||
def application(env, start_response): | ||
env['wsgi.loaded'] = wsgi_loaded | ||
return django_app(env, start_response) | ||
|
||
# manage.py adds the `apps` and `lib` directories to the path | ||
ROOT = os.path.abspath(os.path.join(wsgidir, '../')) | ||
ROOT_PACKAGE = os.path.basename(ROOT) | ||
__import__('%s.manage' % ROOT_PACKAGE) | ||
# Uncomment this to figure out what's going on with the mod_wsgi environment. | ||
# def application(env, start_response): | ||
# start_response('200 OK', [('Content-Type', 'text/plain')]) | ||
# return '\n'.join('%r: %r' % item for item in sorted(env.items())) | ||
|
||
# for mod-wsgi | ||
application = django.core.handlers.wsgi.WSGIHandler() | ||
# vim: ft=python |