summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/views.py31
-rw-r--r--scanneerjammer/urls.py7
2 files changed, 34 insertions, 4 deletions
diff --git a/backend/views.py b/backend/views.py
index 1bd1196..5a6ffd9 100644
--- a/backend/views.py
+++ b/backend/views.py
@@ -3,8 +3,9 @@
from django.contrib import auth
from django.views.decorators.http import require_POST
from django.http import HttpResponse
+from django.http import HttpResponsePermanentRedirect
-API_HEADER = "#@scanjam 0.2\n"
+API_HEADER = '#@scanjam 0.2\n'
def add_cors_headers(response):
""" Setup additional headers for response """
@@ -182,3 +183,31 @@ def api_video_search(request):
form_fields = ['q', 'start', 'limit']
return HttpResponse('Not implemented yet!\n')
+#
+#
+#
+
+def stats(request):
+ """"""
+ pass
+
+def redirect(request):
+ """ Permanent redirect """
+ response = HttpResponsePermanentRedirect(redirect_to='http://scannerjammer.com')
+ response.write('<html>'
+ ' <head>'
+ ' <title>SCANNERJAMMER</title>'
+ ' <meta property="og:title" content="ScannerJammer"/>'
+ ' <meta property="og:type" content="website"/>'
+ ' <meta property="og:url" content="http://scannerjammer.com/"/>'
+ ' <meta property="og:image" content="http://scannerjammer.com/img/plant.gif"/>'
+ ' <meta property="og:site_name" content="ScannerJammer"/>'
+ ' <meta property="og:description" content="Youtube video chat"/>'
+ ' <meta property="fb:admins" content="100001923956223,1709246"/>'
+ ' <meta name="description" content="Youtube video chat" />'
+ ' </head>'
+ ' <body>'
+ ' <a href="http://scannerjammer.com/">SCANNERJAMMER</a>'
+ ' </body>'
+ '</html>')
+ return response
diff --git a/scanneerjammer/urls.py b/scanneerjammer/urls.py
index 9921f38..d027991 100644
--- a/scanneerjammer/urls.py
+++ b/scanneerjammer/urls.py
@@ -9,12 +9,13 @@ urlpatterns = patterns('',
# url(r'^$', 'scanneerjammer.views.home', name='home'),
# url(r'^scanneerjammer/', include('scanneerjammer.foo.urls')),
- # Backend
- url(r'^api/', include('backend.urls')),
-
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
+
+ # Backend
+ url(r'^api/', include('backend.urls')),
+ url(r'.*/', 'backend.views.redirect'),
)