from django.conf.urls.defaults import * from settings import here # Databrowse registration: from django.contrib.auth.decorators import login_required from django.contrib import databrowse from django.views.generic.simple import direct_to_template import settings from django.contrib import admin urlpatterns = patterns('', (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'index.html'}), (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'registration/login.html'}), (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'template_name': 'registration/logout.html'}), (r'^locations/$', 'locations.views.index'), (r'^locations/getlocation', 'locations.views.getlocation'), (r'^locations/addlocation', 'locations.views.addlocation'), (r'^locations/search', 'locations.views.search'), (r'^locations/locationdetails', 'locations.views.locationdetails'), (r'^materials/$', 'materials.views.index'), (r'^materials/search$', 'materials.views.search'), (r'^materials/categories$', 'materials.views.categories'), (r'^materials/properties$', 'materials.views.properties'), (r'^materials/compare$', 'materials.views.compare'), (r'^materials/tradenames$', 'materials.views.tradenames'), (r'^materials/tradenames$', 'materials.views.manufacturers'), (r'^objects/$', 'objects.views.index'), (r'^objects/ean_lookup$', 'objects.views.ean_lookup'), (r'^xml/location', 'locations.views.locationtoxml'), (r'^yaml/location', 'locations.views.locationtoyaml'), (r'^xmlrpc/$', 'xmlrpc.views.handle_xmlrpc'), (r'^admin/(.*)', admin.site.root), (r'^databrowse/(.*)', login_required(databrowse.site.root)), ) if settings.DEBUG: urlpatterns += patterns('', (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': here('../media')}),)