]> git.ozlabs.org Git - patchwork/blobdiff - apps/urls.py
bundles: Don't allow slashes in bundle names
[patchwork] / apps / urls.py
index ac22547d3083a1d5f8ff1a9d147845f83f65fc80..4ddef9e15532e864a7cc2a963d60113fea10b45b 100644 (file)
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+import os
+
 from django.conf.urls.defaults import *
-from patchwork.admin import admin_site
+from django.conf import settings
+from django.contrib import admin
+
+admin.autodiscover()
+
+htdocs = os.path.join(settings.ROOT_DIR, 'htdocs')
 
 urlpatterns = patterns('',
     # Example:
     (r'^', include('patchwork.urls')),
 
     # Uncomment this for admin:
-     (r'^admin/(.*)', admin_site.root),
+     (r'^admin/', include(admin.site.urls)),
 
      (r'^css/(?P<path>.*)$', 'django.views.static.serve',
-       {'document_root': '/home/jk/devel/patchwork/pwsite/htdocs/css'}),
+        {'document_root': os.path.join(htdocs, 'css')}),
      (r'^js/(?P<path>.*)$', 'django.views.static.serve',
-       {'document_root': '/home/jk/devel/patchwork/pwsite/htdocs/js'}),
+        {'document_root': os.path.join(htdocs, 'js')}),
      (r'^images/(?P<path>.*)$', 'django.views.static.serve',
-       {'document_root': '/home/jk/devel/patchwork/pwsite/htdocs/images'}),
+        {'document_root': os.path.join(htdocs, 'images')}),
 )
+