from django.conf.urls import url from django.contrib import admin from django.shortcuts import render from m3 import get_app_urlpatterns from app.actions import extSelectData def workspace(request): """ Возвращает view для отображения Рабочего Стола на основе шаблона m3 :param request: :return: """ return render( request, 'm3_workspace.html', context={'debug': settings.DEBUG}, ) urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', workspace), url(r'^data/contenttypes',extSelectData) ] # Собираем шаблоны урлов из app_meta # подключенных приложений urlpatterns.extend(get_app_urlpatterns())
# -*- coding: utf-8 -*- from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from m3 import get_app_urlpatterns from m3_ext import workspace urlpatterns = patterns('', url(r'^$', workspace()), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns() urlpatterns += get_app_urlpatterns()
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response import wsfactory.urls from m3 import get_app_urlpatterns from m3_ext import workspace admin.autodiscover() urlpatterns = patterns( '', url(r'^$', login_required(workspace()), name='desktop'), (r'^accounts/login/$', 'django.contrib.auth.views.login', { 'template_name': 'login.html' }), url(r'^accounts/logout/$', 'main.views.logout_view', name='logout'), (r'^media/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': settings.MEDIA_ROOT }), url(r'^admin/', include(admin.site.urls)), ) urlpatterns += staticfiles_urlpatterns() urlpatterns += get_app_urlpatterns() urlpatterns += wsfactory.urls.urlpatterns
from django.conf.urls import url from django.contrib import admin from django.shortcuts import render from django.conf import settings from m3 import get_app_urlpatterns def workspace(request): """ Возвращает view для отображения Рабочего Стола на основе шаблона m3 """ return render( request, 'm3_workspace.html', context={'debug': settings.DEBUG}, ) urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', workspace), ] # ======================================================= # собираем шаблоны урлов из app_meta подключенных приложений # ======================================================== urlpatterns += tuple(get_app_urlpatterns())