Re: [PATCH 1/2] wsgi: Move wsgi file to expected location

2016-03-31 Thread Finucane, Stephen
On 31 Mar 15:50, Damien Lespiau wrote:
> On Fri, Feb 05, 2016 at 05:35:37PM +, Stephen Finucane wrote:
> > Django places a wsgi.py file in the root of each application's
> > directory. Do this, adding a symlink to preserve existing
> > operation for users.
> 
> Even if the commit message mentions a symlink, there isn't one in the
> commit? Seemds like it'd break my migration path at least.
> 
> Also, this commit is not a simple move operation. You are removing the
> addition of a search path for python modules, it'd have been nice to do
> that in a separate patch with an explanation of why it is fine.
> 
> -- 
> Damien

Whoops: so that's a case of judicious use of '--fixup' when a commit
message change was necessary :) I initially set this up as a symlink
but it didn't work, so I generated a 'wsgi.py' file using
'django-admin startproject' and copied that in, keeping only the
header. This is the location where the Django documentation suggests
this file should be placed, and where all automation tooling (be it
Ansible-, Puppet- or Chef-based) seemed to expect to find the file.
This change also makes the PATH unnecessary as the file is now
located in the same directory as the Python modules referenced within.

Hope this explains things,

Stephen
___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork


Re: [PATCH 1/2] wsgi: Move wsgi file to expected location

2016-03-31 Thread Damien Lespiau
On Fri, Feb 05, 2016 at 05:35:37PM +, Stephen Finucane wrote:
> Django places a wsgi.py file in the root of each application's
> directory. Do this, adding a symlink to preserve existing
> operation for users.

Even if the commit message mentions a symlink, there isn't one in the
commit? Seemds like it'd break my migration path at least.

Also, this commit is not a simple move operation. You are removing the
addition of a search path for python modules, it'd have been nice to do
that in a separate patch with an explanation of why it is fine.

-- 
Damien

> Signed-off-by: Stephen Finucane 
> ---
>  lib/apache2/patchwork.wsgi | 19 ---
>  patchwork/wsgi.py  | 31 +++
>  2 files changed, 31 insertions(+), 19 deletions(-)
>  delete mode 100644 lib/apache2/patchwork.wsgi
>  create mode 100644 patchwork/wsgi.py
> 
> diff --git a/lib/apache2/patchwork.wsgi b/lib/apache2/patchwork.wsgi
> deleted file mode 100644
> index efa870b..000
> --- a/lib/apache2/patchwork.wsgi
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -#!/usr/bin/env python
> -# -*- coding: utf-8 -*-
> -#
> -# Apache2 WSGI handler for patchwork
> -#
> -# Copyright © 2010 martin f. krafft 
> -# Released under the GNU General Public License v2 or later.
> -#
> -import os
> -import sys
> -
> -basedir = os.path.join(
> -os.path.dirname(__file__), os.path.pardir, os.path.pardir)
> -sys.path.append(basedir)
> -
> -os.environ['DJANGO_SETTINGS_MODULE'] = 'patchwork.settings.production'
> -
> -from django.core.wsgi import get_wsgi_application
> -application = get_wsgi_application()
> diff --git a/patchwork/wsgi.py b/patchwork/wsgi.py
> new file mode 100644
> index 000..c304830
> --- /dev/null
> +++ b/patchwork/wsgi.py
> @@ -0,0 +1,31 @@
> +#!/usr/bin/env python
> +# -*- coding: utf-8 -*-
> +#
> +# Patchwork - automated patch tracking system
> +# Copyright (C) 2010 Martin F. Krafft 
> +#
> +# 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
> +import sys
> +
> +from django.core.wsgi import get_wsgi_application
> +
> +os.environ['DJANGO_SETTINGS_MODULE'] = 'patchwork.settings.production'
> +
> +application = get_wsgi_application()
> -- 
> 2.0.0
> 
> ___
> Patchwork mailing list
> Patchwork@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork
___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork


Re: [PATCH 1/2] wsgi: Move wsgi file to expected location

2016-02-08 Thread Finucane, Stephen
On 05 Feb 17:35, Stephen Finucane wrote:
> Django places a wsgi.py file in the root of each application's
> directory. Do this, adding a symlink to preserve existing
> operation for users.
> 
> Signed-off-by: Stephen Finucane 

Merged.
___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork


[PATCH 1/2] wsgi: Move wsgi file to expected location

2016-02-05 Thread Stephen Finucane
Django places a wsgi.py file in the root of each application's
directory. Do this, adding a symlink to preserve existing
operation for users.

Signed-off-by: Stephen Finucane 
---
 lib/apache2/patchwork.wsgi | 19 ---
 patchwork/wsgi.py  | 31 +++
 2 files changed, 31 insertions(+), 19 deletions(-)
 delete mode 100644 lib/apache2/patchwork.wsgi
 create mode 100644 patchwork/wsgi.py

diff --git a/lib/apache2/patchwork.wsgi b/lib/apache2/patchwork.wsgi
deleted file mode 100644
index efa870b..000
--- a/lib/apache2/patchwork.wsgi
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# Apache2 WSGI handler for patchwork
-#
-# Copyright © 2010 martin f. krafft 
-# Released under the GNU General Public License v2 or later.
-#
-import os
-import sys
-
-basedir = os.path.join(
-os.path.dirname(__file__), os.path.pardir, os.path.pardir)
-sys.path.append(basedir)
-
-os.environ['DJANGO_SETTINGS_MODULE'] = 'patchwork.settings.production'
-
-from django.core.wsgi import get_wsgi_application
-application = get_wsgi_application()
diff --git a/patchwork/wsgi.py b/patchwork/wsgi.py
new file mode 100644
index 000..c304830
--- /dev/null
+++ b/patchwork/wsgi.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Patchwork - automated patch tracking system
+# Copyright (C) 2010 Martin F. Krafft 
+#
+# 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
+import sys
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'patchwork.settings.production'
+
+application = get_wsgi_application()
-- 
2.0.0

___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork