Forums

Getting Roundup working on PAW

Hi All,

I have been trying to find out how to get various wsgi capable applications embedded into a site using pythonpaste, and so far not found the way to do it.

My current attempt is to get roundup happy.

Granted I am not intimate with WSGI, but if someone could point me in the right place to get started with this, I'd be much obliged.

Cheers

Craig

Hey barnsey,

Is roundup a WSGI application? It looks like it might be. If so, you just need to create a PythonAnywhere web app. Edit the wsgi.py file for it, load roundup, and create an application object for our WSGI server to use. This stackoverflow answer says it looks something like this:

from roundup.cgi.wsgi_handler import RequestDispatcher
tracker_home = '/home/barnsey/roundup/support' 
application = RequestDispatcher(tracker_home)

Hi hansel,

Thanks for getting back, yes, it is wsgi capable, and that part is documented in the roundup docs.

What I am doing is use paste to create a composite application embedding roundup in my site.

I have managed to get this working now as follows.

I create a module that will provide the application in wsgi_apps.py

from roundup.cgi.wsgi_handler import RequestDispatcher

roundup_app = RequestDispatcher('/home/barnsey/sites/helpdesk/')

def roundup_factory(global_config, **local_config):
    return roundup_app

This needs to be in your PYTHONPATH

in my wsgi.py file I have

from paste.deploy import loadapp
application = loadapp('config:/home/barnsey/sites/test.ini')

and finally /home/barnsey/sites/test.ini

[composite:main]
use = egg:Paste#urlmap
/ = home
/helpdesk = roundup

[app:home]
use = egg:Paste#static
document_root = %(here)s/www/output

[app:roundup]
paste.app_factory = wsgi_apps:roundup_factory

Using sqlite it seems happy, now to sort out postgresql, unfortunately the initialisation tool for roundup wants to create a database from scratch, and PAW wont have it...

I have exported the sqlite database and imported it to postgresql using roundup-admin.

Now on to Tryton ;D

Glad you got it working Barnsey. And thanks for documenting it here as well.