示例#1
0
 def handle(self, *args, **options):
     rest.autodiscover()
     text = json.dumps(
         rest.router.get_config(),
         indent=4,
     )
     if options['format'] == "amd":
         text = "define(%s);" % text
     self.stdout.write(text)
示例#2
0
 def handle(self, *args, **options):
     rest.autodiscover()
     text = json.dumps(
         rest.router.get_config(),
         indent=4,
     )
     if options['format'] == "amd":
         text = "define(%s);" % text
     self.stdout.write(text)
示例#3
0
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

from wq.db import rest
rest.autodiscover()

from content.views import DocRedirectView
from content.models import Page, Doc
page_detail = rest.router.get_viewset_for_model(Page).as_view(
    {'get': 'retrieve'}
)
doc_detail = rest.router.get_viewset_for_model(Doc).as_view(
    {'get': 'retrieve'}
)
doc_list = rest.router.get_viewset_for_model(Doc).as_view(
    {'get': 'list'}
)

urlpatterns = patterns('',
    # Special handing for wq.* pages 
    url(r'^(?P<primary_identifiers__slug>wq\.\w+)', page_detail),

    # Versioned documentation
    url(r'^docs/(?P<doc>[^\/]+)/?$', DocRedirectView.as_view()),
    url(r'^([0-9.]+)/docs/(?P<primary_identifiers__slug>[^\/]+)\.(?P<format>[^\/]+)$', doc_detail),
    url(r'^([0-9.]+)/docs/(?P<primary_identifiers__slug>[^\/]+)/?$', doc_detail),
    url(r'^([0-9.]+)/docs/?$', doc_list),

    # Default admin and wq.db routes
示例#4
0
import os
from django.conf.urls.static import static
from django.conf.urls import include, url

from django.contrib import admin

admin.autodiscover()

from wq.db import rest

rest.autodiscover()

from django.conf import settings

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^generate/', include('dmt.urls')),  #thumbnailer
    # Uncomment to enable python-social-auth URLs
    url(r'', include('social.apps.django_app.urls', namespace='social')),
    url(r'^', include(rest.router.urls))
]

if settings.DEBUG_WITH_RUNSERVER:

    # To use django-media-thumbnailer
    # urlpatterns.append(url('^media/', include('dmt.urls')))

    urlpatterns += static('/media/', document_root=settings.MEDIA_ROOT)

    # after building...
    urlpatterns += static('/',