Commit 7260a162 by Kálmán Viktor

occi: base

parent 00e6d851
...@@ -42,6 +42,7 @@ urlpatterns = patterns( ...@@ -42,6 +42,7 @@ urlpatterns = patterns(
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'^network/', include('network.urls')), url(r'^network/', include('network.urls')),
url(r'^dashboard/', include('dashboard.urls')), url(r'^dashboard/', include('dashboard.urls')),
url(r'^occi/', include('occi.urls')),
url((r'^accounts/reset/(?P<uidb36>[0-9A-Za-z]{1,13})-' url((r'^accounts/reset/(?P<uidb36>[0-9A-Za-z]{1,13})-'
'(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$'), '(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$'),
......
from django.contrib import admin
# Register your models here.
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
# Copyright 2014 Budapest University of Technology and Economics (BME IK)
#
# This file is part of CIRCLE Cloud.
#
# CIRCLE is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# CIRCLE is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with CIRCLE. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from django.conf.urls import url, patterns
from occi.views import QueryInterface
urlpatterns = patterns(
'',
url(r'^-/$', QueryInterface.as_view(), name="occi.query"),
)
from django.http import HttpResponse
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base import View
class QueryInterface(View):
def get(self, request, *args, **kwargs):
response = HttpResponse("Hai!")
response['yo'] = "as"
return response
def post(self, request, *args, **kwargs):
response = HttpResponse(status=501)
return response
@method_decorator(csrf_exempt) # decorator on post method doesn't work
def dispatch(self, *args, **kwargs):
return super(QueryInterface, self).dispatch(*args, **kwargs)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment