blob: 10d1fe8f751ef8d3f6fc414fedd22dc5850d46d6 [file] [log] [blame]
Tony Mack7130ac32013-03-22 21:58:00 -04001from django.conf.urls import patterns, include, url
2
3# Uncomment the next two lines to enable the admin:
4from django.contrib import admin
Sapan Bhatiadea39432014-06-13 03:10:36 -04005
6# This is the generated API
Scott Bakereeea5472015-02-16 23:46:01 -08007from xosapi import *
Sapan Bhatiadea39432014-06-13 03:10:36 -04008
smbaker7225f722013-10-29 18:33:51 -07009from core.views.legacyapi import LegacyXMLRPC
Scott Bakera60d2742014-05-30 15:10:17 -070010#from core.views.analytics import AnalyticsAjaxView
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040011from core.models import *
Tony Mack7130ac32013-03-22 21:58:00 -040012from rest_framework import generics
Scott Bakera60d2742014-05-30 15:10:17 -070013from core.dashboard.sites import SitePlus
Scott Baker40695e12014-03-13 22:50:45 -070014from django.http import HttpResponseRedirect
Scott Bakerdcc9bee2014-07-13 16:21:38 -070015#from core.xoslib import XOSLibDataView
Tony Mack7130ac32013-03-22 21:58:00 -040016
Siobhan Tullycf04fb62014-01-11 11:25:57 -050017admin.site = SitePlus()
Tony Mack7130ac32013-03-22 21:58:00 -040018admin.autodiscover()
19
Scott Baker40695e12014-03-13 22:50:45 -070020def redirect_to_apache(request):
21 """ bounce a request back to the apache server that is running on the machine """
22 apache_url = "http://%s%s" % (request.META['HOSTNAME'], request.path)
23 return HttpResponseRedirect(apache_url)
24
Tony Mack7130ac32013-03-22 21:58:00 -040025urlpatterns = patterns('',
26 # Examples:
Sapan Bhatiacc9dad82015-01-07 01:19:05 -050027 url(r'^stats', 'core.views.stats.Stats', name='stats'),
Sapan Bhatia8e6f53d2015-01-29 21:05:39 +000028 url(r'^observer', 'core.views.observer.Observer', name='observer'),
29
Scott Baker5e140a32015-01-30 15:41:39 -080030 url(r'^docs/', include('rest_framework_swagger.urls')),
Sapan Bhatiacc9dad82015-01-07 01:19:05 -050031
Tony Mack7130ac32013-03-22 21:58:00 -040032 # Uncomment the admin/doc line below to enable admin documentation:
Siobhan Tullycf04fb62014-01-11 11:25:57 -050033 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Tony Mack7130ac32013-03-22 21:58:00 -040034
35 # Uncomment the next line to enable the admin:
36 url(r'^admin/', include(admin.site.urls)),
Siobhan Tullycf04fb62014-01-11 11:25:57 -050037 url(r'^', include(admin.site.urls)),
38 #url(r'^profile/home', 'core.views.home'),
Tony Mack7130ac32013-03-22 21:58:00 -040039
Scott Bakerdcc9bee2014-07-13 16:21:38 -070040# url(r'^admin/xoslib/(?P<name>\w+)/$', XOSLibDataView.as_view(), name="xoslib"),
41
Scott Bakerf93c26b2014-08-01 14:56:49 -070042 url(r'^xmlrpc/legacyapi/$', 'core.views.legacyapi.LegacyXMLRPC', name='xmlrpc'),
smbakere36a7de2013-10-29 17:25:25 -070043
Scott Bakera60d2742014-05-30 15:10:17 -070044# url(r'^analytics/(?P<name>\w+)/$', AnalyticsAjaxView.as_view(), name="analytics"),
45
Scott Baker40695e12014-03-13 22:50:45 -070046 url(r'^files/', redirect_to_apache),
smbakere36a7de2013-10-29 17:25:25 -070047
Tony Mack7130ac32013-03-22 21:58:00 -040048 #Adding in rest_framework urls
Scott Bakerd3a10122015-02-02 16:23:52 -080049 url(r'^xos/', include('rest_framework.urls', namespace='rest_framework')),
Scott Bakerdcc9bee2014-07-13 16:21:38 -070050
51 # XOSLib rest methods
Scott Baker8ffd7d72014-11-10 15:58:58 -080052 url(r'^xoslib/', include('core.xoslib.methods', namespace='xoslib')),
53 ) + get_REST_patterns()
54