title: Add a prefix to URL patterns
body: <p>I have a Django application that has several entries in URL patterns (<code>urls.py</code>):</p>
  <pre><code>urlpatterns = patterns(
      '',
      # change Language
      (r'^i18n/', include('django.conf.urls.i18n')),
      url('^api/v1/', include(router.urls)),
      url(r'^api-docs/', RedirectView.as_view(url='/api/v1/')),
      url(r'^api/', RedirectView.as_view(url='/api/v1/')),
      url(r'^api/v1', RedirectView.as_view(url='/api/v1/')),
  
      # django default stuff
      url(r'^accounts/', include('main.registration_urls')),
      url(r'^admin/', include(admin.site.urls)),
      url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
  
      # oath2_provider
      url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
  
      # google urls
      url(r'^gauthtest/$',
          'main.google_export.google_oauth2_request',
          name='google-auth'),
      url(r'^gwelcome/$',
          'main.google_export.google_auth_return',
          name='google-auth-welcome'),
  
      # main website views
      url(r'^$', 'main.views.home'),
      url(r'^tutorial/$', 'main.views.tutorial', name='tutorial'),
      url(r'^about-us/$', 'main.views.about_us', name='about-us'),
      url(r'^getting_started/$', 'main.views.getting_started', name='getting_started'),
      url(r'^faq/$', 'main.views.faq', name='faq'),
      url(r'^syntax/$', 'main.views.syntax', name='syntax'),
      url(r'^resources/$', 'main.views.resources', name='resources'),
      url(r'^forms/$', 'main.views.form_gallery', name='forms_list'),
      url(r'^forms/(?P&lt;uuid&gt;[^/]+)$', 'main.views.show'),
      url(r'^people/$', 'main.views.members_list'),
      url(r'^xls2xform/$', 'main.views.xls2xform'),
      url(r'^support/$', 'main.views.support'),
      url(r'^stats/$', 'staff.views.stats'),
      url(r'^login_redirect/$', 'main.views.login_redirect'),
      url(r&quot;^attachment/$&quot;, 'odk_viewer.views.attachment_url'),
      url(r&quot;^attachment/(?P&lt;size&gt;[^/]+)$&quot;, 'odk_viewer.views.attachment_url'),
      url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog',
          {'packages': ('main', 'odk_viewer',)}),
      url(r'^typeahead_usernames', 'main.views.username_list', name='username_list'),
      url(r'^(?P&lt;username&gt;[^/]+)/$', 'main.views.profile', name='user_profile'),
      url(r'^(?P&lt;username&gt;[^/]+)/profile$', 'main.views.public_profile', name='public_profile'),
      url(r'^(?P&lt;username&gt;[^/]+)/settings', 'main.views.profile_settings'),
      url(r'^(?P&lt;username&gt;[^/]+)/cloneform$', 'main.views.clone_xlsform'),
      url(r'^(?P&lt;username&gt;[^/]+)/activity$', 'main.views.activity'),
      url(r'^(?P&lt;username&gt;[^/]+)/activity/api$', 'main.views.activity_api'),
      url(r'^activity/fields$', 'main.views.activity_fields'),
      url(r'^(?P&lt;username&gt;[^/]+)/api-token$', 'main.views.api_token'),
  
      # form specific
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)$', 'main.views.show'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/qrcode$', 'main.views.qrcode', name='get_qrcode'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/api$', 'main.views.api', name='mongo_view_api'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/public_api$', 'main.views.public_api', name='public_api'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/delete_data$', 'main.views.delete_data', name='delete_data'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/edit$', 'main.views.edit'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/perms$', 'main.views.set_perm'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/bamboo$', 'main.views.link_to_bamboo'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/photos', 'main.views.form_photos'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/doc/(?P&lt;data_id&gt;\d+)', 'main.views.download_metadata'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/delete-doc/(?P&lt;data_id&gt;\d+)', 'main.views.delete_metadata'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/formid-media/(?P&lt;data_id&gt;\d+)', 'main.views.download_media_data'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/submission/(?P&lt;uuid&gt;[^/]+)$', 'main.views.show_submission'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/addservice$', 'restservice.views.add_service', name=&quot;add_restservice&quot;),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/delservice$',
          'restservice.views.delete_service', name=&quot;delete_restservice&quot;),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/update$', 'main.views.update_xform'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/preview$', 'main.views.enketo_preview'),
  
      # briefcase api urls
      url(r&quot;^(?P&lt;username&gt;\w+)/view/submissionList$&quot;,
          'odk_logger.views.view_submission_list'),
      url(r&quot;^(?P&lt;username&gt;\w+)/view/downloadSubmission$&quot;,
          'odk_logger.views.view_download_submission'),
      url(r&quot;^(?P&lt;username&gt;\w+)/formUpload$&quot;,
          'odk_logger.views.form_upload'),
      url(r&quot;^(?P&lt;username&gt;\w+)/upload$&quot;,
          'odk_logger.views.form_upload'),
  
      # stats
      url(r&quot;^stats/submissions/$&quot;, 'staff.views.submissions'),
  
      # exporting stuff
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/data\.csv$&quot;, 'odk_viewer.views.data_export', name='csv_export', kwargs={'export_type': 'csv'}),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/data\.xls&quot;, 'odk_viewer.views.data_export', name='xls_export', kwargs={'export_type': 'xls'}),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/data\.csv.zip&quot;, 'odk_viewer.views.data_export', name='csv_zip_export', kwargs={'export_type': 'csv_zip'}),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/data\.kml$&quot;, 'odk_viewer.views.kml_export'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/data\.zip&quot;, 'odk_viewer.views.zip_export'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/gdocs$&quot;, 'odk_viewer.views.google_xls_export'),
      url(r&quot;^odk_viewer/survey/(?P&lt;instance_id&gt;\d+)/$&quot;, 'odk_viewer.views.survey_responses'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/map_embed&quot;, 'odk_viewer.views.map_embed_view'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/map&quot;, 'odk_viewer.views.map_view'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/instance&quot;, 'odk_viewer.views.instance'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/enter-data&quot;, 'odk_logger.views.enter_data', name='enter_data'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/add-submission-with&quot;, 'odk_viewer.views.add_submission_with', name='add_submission_with'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/thank_you_submission&quot;, 'odk_viewer.views.thank_you_submission', name='thank_you_submission'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/edit-data/(?P&lt;data_id&gt;\d+)$&quot;, 'odk_logger.views.edit_data', name='edit_data'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/view-data&quot;, 'odk_viewer.views.data_view'),
      url(r&quot;^(?P&lt;username&gt;\w+)/exports/(?P&lt;id_string&gt;[^/]+)/(?P&lt;export_type&gt;\w+)/new$&quot;, 'odk_viewer.views.create_export'),
      url(r&quot;^(?P&lt;username&gt;\w+)/exports/(?P&lt;id_string&gt;[^/]+)/(?P&lt;export_type&gt;\w+)/delete$&quot;, 'odk_viewer.views.delete_export'),
      url(r&quot;^(?P&lt;username&gt;\w+)/exports/(?P&lt;id_string&gt;[^/]+)/(?P&lt;export_type&gt;\w+)/progress$&quot;, 'odk_viewer.views.export_progress'),
      url(r&quot;^(?P&lt;username&gt;\w+)/exports/(?P&lt;id_string&gt;[^/]+)/(?P&lt;export_type&gt;\w+)/$&quot;, 'odk_viewer.views.export_list'),
      url(r&quot;^(?P&lt;username&gt;\w+)/exports/(?P&lt;id_string&gt;[^/]+)/(?P&lt;export_type&gt;\w+)/(?P&lt;filename&gt;[^/]+)$&quot;, 'odk_viewer.views.export_download'),
  
      # odk data urls
      url(r&quot;^submission$&quot;, 'odk_logger.views.submission'),
      url(r&quot;^(?P&lt;username&gt;\w+)/formList$&quot;, 'odk_logger.views.formList'),
      url(r&quot;^(?P&lt;username&gt;\w+)/xformsManifest/(?P&lt;id_string&gt;[^/]+)$&quot;,
          'odk_logger.views.xformsManifest'),
      url(r&quot;^(?P&lt;username&gt;\w+)/submission$&quot;, 'odk_logger.views.submission'),
      url(r&quot;^(?P&lt;username&gt;\w+)/bulk-submission$&quot;, 'odk_logger.views.bulksubmission'),
      url(r&quot;^(?P&lt;username&gt;\w+)/bulk-submission-form$&quot;, 'odk_logger.views.bulksubmission_form'),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/form\.xml$&quot;, 'odk_logger.views.download_xform', name=&quot;download_xform&quot;),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/form\.xls$&quot;, 'odk_logger.views.download_xlsform', name=&quot;download_xlsform&quot;),
      url(r&quot;^(?P&lt;username&gt;\w+)/forms/(?P&lt;id_string&gt;[^/]+)/form\.json&quot;, 'odk_logger.views.download_jsonform', name=&quot;download_jsonform&quot;),
      url(r&quot;^(?P&lt;username&gt;\w+)/delete/(?P&lt;id_string&gt;[^/]+)/$&quot;, 'odk_logger.views.delete_xform'),
      url(r&quot;^(?P&lt;username&gt;\w+)/(?P&lt;id_string&gt;[^/]+)/toggle_downloadable/$&quot;, 'odk_logger.views.toggle_downloadable'),
  
      # SMS support
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/sms_submission/(?P&lt;service&gt;[a-z]+)/?$', 'sms_support.providers.import_submission_for_form', name='sms_submission_form_api'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/sms_submission$', 'sms_support.views.import_submission_for_form', name='sms_submission_form'),
      url(r&quot;^(?P&lt;username&gt;[^/]+)/sms_submission/(?P&lt;service&gt;[a-z]+)/?$&quot;, 'sms_support.providers.import_submission', name='sms_submission_api'),
      url(r'^(?P&lt;username&gt;[^/]+)/forms/(?P&lt;id_string&gt;[^/]+)/sms_multiple_submissions$', 'sms_support.views.import_multiple_submissions_for_form', name='sms_submissions_form'),
      url(r&quot;^(?P&lt;username&gt;[^/]+)/sms_multiple_submissions$&quot;, 'sms_support.views.import_multiple_submissions', name='sms_submissions'),
      url(r&quot;^(?P&lt;username&gt;[^/]+)/sms_submission$&quot;, 'sms_support.views.import_submission', name='sms_submission'),
  
      # static media
      url(r'^static/(?P&lt;path&gt;.*)$', 'django.views.static.serve',
          {'document_root': settings.MEDIA_ROOT}),
      url(r'^media/(?P&lt;path&gt;.*)$', 'django.views.static.serve',
          {'document_root': settings.MEDIA_ROOT}),
      url(r'^favicon\.ico', RedirectView.as_view(url='/static/images/favicon.ico'))
  )
  </code></pre>
  <p>I need to add a prefix to each URL (e.g., <code>/myprefix/</code> ) but instead of adding the prefix to each of entry manually (editing each line) Is it possible to add the prefix through Python code?</p>