Преглед изворни кода

Code cleanup for Steam API examples

David Leonard пре 10 година
родитељ
комит
3237998300
2 измењених фајлова са 8 додато и 6 уклоњено
  1. 1 1
      hackathon_starter/hackathon/urls.py
  2. 7 5
      hackathon_starter/hackathon/views.py

+ 1 - 1
hackathon_starter/hackathon/urls.py

@@ -9,5 +9,5 @@ urlpatterns = patterns('',
     url(r'^login/$', views.user_login, name='login'),
     url(r'^login/$', views.user_login, name='login'),
     url(r'^logout/$', views.user_logout, name='logout'),
     url(r'^logout/$', views.user_logout, name='logout'),
     url(r'^api/$', views.api_examples, name='api'),
     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.template import RequestContext, loader
 from django.contrib.auth import authenticate, login
 from django.contrib.auth import authenticate, login
 from django.http import HttpResponse, HttpResponseRedirect
 from django.http import HttpResponse, HttpResponseRedirect
-from scripts.SteamAPI import * 
+from scripts.steam import gamesPulling, steamIDPulling 
+
+
 def index(request):
 def index(request):
 	context = {'hello': 'world'}
 	context = {'hello': 'world'}
 	return render(request, 'hackathon/index.html', context)
 	return render(request, 'hackathon/index.html', context)
@@ -105,11 +107,11 @@ def user_logout(request):
     # Take the user back to the homepage.
     # Take the user back to the homepage.
     return HttpResponseRedirect('/hackathon/')
     return HttpResponseRedirect('/hackathon/')
 
 
-def SteamAPI(request):
+def steam(request):
     #Should link to test of Steam API example.
     #Should link to test of Steam API example.
     key = '231E98D442E52B87110816C3D5114A1D'
     key = '231E98D442E52B87110816C3D5114A1D'
     SteamUN = "Marorin"
     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 })