← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~james-w/python-oops-tools/prod-deploy into lp:python-oops-tools

 

James Westby has proposed merging lp:~james-w/python-oops-tools/prod-deploy into lp:python-oops-tools.

Commit message:
Add django_openid_auth.

Our production deployment hacks things such that django_openid_auth is used.
This adds it for real.

In addition it adds the common pattern of allowing a local_settings.py
that overrides values in settings.py so that prod can configure things like
the SSO server and the team mappings.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~james-w/python-oops-tools/prod-deploy/+merge/138571

Hi,

This is a step towards cleaning up the prod deploy.

Currently prod runs non-trunk code as it changes a couple of files
to add openid support.

This branch adds the basic support for openid, and allows for configuration
in prod without having to change versioned files. The commit message
has more rationale about the individual changes.

Thanks,

James
-- 
https://code.launchpad.net/~james-w/python-oops-tools/prod-deploy/+merge/138571
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~james-w/python-oops-tools/prod-deploy into lp:python-oops-tools.
=== modified file 'buildout-templates/src/oopstools/settings.py.in'
--- buildout-templates/src/oopstools/settings.py.in	2012-09-23 00:52:28 +0000
+++ buildout-templates/src/oopstools/settings.py.in	2012-12-06 20:54:25 +0000
@@ -111,8 +111,9 @@
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
+    'django_openid_auth',
     'oopstools.oops',
-    'south'
+    'south',
 )
 
 OOPS_WEB_AMQP_HOST = '${configuration:oops-web-amqp-host}'
@@ -121,3 +122,15 @@
 OOPS_WEB_AMQP_VHOST = '${configuration:oops-web-amqp-vhost}'
 OOPS_WEB_AMQP_EXCHANGE = '${configuration:oops-web-amqp-exchange}'
 OOPS_WEB_AMQP_ROUTING = '${configuration:oops-web-amqp-routing}'
+
+AUTHENTICATION_BACKENDS = (
+    'django.contrib.auth.backends.ModelBackend',
+    'django_openid_auth.auth.OpenIDBackend',
+)
+LOGIN_URL = '/openid/login/'
+LOGIN_REDIRECT_URL = '/admin/'
+
+try:
+    from oopstools.local_settings import *
+except ImportError:
+    pass

=== renamed file 'production.cfg' => 'production.cfg.example'
--- production.cfg	2011-10-13 20:18:51 +0000
+++ production.cfg.example	2012-12-06 20:54:25 +0000
@@ -1,4 +1,5 @@
-# Buildout configuration for the production deployment
+# Example Buildout configuration for a production deployment.
+# Rename the file to production.cfg and fill in the details.
 [buildout]
 extends = buildout.cfg
 

=== modified file 'setup.py'
--- setup.py	2012-09-19 03:44:41 +0000
+++ setup.py	2012-12-06 20:54:25 +0000
@@ -51,6 +51,7 @@
     install_requires=[
         'BeautifulSoup',
         'django',
+        'django_openid_auth',
         'fixtures',
         'launchpadlib',
         'lazr.config',

=== modified file 'src/oopstools/urls.py'
--- src/oopstools/urls.py	2011-10-13 20:18:51 +0000
+++ src/oopstools/urls.py	2012-12-06 20:54:25 +0000
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import patterns, include, url
 from django.conf import settings
 
 # Uncomment the next two lines to enable the admin:
@@ -24,7 +24,7 @@
     # Example:
     # (r'^oopstools/', include('oopstools.foo.urls')),
 
-    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
+    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
     # to INSTALLED_APPS to enable admin documentation:
     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
@@ -39,4 +39,5 @@
     (r'^oops[.py]*/meta$', 'oopstools.oops.views.meta'),
     (r'^oops/static/(?P<path>.*)$', 'django.views.static.serve',
         {'document_root': settings.STATIC_DOC_ROOT}),
+    url(r'^auth/', include('django_openid_auth.urls')),
 )

=== modified file 'versions.cfg'
--- versions.cfg	2012-09-26 07:27:56 +0000
+++ versions.cfg	2012-12-06 20:54:25 +0000
@@ -14,6 +14,7 @@
 Sphinx = 1.0.7
 sqlparse = 0.1.3
 django = 1.3.3
+django-openid-auth = 0.4
 djangorecipe = 1.3
 distribute = 0.6.12
 docutils = 0.6