[work] patchwork: support wsgi

Submitted by changqing.li@windriver.com on Dec. 18, 2018, 8:52 a.m. | Patch ID: 157238

Details

Message ID 1545123127-430878-1-git-send-email-changqing.li@windriver.com
State New
Headers show

Commit Message

changqing.li@windriver.com Dec. 18, 2018, 8:52 a.m.
From: Changqing Li <changqing.li@windriver.com>

provide option of use like nginx + wsgi, this file is backported
from patchwork upstream https://github.com/getpatchwork/patchwork

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 patchwork/wsgi.py | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 patchwork/wsgi.py

Patch hide | download patch | download mbox

diff --git a/patchwork/wsgi.py b/patchwork/wsgi.py
new file mode 100644
index 0000000..714ea12
--- /dev/null
+++ b/patchwork/wsgi.py
@@ -0,0 +1,30 @@ 
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Patchwork - automated patch tracking system
+# Copyright (C) 2010 Martin F. Krafft <madduck@madduck.net>
+#
+# This file is part of the Patchwork package.
+#
+# Patchwork is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# Patchwork is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Patchwork; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Released under the GNU General Public License v2 or later.
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'patchwork.settings.production'
+
+application = get_wsgi_application()