Commit 8c8df665 authored by Aaron R Poulter-martinez's avatar Aaron R Poulter-martinez

Merge branch 'mason-today-web-v2' of git.gmu.edu:srct/mason-today-web into mason-today-web-v2

parents ef226972 52be2267
Pipeline #3101 failed with stages
in 1 minute and 12 seconds
......@@ -10,7 +10,7 @@
<p>
You can check out the following avenues for accessing the events happening on campus:
<ul>
<li>Get Connected: <a href="/api/rawdata">masontoday.gmu.io/api/rawdata</a></li>
<li><a href="{% url 'rawdata' %}">All events, unsorted</a></li>
</ul>
</p>
<p>
......
......@@ -10,8 +10,6 @@ def apiwelcome(request):
return render(request, 'api/apiwelcome.html')
def rawdata(request):
if Event.objects.all() == False:
return HttpResponse("There are no events! --DEBUG")
eventlist = []
for event in Event.objects.all():
eventlist.append({
......@@ -23,4 +21,5 @@ def rawdata(request):
'dayofweek': event.dayofweek,
'duration': event.duration
})
return HttpResponse(json.dumps(eventlist, ensure_ascii=False), content_type="application/json")
\ No newline at end of file
return HttpResponse(json.dumps(eventlist, ensure_ascii=False),
content_type="application/json")
\ No newline at end of file
......@@ -55,7 +55,10 @@ ROOT_URLCONF = 'mason_today_web.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [
os.path.join(BASE_DIR,
'mason_today_web/templates/mason_today_web'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......
<!DOCTYPE html>
<html>
<head>Welcome to MasonToday!</head>
<body>
<p>Take a li'l look around. Ain't the whitespace purty?</p>
<p>We don't have much, but you should go check out these fun things:
<ul>
<li><a href="{% url 'apiwelcome' %}">The MasonToday API</a></li>
</ul>
</p>
<p>Well you should know that this piece of art was made by Student Run Computing and Technology from GMU. Check out the source code over at <a href='git.gmu.edu/srct/mason-today-web'>git.gmu.edu/srct/mason-today-web</a></p>
</body>
</html>
\ No newline at end of file
......@@ -16,7 +16,10 @@ Including another URLconf
from django.contrib import admin
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.homepage, name='homepage'),
path('admin/', admin.site.urls),
path('api/', include('api.urls')),
]
from django.shortcuts import render
# Create some views
def homepage(request):
return render(request, 'homepage.html')
\ No newline at end of file
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 to comment