Exemple #1
0
from django.conf.urls import include, patterns, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.static import serve
from django.conf import settings
from django.template.loader import add_to_builtins

from freenasUI import freeadmin
from freenasUI.freeadmin.site import site
from freenasUI.freeadmin.middleware import public
from freenasUI.freeadmin.navtree import navtree

handler500 = 'freenasUI.freeadmin.views.server_error'
handler404 = 'freenasUI.freeadmin.views.page_not_found'

navtree.prepare_modelforms()
freeadmin.autodiscover()

add_to_builtins('django.templatetags.i18n')

urlpatterns = patterns(
    '',
    url('^$', site.adminInterface, name="index"),
    (r'^reporting/graphs/(?P<path>.*)', public(serve), {
        'document_root': '/var/db/graphs/'
    }),
    (r'^media/(?P<path>.*)', public(serve), {
        'document_root': settings.MEDIA_ROOT
    }),
    (r'^static/(?P<path>.*)', public(serve), {
        'document_root': os.path.join(settings.HERE, "freeadmin/static")
Exemple #2
0
v1_api.register(AlertResource())
v1_api.register(BootEnvResource())
v1_api.register(DatasetResource())
v1_api.register(DebugResource())
v1_api.register(ConfigFactoryRestoreResource())
v1_api.register(FCPortsResource())
v1_api.register(JsonUserResource())
v1_api.register(JsonGroupResource())
v1_api.register(PermissionResource())
v1_api.register(RebootResource())
v1_api.register(ShutdownResource())
v1_api.register(SnapshotResource())
v1_api.register(VersionResource())
v1_api.register(VolumeImportResource())

navtree.prepare_modelforms()
freeadmin.autodiscover()

urlpatterns = [
    url('^legacy/$', site.adminInterface, name="index"),
    url(r'^legacy/static/(?P<path>.*)',
        public(serve),
        {'document_root': os.path.join(settings.HERE, "freeadmin/static")}),
    url(r'^legacy/dojango/dojo-media/release/[^/]+/(?P<path>.*)$',
        public(serve),
        {'document_root': '/usr/local/www/dojo'}),
    url(r'^legacy/admin/', include(site.urls)),
    url(r'^legacy/jsi18n/', javascript_catalog, name='javascript_catalog'),
    url(r'^plugins/', include('freenasUI.plugins.urls')),
]