import os, posixpath

import django
from django.conf import settings

if True: #if tuple(map(int, django.get_version().split('.'))) > (1, 4, 0):
    from django.conf.urls import *
else:
    from django.conf.urls.defaults import *
    


from rldjango import common

APP_ADMIN_MEDIA_PREFIX = 'media/'
MCE_URL = 'js/tiny_mce/tiny_mce.js'

handler500 = 'rldjango.common.views.server_error'

urlpatterns = patterns('',
    (r'^admin/([^/]+)/([^/]+)/(.+)/popedit/$', 'rldjango.common.views.specialEdit'),
    (r'^404.html$', 'django.views.defaults.page_not_found'),
    (r'^500.html$', 'rldjango.common.views.server_error'),
)
# Apparently no project is using this, though they should be.  These
# urlpatterns now break at least langham, so I have commented them out -- which
# may also break those projects.
## if settings.DEBUG:
##     urlpatterns += patterns('',
##         (APP_ADMIN_MEDIA_PREFIX+r'(.*)$', 'django.views.static.serve',
##          {'document_root': posixpath.join(os.path.dirname(common.__file__), 'media'), 'show_indexes':True}
##          ),
##     )
