2 from django
.conf
.urls
import defaults
5 def generate_patterns(django_name
, gwt_name
):
7 Generates the common URL patterns for the given names
9 @param django_name the full name of the Django application
11 @param gwt_name the name of the GWT project (e.g., AfeClient)
12 @return the common standard and the debug pattern lists, as a tuple
15 pattern_list
= defaults
.patterns(
17 (r
'^rpc/', 'views.handle_rpc'),
18 (r
'^rpc_doc', 'views.rpc_documentation'),
21 debug_pattern_list
= defaults
.patterns('',
23 (r
'^(?P<forward_addr>autotest.*)',
24 'autotest_lib.frontend.afe.views.gwt_forward'),
26 # for GWT compiled files
27 (r
'^client/(?P<path>.*)$', 'django.views.static.serve',
28 {'document_root': os
.path
.join(os
.path
.dirname(__file__
), '..',
29 'frontend', 'client', 'www')}),
30 # redirect / to compiled client
31 (r
'^$', 'django.views.generic.simple.redirect_to',
33 'client/autotest.%(name)s/%(name)s.html' % dict(name
=gwt_name
)}),
36 return (pattern_list
, debug_pattern_list
)