Przeglądaj źródła

Code cleanup for Steam API examples

David Leonard 10 lat temu
rodzic
commit
3237998300

+ 1 - 1
hackathon_starter/hackathon/urls.py

@@ -9,5 +9,5 @@ urlpatterns = patterns('',
     url(r'^login/$', views.user_login, name='login'),
     url(r'^logout/$', views.user_logout, name='logout'),
     url(r'^api/$', views.api_examples, name='api'),
-    url(r'^SteamAPI/$',views.SteamAPI,name='steamAPI')
+    url(r'^steam/$', views.steam, name='steam')
 )

+ 7 - 5
hackathon_starter/hackathon/views.py

@@ -4,7 +4,9 @@ from django.contrib.auth import logout
 from django.template import RequestContext, loader
 from django.contrib.auth import authenticate, login
 from django.http import HttpResponse, HttpResponseRedirect
-from scripts.SteamAPI import * 
+from scripts.steam import gamesPulling, steamIDPulling 
+
+
 def index(request):
 	context = {'hello': 'world'}
 	return render(request, 'hackathon/index.html', context)
@@ -105,11 +107,11 @@ def user_logout(request):
     # Take the user back to the homepage.
     return HttpResponseRedirect('/hackathon/')
 
-def SteamAPI(request):
+def steam(request):
     #Should link to test of Steam API example.
     key = '231E98D442E52B87110816C3D5114A1D'
     SteamUN = "Marorin"
-    steamID = steamIDpulling(SteamUN, key)
-    game = gamespulling(steamID, key)
-    return render(request,'hackathon/SteamAPI.html',{"game": game})
+    steamID = steamIDPulling(SteamUN, key)
+    game = gamesPulling(steamID, key)
+    return render(request,'hackathon/steam.html', {"game": game })