urls.py 2.37 KB
Newer Older
1
'''
Alan Mitchell's avatar
Alan Mitchell committed
2 3 4
URLs for the BMS Application
'''

5
from django.conf.urls import url
Alan Mitchell's avatar
Alan Mitchell committed
6
from django.urls import re_path
7
from . import views
8
from . import views_api_v1
Alan Mitchell's avatar
Alan Mitchell committed
9

10
# Could work on simplifying many of these by using the new "path" function
11
urlpatterns = [
Alan Mitchell's avatar
Alan Mitchell committed
12 13
    re_path(r'^readingdb/reading/(\w+)/store/$', views.store_reading),      # URL to store one reading into database
    re_path(r'^readingdb/reading/store/$', views.store_readings),          # URL to store multiple readings into database
14
    re_path(r'^readingdb/reading/store-things/$', views.store_readings_things),          # URL to store readings from Things Network
Alan Mitchell's avatar
Alan Mitchell committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
    re_path(r'^st8(\w+)/', views.store_reading_old),             # Old URL pattern for storing.  Shouldn't be used for new sensors.
    re_path(r'^readingdb/reading/(\w+)/$', views.get_readings),   # gets all readings for one reading ID.
    re_path(r'^$', views.index, name='index'),
    re_path(r'^reports/$', views.reports, name='reports'),
    re_path(r'^reports/results/$', views.get_report_results),
    re_path(r'^reports/embed/$', views.get_embedded_results), # javascript embedded version of report results
    re_path(r'^custom-reports/$', views.custom_report_list),
    re_path(r'^custom-reports/(.+)$', views.custom_report),
    re_path(r'^show-log/$', views.show_log),
    re_path(r'^group-list/(\d+)/$', views.group_list),
    re_path(r'^bldg-list/(\d+)/(\d+)/$', views.bldg_list),
    re_path(r'^chart-sensor-list/(\d+)/(multi)/$', views.chart_sensor_list),
    re_path(r'^chart-sensor-list/(\d+)/(\d+)/$', views.chart_sensor_list),
    re_path(r'^map-json/$', views.map_json, name='map-json'),
    re_path(r'^training/video/(\w+)/(\d+)/(\d+)/$', views.show_video, name='show-video'),
    re_path(r'^make-store-key/$', views.make_store_key),
    re_path(r'^ecobee-auth/$', views.ecobee_auth),
    re_path(r'^unassigned-sensors/$', views.unassigned_sensors),
    re_path(r'^backup-readings/$', views.backup_reading_db),
34

35
    # Views related to the API, version 1
36
    re_path(r'^api/v1/version/$', views_api_v1.api_version),
Alan Mitchell's avatar
Alan Mitchell committed
37
    re_path(r'^api/v1/readings/(.+)/$', views_api_v1.sensor_readings),
38
    re_path(r'^api/v1/readings/$', views_api_v1.sensor_readings_multiple),
Alan Mitchell's avatar
Alan Mitchell committed
39
    re_path(r'^api/v1/sensors/$', views_api_v1.sensor_list),
40

41
    # catches URLs that don't match the above patterns.  Assumes they give a template name to render.
Alan Mitchell's avatar
Alan Mitchell committed
42
    re_path(r'^([^.]+)/$', views.wildcard, name='wildcard'),
43
]