Example #1
0
from django.conf.urls import include, patterns, url

from mkt.account.views import (AccountView, FeedbackView, FxALoginView,
                               InstalledViewSet, LoginView, LogoutView,
                               NewsletterView, PermissionsView)
from mkt.feed.views import FeedShelfViewSet
from mkt.users import views

drf_patterns = patterns(
    '',
    url('^feedback/$', FeedbackView.as_view(), name='account-feedback'),
    url('^installed/mine/$',
        InstalledViewSet.as_view({'get': 'list'}), name='installed-apps'),
    url('^installed/mine/remove_app/$',
        InstalledViewSet.as_view({'post': 'remove_app'}),
        name='installed-apps-remove'),
    # Native FxA login view.
    url('^login/$', LoginView.as_view(), name='account-login'),
    # Oauth FxA login view.
    url('^fxa-login/$', FxALoginView.as_view(), name='fxa-account-login'),
    url('^logout/$', LogoutView.as_view(), name='account-logout'),
    url('^newsletter/$', NewsletterView.as_view(), name='account-newsletter'),
    url('^permissions/(?P<pk>[^/]+)/$', PermissionsView.as_view(),
        name='account-permissions'),
    url('^settings/(?P<pk>[^/]+)/$', AccountView.as_view(),
        name='account-settings'),
    url(r'^shelves/$', FeedShelfViewSet.as_view(
        {'get': 'mine'}), name='feedshelves-mine'),
)

api_patterns = patterns(
Example #2
0
from django.conf.urls import include, patterns, url

from tastypie.api import Api

from mkt.account.api import InstalledResource
from mkt.account.views import (AccountView, FeedbackView, LoginView,
                               NewsletterView, PermissionsView)


# Account API (old tastypie resources).
account = Api(api_name='account')
account.register(InstalledResource())

# Account API (new DRF views).
drf_patterns = patterns('',
    url('^feedback/', FeedbackView.as_view(), name='account-feedback'),
    url('^login/', LoginView.as_view(), name='account-login'),
    url('^newsletter/', NewsletterView.as_view(), name='account-newsletter'),
    url('^permissions/(?P<pk>[^/]+)/$', PermissionsView.as_view(),
        name='account-permissions'),
    url('^settings/(?P<pk>[^/]+)/$', AccountView.as_view(),
        name='account-settings'),

)

api_patterns = patterns('',
    url('^account/', include(drf_patterns)),
    url('^', include(account.urls)),
)
Example #3
0
from django.conf.urls import include, patterns, url

from mkt.account.views import (
    AccountView,
    FeedbackView,
    InstalledView,
    LoginView,
    LogoutView,
    NewsletterView,
    PermissionsView,
)


drf_patterns = patterns(
    "",
    url("^feedback/$", FeedbackView.as_view(), name="account-feedback"),
    url("^installed/mine/$", InstalledView.as_view(), name="installed-apps"),
    url("^login/$", LoginView.as_view(), name="account-login"),
    url("^logout/$", LogoutView.as_view(), name="account-logout"),
    url("^newsletter/$", NewsletterView.as_view(), name="account-newsletter"),
    url("^permissions/(?P<pk>[^/]+)/$", PermissionsView.as_view(), name="account-permissions"),
    url("^settings/(?P<pk>[^/]+)/$", AccountView.as_view(), name="account-settings"),
)

api_patterns = patterns("", url("^account/", include(drf_patterns)))