mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-11 05:17:55 +03:00
fixed urls for dispatchers for django 1.10
This commit is contained in:
parent
4e8b267da5
commit
a499f13e56
@ -53,13 +53,13 @@ def loadModulesUrls():
|
||||
pkgpath = os.path.dirname(sys.modules[modName].__file__)
|
||||
for _, name, _ in pkgutil.iter_modules([pkgpath]):
|
||||
fullModName = '%s.%s.urls' % (modName, name)
|
||||
mod = __import__(fullModName, globals(), locals(), ['urlpatterns'], -1)
|
||||
try:
|
||||
mod = __import__(fullModName, globals(), locals(), ['urlpatterns'], -1)
|
||||
patterns += mod.urlpatterns
|
||||
except:
|
||||
logger.info('Module {0} has no url patterns'.format(mod))
|
||||
logger.exception('Loading patterns')
|
||||
except Exception, e:
|
||||
logger.debug(e)
|
||||
logger.exception('Processing dispatchers loading')
|
||||
pass
|
||||
|
||||
return patterns
|
||||
|
@ -40,7 +40,11 @@ def __init__():
|
||||
# Dinamycally import children of this package. The __init__.py files must register, if needed, inside ServiceProviderFactory
|
||||
pkgpath = os.path.dirname(sys.modules[__name__].__file__)
|
||||
for _, name, _ in pkgutil.iter_modules([pkgpath]):
|
||||
__import__(name, globals(), locals(), [], -1)
|
||||
try:
|
||||
logger.info('Loading dispatcher {}'.format(name))
|
||||
__import__(name, globals(), locals(), [], -1)
|
||||
except:
|
||||
logger.exception('Loading dispatcher {}'.format(name))
|
||||
|
||||
logger.debug('Dispatchers initialized')
|
||||
|
||||
|
@ -32,9 +32,9 @@
|
||||
'''
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import patterns
|
||||
from django.conf.urls import url
|
||||
from .views import guacamole
|
||||
|
||||
|
||||
urlpatterns = patterns(__package__,
|
||||
(r'^guacamole/(?P<tunnelId>.+)$', 'views.guacamole'),
|
||||
)
|
||||
urlpatterns = [
|
||||
url(r'^guacamole/(?P<tunnelId>.+)$', guacamole, name='dispatcher.guacamole'),
|
||||
]
|
||||
|
@ -32,8 +32,9 @@
|
||||
'''
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import patterns
|
||||
from django.conf.urls import url
|
||||
from .views import pam
|
||||
|
||||
urlpatterns = patterns(__package__,
|
||||
(r'^pam$', 'views.pam'),
|
||||
)
|
||||
urlpatterns = [
|
||||
url(r'^pam$', pam, name='dispatcher.pam'),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user