Fixed servefiles urls
[bcms.git] / urls.py
blobcf39a0edc0d5d63d2536ba46271d5ca21b2ed5c2
1 # BC CMS - Content Management System
2 # Copyright (c) 2008, Carlos Daniel Ruvalcaba Valenzuela
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without modification,
6 # are permitted provided that the following conditions are met:
8 # * Redistributions of source code must retain the above copyright notice, this
9 # list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright notice, this
11 # list of conditions and the following disclaimer in the documentation and/or other
12 # materials provided with the distribution.
13 # * Neither the name of the BlackChair Software nor the names of its contributors may be
14 # used to endorse or promote products derived from this software without specific prior
15 # written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23 # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
24 # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 import os
28 from django.conf.urls.defaults import *
29 from django.conf import settings
31 urls = [
32 (r'login', 'django.contrib.auth.views.login',{'template_name': 'login.html'}),
33 (r'logout', 'django.contrib.auth.views.logout',{'template_name': 'master.html'}),
34 (r'^admin/', include('django.contrib.admin.urls')),
35 (r'^', include('bcms.pages.urls')),
38 if settings.SERVE_FILES:
39 APP_ROOT = os.sys.path[0] or os.curdir
40 servefiles = (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(APP_ROOT, 'media')})
41 urls.insert(0, servefiles)
43 urlpatterns = patterns('', *urls)