User:Wenzel/Bouncer:Tuxedo Deployment

From MozillaWiki
Jump to: navigation, search

Deployment hints for Bouncer's Tuxedo Branch

  • Deploying Tuxedo is very similar to what the Zamboni docs describe for AMO.
  • Make a virtualenv, activate it, then easy_install pip.
  • pip install -r requirements.txt
    • MySQL-python can be installed via pip, or globally by installing the pyMySQLdb (?) rpm.
  • Create a file in the tuxedo dir and put the settings into it that you want to change from, here's mine:
$ cat

DEBUG = False

DATABASE_ENGINE = 'mysql'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'mybouncerdb'       # Or path to database file if using sqlite3.
DATABASE_USER = 'fred'              # Not used with sqlite3.
DATABASE_PASSWORD = 'fred'          # Not used with sqlite3.
DATABASE_HOST = 'server'            # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''                  # Set to empty string for default. Not used with sqlite3.

    "init_command": "SET storage_engine=INNODB",

CACHE_BACKEND = 'memcached://'
  • When upgrading from an older version of Bouncer, start off with a copy of the old DB, then follow the steps "Upgrading an older version of Bouncer" in the README.
  • (with DEBUG=True in your settings file, you should now be able to run ./ runserver and see a working web app. You should be able to log in.)
  • Deploy to a web server. The Zamboni docs have some hints about Apache+mod_wsgi.
  • The tuxedo API uses HTTP basic auth. Make sure to enable the mod_wsgi setting that'll pass the HTTP auth credentials on to the application.
  • At the time of writing, these hints don't cover the /media/ and /admin-media/ dirs. Those are not to be served through mod_wsgi, but can be added to the same vhost with mod_alias. See the section about it in Django docs.
    • map /media/ to the tuxedo/media dir, and
    • /admin-media/ to .../the-tuxedo-virtualenv/lib/python2.6/site-packages/django/contrib/admin/media/