#1115 Un-comment the content of the wsgi files
Merged 7 years ago by pingou. Opened 7 years ago by pingou.

file modified
+10 -10
@@ -3,21 +3,21 @@ 

  # The three lines below are required to run on EL6 as EL6 has

  # two possible version of python-sqlalchemy and python-jinja2

  # These lines make sure the application uses the correct version.

- #import __main__

- #__main__.__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']

- #import pkg_resources

+ import __main__

+ __main__.__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']

+ import pkg_resources

Note that if you want to run pylint you'll have to force it since it's not *.py :P.

  

- #import os

- ## Set the environment variable pointing to the configuration file

- #os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg'

+ # Set the environment variable pointing to the configuration file

+ import os

+ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg'

  

  

- ## The following is only needed if you did not install pagure

- ## as a python module (for example if you run it from a git clone).

+ # The following is only needed if you did not install pagure

+ # as a python module (for example if you run it from a git clone).

  #import sys

  #sys.path.insert(0, '/path/to/pagure/')

  

  

- ## The most import line to make the wsgi working

- #from pagure.docs_server import APP as application

+ # The most import line to make the wsgi working

+ from pagure.docs_server import APP as application

  #application.debug = True

file modified
+15 -15
@@ -3,26 +3,26 @@ 

  # The three lines below are required to run on EL6 as EL6 has

  # two possible version of python-sqlalchemy and python-jinja2

  # These lines make sure the application uses the correct version.

- #import __main__

- #__main__.__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']

- #import pkg_resources

+ import __main__

+ __main__.__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']

+ import pkg_resources

  

- #import os

- ## Set the environment variable pointing to the configuration file

- #os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg'

+ # Set the environment variable pointing to the configuration file

+ import os

+ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg'

  

- ## Set the environment variable if the tmp folder needs to be moved

- ## Might be necessary to work around bug in libgit2:

- ## refs: https://github.com/libgit2/libgit2/issues/2965

- ## and   https://github.com/libgit2/libgit2/issues/2797

- #os.environ['TEMP'] = '/var/tmp/'

+ # Set the environment variable if the tmp folder needs to be moved

+ # Might be necessary to work around bug in libgit2:

+ # refs: https://github.com/libgit2/libgit2/issues/2965

+ # and   https://github.com/libgit2/libgit2/issues/2797

+ os.environ['TEMP'] = '/var/tmp/'

  

- ## The following is only needed if you did not install pagure

- ## as a python module (for example if you run it from a git clone).

+ # The following is only needed if you did not install pagure

+ # as a python module (for example if you run it from a git clone).

  #import sys

  #sys.path.insert(0, '/path/to/pagure/')

  

  

- ## The most import line to make the wsgi working

- #from pagure import APP as application

+ # The most import line to make the wsgi working

+ from pagure import APP as application

  #application.debug = True

As per the discussion at https://bugzilla.redhat.com/1353862 due to the
way the wsgi files are installed in the spec file, we should not ship
commented out wsgi files as we otherwise run into the risk of breaking
every pagure instance running from the RPMs and using these wsgi files.

rebased

7 years ago

Note that if you want to run pylint you'll have to force it since it's not *.py :P.

Pull-Request has been merged by pingou

7 years ago

Although an alternative solution would be to mark the wsgi file as %config in the spec.

yes I mentioned that in the ticket on bugzilla