<commit_before>"""
<Program Name>
  urls.py

<Started>
  October, 2008

<Author>
  <EMAIL>
  <NAME>

<Purpose>
  Dispatches urls to particular view functions for GENI. Defines valid
  url patterns for this application.

  This file is a URLconf (URL configuration) file for the control
  application. It defines a mapping between URLs received by the
  web-server in HTTP requests and view functions that operate on these
  requests.

  See http://docs.djangoproject.com/en/dev/topics/http/urls/?from=olddocs

  The patterns encoded below in urlpatterns are of the form:
  (regexp, view_func, args_dict, url_pattern_name) where:
  regexp:
        regular expression to matching a URL request
  view_func:
        view function called when a match is made
  args_dict:
        extra args dictionary for the view function
  url_pattern_name:
        a shorthand to refer to this pattern when buildling urls from
        templates with the url function see:
        http://docs.djangoproject.com/en/dev/topics/http/urls/?from=olddocs#id2
"""

from django.conf.urls.defaults import *
from django.conf import settings

# the next two lines enable the admin:
from django.contrib import admin
admin.autodiscover()

# this is our global url prefix that must match what Apache uses for
# django's geni application (see /etc/apache2/apache2.conf)
prefix='geni/'


urlpatterns = patterns('',
                       (r'^%s$'%(prefix), 'geni.accounts.views.login_redirect'), #'geni.accounts.views.login'), 
                       (r'^%saccounts/register$'%(prefix), 'geni.accounts.views.register',{},'register'),
                       (r'^%saccounts/login$'%(prefix), 'geni.accounts.views.login',{},'login'), 
                       (r'^%saccounts/logout$'%(prefix), 'django.contrib.auth.views.logout_then_login',{},'logout'),
                       
                       (r'^%scontrol/'%(prefix), include('geni.control.urls')),
                       (r'^%sdownload/'%(prefix), include('geni.download.urls')),
                       
                       # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
                       # to INSTALLED_APPS to enable admin documentation:
                       # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
                       
                       # Uncomment the next line to enable the admin:
                       (r'^%sadmin/(.*)'%(prefix), admin.site.root),
                       (r'^%sadmin_media/(?P<path>.*)$'%(prefix), 'django.views.static.serve', {'document_root': settings.ADMIN_MEDIA_ROOT}),
                       (r'^%smedia/(?P<path>.*)$'%(prefix), 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),                          
)

# used in case of website work/construction
#urlpatterns = patterns('', (r'^%s*'%(prefix), 'geni.control.views.construction', {}, 'construction'))<commit_msg>urls file with url prefix factored out to settings<commit_after>"""
<Program Name>
  urls.py

<Started>
  October, 2008

<Author>
  <EMAIL>
  <NAME>

<Purpose>
  Dispatches urls to particular view functions for GENI. Defines valid
  url patterns for this application.

  This file is a URLconf (URL configuration) file for the control
  application. It defines a mapping between URLs received by the
  web-server in HTTP requests and view functions that operate on these
  requests.

  See http://docs.djangoproject.com/en/dev/topics/http/urls/?from=olddocs

  The patterns encoded below in urlpatterns are of the form:
  (regexp, view_func, args_dict, url_pattern_name) where:
  regexp:
        regular expression to matching a URL request
  view_func:
        view function called when a match is made
  args_dict:
        extra args dictionary for the view function
  url_pattern_name:
        a shorthand to refer to this pattern when buildling urls from
        templates with the url function see:
        http://docs.djangoproject.com/en/dev/topics/http/urls/?from=olddocs#id2
"""

from django.conf.urls.defaults import *
from django.conf import settings

# the next two lines enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
                       (r'^%s$'%(settings.URL_PREFIX), 'geni.accounts.views.login_redirect'), #'geni.accounts.views.login'), 
                       (r'^%saccounts/register$'%(settings.URL_PREFIX), 'geni.accounts.views.register',{},'register'),
                       (r'^%saccounts/login$'%(settings.URL_PREFIX), 'geni.accounts.views.login',{},'login'), 
                       (r'^%saccounts/logout$'%(settings.URL_PREFIX), 'django.contrib.auth.views.logout_then_login',{},'logout'),
                       
                       (r'^%scontrol/'%(settings.URL_PREFIX), include('geni.control.urls')),
                       (r'^%sdownload/'%(settings.URL_PREFIX), include('geni.download.urls')),
                       
                       # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
                       # to INSTALLED_APPS to enable admin documentation:
                       # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
                       
                       # Uncomment the next line to enable the admin:
                       (r'^%sadmin/(.*)'%(settings.URL_PREFIX), admin.site.root),
                       (r'^%sadmin_media/(?P<path>.*)$'%(settings.URL_PREFIX), 'django.views.static.serve', {'document_root': settings.ADMIN_MEDIA_ROOT}),
                       (r'^%smedia/(?P<path>.*)$'%(settings.URL_PREFIX), 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),                          
)

# used in case of website work/construction
#urlpatterns = patterns('', (r'^%s*'%(settings.URL_PREFIX), 'geni.control.views.construction', {}, 'construction'))
{'fraction_non_alphanumeric': 0.12755364806866953, 'fraction_numerical': 0.0020600858369098714, 'mean_word_length': 2.594077729796422, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1307028', 'n_tokens_mistral': 1762, 'n_tokens_neox': 1652, 'n_words': 424}