|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
from django.conf.urls.defaults import *
|
|
|
|
|
from piston.resource import Resource
|
|
|
|
|
from piston.authentication import HttpBasicAuthentication
|
|
|
|
|
from api2.authentication import DjangoAuthentication, MultiAuthentication
|
|
|
|
|
from api2.handlers import *
|
|
|
|
|
|
|
|
|
|
# taken from
|
|
|
|
@ -10,8 +11,11 @@ class CsrfExemptResource( Resource ):
|
|
|
|
|
super( CsrfExemptResource, self ).__init__( handler, authentication )
|
|
|
|
|
self.csrf_exempt = getattr( self.handler, 'csrf_exempt', True )
|
|
|
|
|
|
|
|
|
|
auth = HttpBasicAuthentication(realm="Freitagsrundenkassensystemapi")
|
|
|
|
|
ad = {'authentication': auth}
|
|
|
|
|
# build authenticatiooors
|
|
|
|
|
basicAuth = HttpBasicAuthentication(realm="Freitagsrundenkassensystemapi")
|
|
|
|
|
djangoAuth = DjangoAuthentication()
|
|
|
|
|
multiAuth = MultiAuthentication([basicAuth, djangoAuth])
|
|
|
|
|
ad = {'authentication': multiAuth}
|
|
|
|
|
|
|
|
|
|
buyableItemRes = CsrfExemptResource(handler=BuyableItemHandler, **ad)
|
|
|
|
|
buyableTypeRes = CsrfExemptResource(handler=BuyableTypeHandler, **ad)
|
|
|
|
|