Selaa lähdekoodia

Rollback, removing comments from views

David Leonard 10 vuotta sitten
commit
5af4bdecb2
40 muutettua tiedostoa jossa 1562 lisäystä ja 0 poistoa
  1. 9 0
      .hgignore
  2. 249 0
      README.md
  3. 20 0
      bower.json
  4. 0 0
      hackathon_starter/hackathon/__init__.py
  5. 5 0
      hackathon_starter/hackathon/admin.py
  6. 11 0
      hackathon_starter/hackathon/forms.py
  7. 0 0
      hackathon_starter/hackathon/migrations/__init__.py
  8. 11 0
      hackathon_starter/hackathon/models.py
  9. 0 0
      hackathon_starter/hackathon/scripts/__init__.py
  10. 179 0
      hackathon_starter/hackathon/scripts/github.py
  11. 24 0
      hackathon_starter/hackathon/scripts/linkedin.py
  12. 29 0
      hackathon_starter/hackathon/scripts/steam.py
  13. 85 0
      hackathon_starter/hackathon/scripts/tumblr.py
  14. 26 0
      hackathon_starter/hackathon/static/css/form.css
  15. BIN
      hackathon_starter/hackathon/static/img/github.png
  16. BIN
      hackathon_starter/hackathon/static/img/linkedin.jpg
  17. BIN
      hackathon_starter/hackathon/static/img/steam.png
  18. BIN
      hackathon_starter/hackathon/static/img/tumblr.png
  19. 16 0
      hackathon_starter/hackathon/templates/hackathon/api_examples.html
  20. 61 0
      hackathon_starter/hackathon/templates/hackathon/base.html
  21. 110 0
      hackathon_starter/hackathon/templates/hackathon/github.html
  22. 14 0
      hackathon_starter/hackathon/templates/hackathon/index.html
  23. 25 0
      hackathon_starter/hackathon/templates/hackathon/linkedin.html
  24. 47 0
      hackathon_starter/hackathon/templates/hackathon/login.html
  25. 40 0
      hackathon_starter/hackathon/templates/hackathon/navbar.html
  26. 42 0
      hackathon_starter/hackathon/templates/hackathon/register.html
  27. 12 0
      hackathon_starter/hackathon/templates/hackathon/steam.html
  28. 61 0
      hackathon_starter/hackathon/templates/hackathon/tumblr.html
  29. 3 0
      hackathon_starter/hackathon/tests.py
  30. 0 0
      hackathon_starter/hackathon/unittests/__init__.py
  31. 8 0
      hackathon_starter/hackathon/unittests/testcase.py
  32. 192 0
      hackathon_starter/hackathon/unittests/testgithub.py
  33. 16 0
      hackathon_starter/hackathon/urls.py
  34. 107 0
      hackathon_starter/hackathon/views.py
  35. 0 0
      hackathon_starter/hackathon_starter/__init__.py
  36. 107 0
      hackathon_starter/hackathon_starter/settings.py
  37. 8 0
      hackathon_starter/hackathon_starter/urls.py
  38. 14 0
      hackathon_starter/hackathon_starter/wsgi.py
  39. 10 0
      hackathon_starter/manage.py
  40. 21 0
      requirements.txt

+ 9 - 0
.hgignore

@@ -0,0 +1,9 @@
+syntax: glob
+
+.DS_Store
+db.sqlite3
+*.pyc
+bower_components/
+migrations/
+*.coverage
+Thumbs.db

+ 249 - 0
README.md

@@ -0,0 +1,249 @@
+Django Hackathon Starter
+------------------------
+
+## What is Django Hackathon Starter
+
+> Django Hackathon Starter aims to be a project which will aggegrate data from several APIs, producing a RESTful API which can be consumed by a client (also intended to be built). 
+
+Our deployment can be found [here](http://django-hackathon-starter.herokuapp.com/hackathon/).
+
+## Running this project
+
+In order to run this project, do the following:
+
+    # Install the requirements
+    pip install -r requirements.txt
+
+    # Perform database migrations
+    python manage.py migrate
+
+    # Run the server
+    python manage.py runserver
+
+## Front End dependencies
+
+This project relies on Bower for all front end libraries, to avoid pushing up large libraries such as `jQuery` and `Bootstrap`. To install `bower`, you will need to install `npm`, which now comes bundled with `node.js`. To install `npm`, simply install [node as follows](https://github.com/joyent/node/wiki/installing-node.js-via-package-manager). 
+
+First, install `bower`:
+
+    npm install -g bower
+
+Then:
+
+    bower install
+
+This will download and extract all the packages listed within `bower.json`. **Under no circumstance should any front-end libraries manually be pushed up to the repository.**
+
+Two routes have currently been set up, which are located at:
+
+    # First test route
+    http://127.0.0.1:8000/hackathon/
+
+    # Second test route
+    http://127.0.0.1:8000/hackathon/test
+
+
+## Testing
+
+This project aims to be as close to 100% tested as possible. For a good guide to testing using Python and `Mock`, `Nosetests` and `Unittests` libraries, please [read here](http://docs.python-guide.org/en/latest/writing/tests/).
+
+To run the tests:
+
+    hackthon-starter $ python manage.py test hackathon/unittests/
+
+You will see an output as shown below:
+
+    Name                                   Stmts   Miss  Cover   Missing
+    --------------------------------------------------------------------
+    hackathon/__init__.py                      0      0   100%
+    hackathon/admin.py                         3      3     0%   1-5
+    hackathon/forms.py                         9      9     0%   1-11
+    hackathon/migrations/0001_initial.py       6      0   100%
+    hackathon/migrations/__init__.py           0      0   100%
+    hackathon/models.py                        6      6     0%   1-11
+    hackathon/scripts/__init__.py              0      0   100%
+    hackathon/scripts/github.py              106     96     9%   17-34, 41-64, 69-97, 102-121, 126-132, 139-165, 169-175
+    hackathon/scripts/linkedin.py             19     19     0%   1-24
+    hackathon/scripts/samplescript.py   NoSource: No source for code: '/Users/DrkSephy/Documents/django-hackathon-starter/hackathon_starter/hackathon/scripts/samplescript.py'.
+    hackathon/scripts/steam.py                15     15     0%   3-29
+    hackathon/scripts/tumblr.py               60     60     0%   1-85
+    hackathon/tests.py                         1      0   100%
+    hackathon/urls.py                          3      3     0%   1-5
+    hackathon/views.py                        76     76     0%   1-157
+    --------------------------------------------------------------------
+    TOTAL                                    304    287     6%
+    ----------------------------------------------------------------------
+    Ran 2 tests in 0.002s
+
+    OK
+    Destroying test database for alias 'default'...
+
+## Code evaluation
+
+In order to write clean code with a consistent style guide, we'll be using `Pylint` to maintain our code. Pylint will display a ton of messages regarding things that should be fixed. A sample output from running `pylint views.py` is shown below:
+
+    (web)λ pylint views.py
+    No config file found, using default configuration
+    ************* Module hackathon.views
+    C:  7, 0: Trailing whitespace (trailing-whitespace)
+    W: 11, 0: Found indentation with tabs instead of spaces (mixed-indentation)
+    W: 12, 0: Found indentation with tabs instead of spaces (mixed-indentation)
+    W: 15, 0: Found indentation with tabs instead of spaces (mixed-indentation)
+    C: 59, 0: Wrong continued indentation.
+                'hackathon/register.html',
+                ^     | (bad-continuation)
+    C: 60, 0: Wrong continued indentation.
+                {'user_form': user_form, 'registered': registered} )
+                ^     | (bad-continuation)
+    C: 60, 0: No space allowed before bracket
+                {'user_form': user_form, 'registered': registered} )
+                                                                   ^ (bad-whitespace)
+    C: 69, 0: Line too long (103/100) (line-too-long)
+    C:116, 0: Exactly one space required after comma
+        return render(request,'hackathon/steam.html', {"game": game })
+                             ^ (bad-whitespace)
+    C:116, 0: No space allowed before bracket
+        return render(request,'hackathon/steam.html', {"game": game })
+                                                                    ^ (bad-whitespace)
+    C:  1, 0: Missing module docstring (missing-docstring)
+    W:  7, 0: Relative import 'scripts.steam', should be 'hackathon.scripts.steam' (relative-import)
+    C: 10, 0: Missing function docstring (missing-docstring)
+    C: 14, 0: Missing function docstring (missing-docstring)
+    W: 14, 9: Unused argument 'request' (unused-argument)
+    C: 17, 0: Missing function docstring (missing-docstring)
+    C: 21, 0: Missing function docstring (missing-docstring)
+    C: 62, 0: Missing function docstring (missing-docstring)
+    C:103, 0: Missing function docstring (missing-docstring)
+    C:110, 0: Missing function docstring (missing-docstring)
+    C:113, 4: Invalid variable name "SteamUN" (invalid-name)
+    C:114, 4: Invalid variable name "steamID" (invalid-name)
+    C:118, 0: Missing function docstring (missing-docstring)
+    W:  4, 0: Unused RequestContext imported from django.template (unused-import)
+    W:  4, 0: Unused loader imported from django.template (unused-import)
+
+
+    Report
+    ======
+    53 statements analysed.
+
+    Statistics by type
+    ------------------
+
+    +---------+-------+-----------+-----------+------------+---------+
+    |type     |number |old number |difference |%documented |%badname |
+    +=========+=======+===========+===========+============+=========+
+    |module   |1      |NC         |NC         |0.00        |0.00     |
+    +---------+-------+-----------+-----------+------------+---------+
+    |class    |0      |NC         |NC         |0           |0        |
+    +---------+-------+-----------+-----------+------------+---------+
+    |method   |0      |NC         |NC         |0           |0        |
+    +---------+-------+-----------+-----------+------------+---------+
+    |function |8      |NC         |NC         |0.00        |0.00     |
+    +---------+-------+-----------+-----------+------------+---------+
+
+
+
+    External dependencies
+    ---------------------
+    ::
+
+        django
+          \-contrib
+          | \-auth (hackathon.views)
+          \-http (hackathon.views)
+          \-shortcuts (hackathon.views)
+          \-template (hackathon.views)
+            \-loader (hackathon.views)
+        hackathon
+          \-forms (hackathon.views)
+          \-scripts
+            \-steam (hackathon.views)
+
+
+
+    Raw metrics
+    -----------
+
+    +----------+-------+------+---------+-----------+
+    |type      |number |%     |previous |difference |
+    +==========+=======+======+=========+===========+
+    |code      |59     |59.00 |NC       |NC         |
+    +----------+-------+------+---------+-----------+
+    |docstring |1      |1.00  |NC       |NC         |
+    +----------+-------+------+---------+-----------+
+    |comment   |29     |29.00 |NC       |NC         |
+    +----------+-------+------+---------+-----------+
+    |empty     |11     |11.00 |NC       |NC         |
+    +----------+-------+------+---------+-----------+
+
+
+
+    Duplication
+    -----------
+
+    +-------------------------+------+---------+-----------+
+    |                         |now   |previous |difference |
+    +=========================+======+=========+===========+
+    |nb duplicated lines      |0     |NC       |NC         |
+    +-------------------------+------+---------+-----------+
+    |percent duplicated lines |0.000 |NC       |NC         |
+    +-------------------------+------+---------+-----------+
+
+
+
+    Messages by category
+    --------------------
+
+    +-----------+-------+---------+-----------+
+    |type       |number |previous |difference |
+    +===========+=======+=========+===========+
+    |convention |18     |NC       |NC         |
+    +-----------+-------+---------+-----------+
+    |refactor   |0      |NC       |NC         |
+    +-----------+-------+---------+-----------+
+    |warning    |7      |NC       |NC         |
+    +-----------+-------+---------+-----------+
+    |error      |0      |NC       |NC         |
+    +-----------+-------+---------+-----------+
+
+
+
+    Messages
+    --------
+
+    +--------------------+------------+
+    |message id          |occurrences |
+    +====================+============+
+    |missing-docstring   |9           |
+    +--------------------+------------+
+    |mixed-indentation   |3           |
+    +--------------------+------------+
+    |bad-whitespace      |3           |
+    +--------------------+------------+
+    |unused-import       |2           |
+    +--------------------+------------+
+    |invalid-name        |2           |
+    +--------------------+------------+
+    |bad-continuation    |2           |
+    +--------------------+------------+
+    |unused-argument     |1           |
+    +--------------------+------------+
+    |trailing-whitespace |1           |
+    +--------------------+------------+
+    |relative-import     |1           |
+    +--------------------+------------+
+    |line-too-long       |1           |
+    +--------------------+------------+
+
+
+
+    Global evaluation
+    -----------------
+    Your code has been rated at 5.28/10
+
+## Contributors
+
+* David Leonard
+* Eswari Swarna
+* Marco Quezada 
+* Wan Kim Mok

+ 20 - 0
bower.json

@@ -0,0 +1,20 @@
+{
+  "name": "django-hackathon-starter",
+  "version": "0.0.0",
+  "authors": [
+    "David Leonard <sephirothcloud1025@yahoo.com>"
+  ],
+  "description": "Django boilerplate project for hackathons",
+  "keywords": [
+    "Django",
+    "Python",
+    "API",
+    "RESTful"
+  ],
+  "license": "MIT",
+  "dependencies": {
+    "bootstrap": "~3.3.4",
+    "jquery": "~2.1.3",
+    "bootstrap-social":"~4"
+  }
+}

+ 0 - 0
hackathon_starter/hackathon/__init__.py


+ 5 - 0
hackathon_starter/hackathon/admin.py

@@ -0,0 +1,5 @@
+from django.contrib import admin
+from hackathon.models import UserProfile
+
+# Register your models here.
+admin.site.register(UserProfile)

+ 11 - 0
hackathon_starter/hackathon/forms.py

@@ -0,0 +1,11 @@
+from django.contrib.auth.forms import UserCreationForm
+from django.contrib.auth.models import User
+from django import forms
+from hackathon.models import UserProfile
+
+class UserForm(forms.ModelForm):
+    password = forms.CharField(widget=forms.PasswordInput())
+
+    class Meta:
+        model = User
+        fields = ('username', 'email', 'password')

+ 0 - 0
hackathon_starter/hackathon/migrations/__init__.py


+ 11 - 0
hackathon_starter/hackathon/models.py

@@ -0,0 +1,11 @@
+from django.db import models
+from django.contrib.auth.models import User
+
+# Create your models here.
+class UserProfile(models.Model):
+    # This line is required. Links UserProfile to a User model instance.
+    user = models.OneToOneField(User)
+
+    # Override the __unicode__() method to return out something meaningful!
+    def __unicode__(self):
+        return self.user.username

+ 0 - 0
hackathon_starter/hackathon/scripts/__init__.py


+ 179 - 0
hackathon_starter/hackathon/scripts/github.py

@@ -0,0 +1,179 @@
+'''
+Module github.py contains a handful of methods
+for interacting with Github data.
+'''
+
+import requests
+import simplejson as json
+
+########################
+# GITHUB API CONSTANTS #
+########################
+
+API_BASE_URL = 'https://api.github.com/users/DrkSephy'
+
+def getUserData(clientID, clientSecret):
+	'''Get generic Github User data.'''
+	url = API_BASE_URL + '?' + clientID + '&' + clientSecret
+	req = requests.get(url)
+	jsonList = []
+	jsonList.append(json.loads(req.content))
+	parsedData = []
+	userData = {}
+	for data in jsonList: 
+		userData['name'] = data['name']
+		userData['blog'] = data['blog']
+		userData['email'] = data['email']
+		userData['public_gists'] = data['public_gists']
+		userData['public_repos'] = data['public_repos']
+		userData['avatar_url'] = data['avatar_url']
+		userData['followers'] = data['followers']
+		userData['following'] = data['following']
+	parsedData.append(userData)
+
+	return parsedData
+	
+
+def getUserRepositories(clientID, clientSecret):
+	'''Get a list of all repositories owned by a User.'''
+
+	# Which page number of data are we looking at?
+	pageNumber = 1
+
+	# List of all our json
+	jsonList = []
+
+	# List of all repositories
+	repositories = []
+
+	# IDEA: Repeatedly loop over urls and check if the content has less than 30 entries.
+	# 		If it does, then we have iterated over all the data. Time to parse it. 
+	while True:
+		req = requests.get('https://api.github.com/users/DrkSephy/repos?page=' + str(pageNumber) + '&' + clientID + '&' + clientSecret)
+		jsonList.append(json.loads(req.content))
+		if len(json.loads(req.content)) < 30:
+			break
+		elif len(json.loads(req.content)) >= 30:
+			pageNumber += 1
+
+	# Loop over our data and extract all of the repository names
+	for data in jsonList:
+		for datum in data:
+			repositories.append(datum['name'])
+			
+	return repositories
+
+def getForkedRepositories(clientID, clientSecret):
+	'''Get a list of all forked repositories by a user.'''
+	# Which page number of data are we looking at?
+	pageNumber = 1
+
+	# List of all our json
+	jsonList = []
+
+	# List of all repositories
+	forkedRepositories = []
+
+	# IDEA: Repeatedly loop over urls and check if the content has less than 30 entries.
+	# 		If it does, then we have iterated over all the data. Time to parse it. 
+	while True:
+		req = requests.get('https://api.github.com/users/DrkSephy/repos?page=' + str(pageNumber) + '&' + clientID + '&' + clientSecret)
+		jsonList.append(json.loads(req.content))
+		if len(json.loads(req.content)) < 30:
+			break
+		elif len(json.loads(req.content)) >= 30:
+			pageNumber += 1
+
+	# Loop over our data and extract all of the repository names
+	forkedRepos = {}
+	for data in jsonList:
+		for datum in data:
+			if datum['fork'] == True:
+				#print datum['name']
+				forkedRepos['name'] = datum['name']
+				forkedRepositories.append(forkedRepos)
+				forkedRepos = {}
+
+	return forkedRepositories
+
+def getTopContributedRepositories(repos, clientID, clientSecret):
+	'''Get a list of all commits for each repository owned.'''
+
+	jsonList = []
+	for repo in repos:
+		# print repo
+		req = requests.get('https://api.github.com/repos/DrkSephy/' + repo + '/stats/contributors' + '?' + clientID + '&' + clientSecret)
+		jsonList.append(json.loads(req.content))
+
+	parsedData = []
+	# Keep track of which JSON set we are processing to get the repo name
+	indexNumber = -1
+	for item in jsonList:
+		indexNumber += 1
+		commits = {}
+		for data in item:
+			if data['author']['login'] == 'DrkSephy':
+				commits['author'] = data['author']['login']
+				commits['total'] = data['total']
+				commits['repo_name'] = repos[indexNumber]
+				parsedData.append(commits)
+
+	return parsedData
+
+def filterCommits(data):
+	'''Returns the top 10 committed repositories.'''
+
+	maxCommits = []
+	for i in range(1, 10):
+		maxCommitedRepo = max(data, key=lambda x:x['total'])
+		maxCommits.append(maxCommitedRepo)
+		index = data.index(maxCommitedRepo)
+		data.pop(index)
+	return maxCommits
+	
+	
+def getStarGazerCount(clientID, clientSecret):
+	'''Get Stargazer counts for all repositories.'''
+
+	# Which page number of data are we looking at?
+	pageNumber = 1
+
+	# List of all our json
+	jsonList = []
+
+	# List of all repositories
+	stargazers = []
+
+	# IDEA: Repeatedly loop over urls and check if the content has less than 30 entries.
+	# 		If it does, then we have iterated over all the data. Time to parse it. 
+	while True:
+		req = requests.get('https://api.github.com/users/DrkSephy/repos?page=' + str(pageNumber) + '&' + clientID + '&' + clientSecret)
+		jsonList.append(json.loads(req.content))
+		if len(json.loads(req.content)) < 30:
+			break
+		elif len(json.loads(req.content)) >= 30:
+			pageNumber += 1
+
+	# Loop over our data and extract all of the repository names
+	for data in jsonList:
+		for datum in data:
+			starData = {}
+			starData['stargazers_count'] = datum['stargazers_count']
+			starData['name'] = datum['name']
+			stargazers.append(starData)
+			
+	return stargazers
+
+def filterStarGazerCount(data):
+	'''Return top 10 starred repositories.'''
+	maxStars= []
+	for i in range(1, 10):
+		maxStarGazers = max(data, key=lambda x:x['stargazers_count'])
+		maxStars.append(maxStarGazers)
+		index = data.index(maxStarGazers)
+		data.pop(index)
+	return maxStars
+
+
+
+

+ 24 - 0
hackathon_starter/hackathon/scripts/linkedin.py

@@ -0,0 +1,24 @@
+import requests
+import simplejson as json
+
+
+consumer_key    = "7895bbnlh1k0mn"
+consumer_secret = "7CjUx1xTsF2WDRAI"
+oauth_token  	= "60b8f2c4-28b6-498d-a645-9dffb8baf47d"
+oauth_secret	= "3114e3d4-d725-482d-a11c-2e7607025a27"
+
+def getUserInfo():
+	req = requests.get("https://api.linkedin.com/v1/people/~")
+	jlist = []
+	jlist.append(json.loads(req.content))
+	parsedData = []
+	userData = {}
+	for data in jlist: 
+		userData['firstname'] = data['firstname']
+		userData['lasttname'] = data['lastname']
+		userData['email'] = data['email']
+		userData['connections'] = data['connections']
+		
+	parsedData.append(userData)
+
+	return parsedData

+ 29 - 0
hackathon_starter/hackathon/scripts/steam.py

@@ -0,0 +1,29 @@
+# pylint: disable=C0303
+
+import requests
+import json
+
+SteamUN = "Marorin"
+key = '231E98D442E52B87110816C3D5114A1D'
+
+def gamesPulling(steamID,key):
+    # Returns the JSON data from the Steam API based of one's 
+    # Steam ID number and returns a dictionary of gameids and minutes played.
+    steaminfo = {
+        'key': key, 
+        'steamid': steamID,
+        'format':'JSON',
+        'include_appinfo':'1'
+    }
+    r = requests.get('http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/', params=steaminfo)
+    d = json.loads(r.content)
+    return d['response']['games']
+ 
+def steamIDPulling(SteamUN,key):
+    #Pulls out and returns the steam id number for use in steam queries.
+    steaminfo = {'key': key,'vanityurl': SteamUN}
+    a = requests.get('http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/', params=steaminfo)
+    k = json.loads(a.content)
+    SteamID = k['response']['steamid']
+    
+    return SteamID

+ 85 - 0
hackathon_starter/hackathon/scripts/tumblr.py

@@ -0,0 +1,85 @@
+import requests
+import simplejson as json
+import time 
+import collections
+import urllib
+import re
+from bs4 import BeautifulSoup
+#from textblob.sentiments import NaiveBayesAnalyzer
+#from textblob import TextBlob
+
+###starbucks how they feel?
+#google tumblr hackathon ideas
+#sentian analysis
+blog_uri		= "http://api.tumblr.com/v2/blog/"
+user_uri		= "api.tumblr.com/v2/user/"
+consumer_key    = "KrSbAc9cYLmIgVAn1D21FjRR97QWsutNMxkPDFBxo8CMWtMk4M"
+consumer_secret = "lKWMtL2Lj8zr5pY51PVqT8ugeoG0DjrdgoFewM0QTSyJ12jP8d"
+oauth_token		= "b2osMdhLljOo5aVBjd47kU7gm08NSTqZnZa1b6gC8MmpZX8h0H"
+oauth_secret	= "jHsrI4qM5h4CbUre90SZRAG6snguY22tB1NdujgAZwFh8VD1B1"
+
+def getUserInfo():
+	return "getUserInfo()"
+
+def getBlogInfo(user):
+	blog_info = blog_uri + user +".tumblr.com/info?api_key="+consumer_key
+	req = requests.get(blog_info)
+	jsonlist = json.loads(req.content)
+	
+	meta = jsonlist['meta']
+	response = jsonlist['response']
+	blog = response['blog']
+	blog['updated'] = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(blog['updated']))
+
+	return meta, response, blog
+
+def getTaggedInfo(tag):
+	tagged_uri = "http://api.tumblr.com/v2/tagged?tag="+tag+"&api_key="+consumer_key+"&limit=20"
+	req = requests.get(tagged_uri)
+	jsonlist = json.loads(req.content)
+
+	tags = []
+
+	
+	meta = jsonlist['meta']
+	body = jsonlist['response']
+	for blog in body:
+		for data in blog:
+			if data == "tags":
+				#print blog[data]
+				for i in blog[data]:
+					m = re.match("(.*)(s*)s(t*)t(a*)a(r*)r(b*)b(u*)u(c*)c(k*)k(.*)", i.lower())
+					if not m:
+						tags.append(i)					
+
+	return tags
+
+def getTaggedBlog(tag):
+	tagged_uri = "http://api.tumblr.com/v2/tagged?tag="+tag+"&api_key="+consumer_key+"&limit=2"
+	req = requests.get(tagged_uri)
+	jsonlist = json.loads(req.content)
+	
+	meta = jsonlist['meta']
+	body = jsonlist['response']
+
+	tagtext = []
+
+	for blog in body:
+		print "####"
+		for data in blog:
+			#post
+			if data == "body":
+				if blog[data]:
+					#print blog[data]
+					soup = BeautifulSoup(blog[data])
+					text = soup.get_text()
+					tagtext.append(text)
+			#an image
+			if data == "caption":
+				if blog[data]:
+					#print blog[data]
+					soup = BeautifulSoup(blog[data])
+					text = soup.get_text()					
+					tagtext.append(text)
+	
+	return tagtext

+ 26 - 0
hackathon_starter/hackathon/static/css/form.css

@@ -0,0 +1,26 @@
+
+div.well{
+  height: 250px;
+} 
+
+.Absolute-Center {
+  margin: auto;
+  position: absolute;
+  top: 0; left: 0; bottom: 0; right: 0;
+}
+
+.Absolute-Center.is-Responsive {
+  width: 50%; 
+  height: 50%;
+  min-width: 200px;
+  max-width: 400px;
+  padding: 40px;
+}
+
+#logo-container{
+  margin: auto;
+  margin-bottom: 10px;
+  width:200px;
+  height:30px;
+  background-image:url('http://placehold.it/200x30/000000/ffffff/&text=Django+Hackathon+Starter');
+}

BIN
hackathon_starter/hackathon/static/img/github.png


BIN
hackathon_starter/hackathon/static/img/linkedin.jpg


BIN
hackathon_starter/hackathon/static/img/steam.png


BIN
hackathon_starter/hackathon/static/img/tumblr.png


+ 16 - 0
hackathon_starter/hackathon/templates/hackathon/api_examples.html

@@ -0,0 +1,16 @@
+<html>
+{% include 'hackathon/base.html' %}
+<body>
+
+
+	<div class="row text-center">
+	    <div class="col-sm-4"><a href="http://127.0.0.1:8000/hackathon/github/"><img src="/static/img/github.png"></a></div>
+	    <div class="col-sm-4"><a href="http://127.0.0.1:8000/hackathon/steam/"><img src="/static/img/steam.png"></a></div>
+	    <div class="col-sm-4"><img src="/static/img/github.png"></div>
+	    <div class="col-sm-4"><a href="http://127.0.0.1:8000/hackathon/tumblr/"><img src="/static/img/tumblr.png"></a></div>
+		<div class="col-sm-4"><a href="http://127.0.0.1:8000/hackathon/linkedin/"><img src="/static/img/linkedin.jpg"></a></div>
+
+  	</div>
+
+</body>
+</html>

+ 61 - 0
hackathon_starter/hackathon/templates/hackathon/base.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <title> Django Hackathon Starter </title>
+    <script src="/static/bower_components/jquery/dist/jquery.js"></script>
+    <script type="text/javascript" src="/static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
+    
+    
+    <link rel="stylesheet" href="/static/bower_components/bootstrap/dist/css/bootstrap.min.css">
+    <link rel="stylesheet" href="/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css">
+    <link rel="stylesheet" href="/static/bower_components/bootstrap-social/bootstrap-social.css">
+    <link rel="stylesheet" href="/static/bower_components/font-awesome/css/font-awesome.min.css">
+
+  </head>
+    
+  <body>
+    <nav class="navbar navbar-default" role="navigation">
+      <div class="container-fluid">
+        <!-- Brand and toggle get grouped for better mobile display -->
+        <div class="navbar-header">
+          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+            <span class="sr-only">Toggle navigation</span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </button>
+          <a class="navbar-brand" href="/hackathon">Django Hackathon Starter</a>
+      </div>
+
+      <!-- Collect the nav links, forms, and other content for toggling -->
+      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+        <ul class="nav navbar-nav navbar-left">
+          {% if user.is_authenticated %}
+          <li><a href="/hackathon/api">API</a></li>
+          {% endif %}
+        </ul>
+        <ul class="nav navbar-nav navbar-right">
+          {% if not user.is_authenticated %}
+            <li class="active"><a href="/hackathon/register">Register <span class="sr-only">(current)</span></a></li>
+            
+            <li><a href="/hackathon/login">Login</a></li>
+          {% endif %}
+            
+        </ul>
+        
+        <ul  class="nav navbar-nav navbar-right">
+          {% if user.is_authenticated %}
+    
+            <li><a>Hello {{user}}</a></li>
+            <li><a href="/hackathon/logout/">Logout</a></li>
+          {% endif %}
+        </ul>
+          
+          
+          </li>
+         </ul>
+        </div><!-- /.navbar-collapse -->
+      </div><!-- /.container-fluid -->
+    </nav>
+  </body>
+</html>

+ 110 - 0
hackathon_starter/hackathon/templates/hackathon/github.html

@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<html>
+<body>
+	{% include 'hackathon/base.html' %}
+
+    <h1 class="text-center"> Github Resume </h1>
+	<div class="col-lg-12">
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                <tr>
+                <th class="header"> Username <i class="icon-sort"></i></th>
+                <th class="header"> Blog <i class="icon-sort"></i></th>
+                <th class="header"> Public Repos <i class="icon-sort"></i></th>
+                <th class="header"> Public Gists <i class="icon-sort"></i></th>
+                <th class="header"> Email <i class="icon-sort"></i></th>
+                <th class="header"> Followers <i class="icon-sort"></i></th>
+                <th class="header"> Following <i class="icon-sort"></i></th>
+                </tr>
+            </thead>
+            <tbody>
+
+            {% for key in data.userData %}
+                <tr>
+                    <td>{{ key.name }}</td>
+                    <td>{{ key.blog }}</td>
+                    <td>{{ key.public_repos }}</td>
+                    <td>{{ key.public_gists }}</td>
+                    <td>{{ key.email }}</td>
+                    <td>{{ key.followers }}</td>
+                    <td>{{ key.following }}</td>
+    			</tr>
+            {% endfor %}
+
+            </tbody>
+            </table>
+        </div>
+    </div>
+
+    <div class="col-xs-4">
+        <h2> Top Contributed Repositories </h2>
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                <tr>
+                <th class="header"> Repository <i class="icon-sort"></i></th>
+                <th class="header"> Total <i class="icon-sort"></i></th>
+                </tr>
+            </thead>
+            <tbody>
+
+            {% for key in data.filteredData %}
+                <tr>
+                    <td>{{ key.repo_name }}</td>
+                    <td>{{ key.total }}</td>
+                </tr>
+            {% endfor %}
+
+            </tbody>
+            </table>
+        </div>
+    </div>
+    <div class="col-xs-4">
+        <h2> Top Starred Repositories </h2>
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                <tr>
+                <th class="header"> Repository <i class="icon-sort"></i></th>
+                <th class="header"> Count <i class="icon-sort"></i></th>
+                </tr>
+            </thead>
+            <tbody>
+
+            {% for key in data.filteredStargazers %}
+                <tr>
+                    <td>{{ key.name }}</td>
+                    <td>{{ key.stargazers_count }}</td>
+                </tr>
+            {% endfor %}
+
+            </tbody>
+            </table>
+        </div>
+    </div>
+
+    <div class="col-xs-4">
+        <h2> Contributions </h2>
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                <tr>
+                <th class="header"> Repository <i class="icon-sort"></i></th>
+                </tr>
+            </thead>
+            <tbody>
+
+            {% for key in data.forkedRepos %}
+                <tr>
+                    <td>{{ key.name }}</td>
+                </tr>
+            {% endfor %}
+
+            </tbody>
+            </table>
+        </div>
+    </div>
+
+</body>
+</html>

+ 14 - 0
hackathon_starter/hackathon/templates/hackathon/index.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+
+<html>
+    {% include 'hackathon/base.html' %}
+
+    <body>
+    	{% if user.is_authenticated %}
+        	<h1>Api Example</h1>
+        	<strong>{{ boldmessage }}</strong><br />
+        {% else %}
+        	<h1> Please register/login! </h1>
+        {% endif %}
+    </body>
+</html>

+ 25 - 0
hackathon_starter/hackathon/templates/hackathon/linkedin.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body>
+	{% include 'hackathon/base.html' %}
+	<h1>user information</h1>
+	<table>
+	<tr>
+	<th>First name</th>
+	<th>lastname</th>
+	<th>email</th>
+	<th>connection</th>
+	</tr>
+	{% for key in userinfo %}
+    <tr>
+    <td>{{ key.firstname }}</td>
+    <td>{{ key.lastname}}</td>
+    <td>{{ key.email }}</td>
+    <td>{{ key.connectionss }}</td>
+    </tr>
+    {% endfor %}
+
+     </table>
+</body>
+</html>
+

+ 47 - 0
hackathon_starter/hackathon/templates/hackathon/login.html

@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+    {% include 'hackathon/base.html' %}
+    <style>
+      .form-signin {
+        max-width: 550px;
+        padding: 15px;
+        margin: 0 auto;
+      }    
+    </style>
+
+    <body>
+      <div class="container text-center">
+        <form class="form-signin" id="login_form" method="post" action="/hackathon/login/">
+          {% csrf_token %}
+          {% load bootstrap %}
+          <h2 class="form-signin-heading">Login</h2>
+          <br>
+          <input type="text" name="username" class="form-control" placeholder="Username" value="" required autofocus>
+          <br>
+          <input type="password" name="password" class="form-control" placeholder="Password" value=""required>
+          <br>
+          <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
+          <input type="hidden" name="submit" value="submit" />
+        </form>
+      </div>
+
+      <div class="form-signin">
+        <a class="btn btn-block btn-social btn-facebook">
+          <i class="fa fa-facebook"></i>
+          Sign in with Facebook
+        </a>          
+        <a class="btn btn-block btn-social btn-twitter">
+          <i class="fa fa-twitter"></i>
+          Sign in with Twitter
+        </a>
+        <a class="btn btn-block btn-social btn-instagram">
+          <i class="fa fa-instagram"></i>
+          Sign in with Instagram
+        </a>
+        <a class="btn btn-block btn-social btn-google-plus">
+          <i class="fa fa-google-plus"></i>
+          Sign in with Google
+        </a>          
+      </div>
+    </body>
+</html>

+ 40 - 0
hackathon_starter/hackathon/templates/hackathon/navbar.html

@@ -0,0 +1,40 @@
+<body>
+  <nav class="navbar navbar-default" role="navigation">
+      <div class="container-fluid">
+        <!-- Brand and toggle get grouped for better mobile display -->
+        <div class="navbar-header">
+          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+            <span class="sr-only">Toggle navigation</span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </button>
+          <a class="navbar-brand" href="#">Django Hackathon Starter</a>
+      </div>
+
+      <!-- Collect the nav links, forms, and other content for toggling -->
+      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+        <ul class="nav navbar-nav navbar-right">
+          {% if not user.is_authenticated %}
+            <li class="active"><a href="/hackathon/register">Register <span class="sr-only">(current)</span></a></li>
+            
+            <li><a href="/hackathon/login">Login</a></li>
+          {% endif %}
+            
+        </ul>
+        
+        <ul  class="nav navbar-nav navbar-right">
+          {% if user.is_authenticated %}
+    
+            <li><a>Hello {{user}}</a></li>
+            <li><a href="/hackathon/logout/">Logout</a></li>
+          {% endif %}
+        </ul>
+          
+          
+          </li>
+        </ul>
+      </div><!-- /.navbar-collapse -->
+    </div><!-- /.container-fluid -->
+  </nav>
+</body>

+ 42 - 0
hackathon_starter/hackathon/templates/hackathon/register.html

@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+    {% include 'hackathon/base.html' %}
+    <link rel="stylesheet" href="/static/css/form.css">
+    <body>
+        {% if registered %}
+          <strong>Thank you for registering!</strong>
+          <a href="/hackathon/">Return to the homepage.</a><br />
+        
+        {% else %}
+          <div class='container text-center'>
+              <h2 class="form-signin-heading">Sign Up</h2>
+              <br>
+              <form class="form-horizontal" id="user_form" method="post" action="/hackathon/register/"
+                enctype="multipart/form-data">
+                {% csrf_token %}
+                {% load bootstrap %} 
+
+                <table>
+                  <tr>
+                     
+                      <td class="container text-center">{{ user_form.username | bootstrap_horizontal}}</td>
+                  </tr>
+
+                  <tr>
+                     
+                      <td class="container text-center">{{ user_form.email | bootstrap_horizontal}}</td>
+                  </tr>
+
+                  <tr>
+                     
+                      <td class="container text-center">{{ user_form.password | bootstrap_horizontal}}</td>
+                  </tr>
+                </table>
+                <button class="btn btn-lg btn-primary" type="submit">Register</button>
+                <input type="hidden" name="submit" value="Register" />
+              </form>
+            </div>
+          {% endif %}
+    </body>
+</html>
+

+ 12 - 0
hackathon_starter/hackathon/templates/hackathon/steam.html

@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+<table>
+  <tr><th>Game ID</th><th>Game Name</th><th>Minutes Played</th></tr>
+  {% for game in game %}
+    {% comment %}  each game object is a dictionary with "appid", "name " and "playtime_forever" keys {% endcomment %}
+    <tr><td>{{ game.appid }}</td><td>{{game.name}} </td><td>{{ game.playtime_forever }}</td></tr>
+{% endfor %}
+</table>
+</body>
+</html>

+ 61 - 0
hackathon_starter/hackathon/templates/hackathon/tumblr.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<body>
+	{% include 'hackathon/base.html' %}
+	<h1 class="text-center"> {{ title }}</h1> 
+	<br>	
+	<div class="col-lg-12">
+		<div class="table-responsive">
+			<h2> BLOGGER </h2>
+			<table class="table table-bordered">
+				<tr>
+					<th>Name</th>
+					<td>{{blogData.name}}</td>
+				</tr>
+				<tr>
+					<th>Posts</th>
+					<td>{{blogData.posts}}</td>				
+				</tr>
+				<tr>
+					<th>Blog title</th>
+					<td>{{blogData.title}}</td>				
+				</tr>
+				<tr>
+					<th>Last updated</th>
+					<td>{{blogData.updated}}</td>				
+				</tr>
+				<tr>
+					<th>Description</th>
+					<td>{{blogData.description}}</td>				
+				</tr>				
+			</table>
+		</div>
+	</div>
+
+	<div class="col-md-4">
+		<div class="table-responsive">
+			<h2> #starbucks </h2>
+			<table class="table table-bordered">
+				{% for i in blogTag %}
+				<tr>
+					<td> {{i}} </td>
+				</tr>
+				{% endfor %}		
+			</table>
+		</div>
+	</div>
+
+	<div class="col-md-4">
+		<div class="table-responsive">
+			<h2> Comments </h2>
+			<table class="table table-bordered">
+				{% for i in blogontag %}
+				<tr>
+					<td> {{i}} </td>
+				</tr>
+				{% endfor %}		
+			</table>
+		</div>
+	</div>
+
+</html>

+ 3 - 0
hackathon_starter/hackathon/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 0 - 0
hackathon_starter/hackathon/unittests/__init__.py


+ 8 - 0
hackathon_starter/hackathon/unittests/testcase.py

@@ -0,0 +1,8 @@
+import unittest
+
+def fun(x):
+    return x + 1
+
+class MyTest(unittest.TestCase):
+    def test(self):
+        self.assertEqual(fun(3), 4)

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 192 - 0
hackathon_starter/hackathon/unittests/testgithub.py


+ 16 - 0
hackathon_starter/hackathon/urls.py

@@ -0,0 +1,16 @@
+from django.conf.urls import patterns, url
+
+from hackathon import views
+
+urlpatterns = patterns('',
+    url(r'^$', views.index, name='index'),
+    url(r'^test/$', views.test, name='test'),
+    url(r'^register/$', views.register, name='register'),
+    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'^steam/$', views.steam, name='steam'),
+    url(r'^github/$', views.github, name='github'),
+    url(r'^tumblr/$', views.tumblr, name='tumblr'),
+    url(r'^linkedin/$', views.linkedin, name='linkedin')
+)

+ 107 - 0
hackathon_starter/hackathon/views.py

@@ -0,0 +1,107 @@
+from django.shortcuts import render
+from hackathon.forms import UserForm
+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.steam import gamesPulling, steamIDPulling 
+from scripts.github import *
+from scripts.tumblr import *
+from django.conf import settings
+
+
+
+def index(request):
+    context = {'hello': 'world'}
+    return render(request, 'hackathon/index.html', context)
+
+def test(request):
+    return HttpResponse('meow')
+
+def api_examples(request):
+    context = {'title': 'API Examples Page'}
+    return render(request, 'hackathon/api_examples.html', context)
+
+def register(request):
+    registered = False
+    if request.method == 'POST':
+        user_form = UserForm(data=request.POST)
+        if user_form.is_valid():
+            user = user_form.save()
+            user.set_password(user.password)
+            user.save()
+            registered = True
+        else:
+            print user_form.errors
+    else:
+        user_form = UserForm()
+
+    
+    return render(request,
+            'hackathon/register.html',
+            {'user_form': user_form, 'registered': registered} )
+
+def user_login(request):
+
+    
+    if request.method == 'POST':
+        username = request.POST.get('username')
+        password = request.POST.get('password')
+
+
+        user = authenticate(username=username, password=password)
+
+
+        if user:
+            if user.is_active:
+                login(request, user)
+                return HttpResponseRedirect('/hackathon/')
+            else:
+                return HttpResponse("Your Django Hackathon account is disabled.")
+        else:
+            print "Invalid login details: {0}, {1}".format(username, password)
+            return HttpResponse("Invalid login details supplied.")
+
+    else:
+        return render(request, 'hackathon/login.html', {})
+
+def user_logout(request):
+    logout(request)
+    return HttpResponseRedirect('/hackathon/')
+
+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/steam.html', {"game": game })
+
+def github(request):
+    allData = {}
+    userData = getUserData(settings.GITHUB_CLIENT_ID, settings.GITHUB_CLIENT_SECRET)
+    repositories = getUserRepositories(settings.GITHUB_CLIENT_ID, settings.GITHUB_CLIENT_SECRET)
+    list = getTopContributedRepositories(repositories, settings.GITHUB_CLIENT_ID, settings.GITHUB_CLIENT_SECRET)
+    filtered = filterCommits(list)
+    stargazers = getStarGazerCount(settings.GITHUB_CLIENT_ID, settings.GITHUB_CLIENT_SECRET)
+    filteredStargazers = filterStarGazerCount(stargazers)
+    forkedRepos = getForkedRepositories(settings.GITHUB_CLIENT_ID, settings.GITHUB_CLIENT_SECRET)
+    allData['userData'] = userData
+    allData['filteredData'] = filtered
+    allData['filteredStargazers'] = filteredStargazers
+    allData['forkedRepos'] = forkedRepos
+
+    return render(request, 'hackathon/github.html', { 'data': allData })
+
+def tumblr(request):
+    meta, response, blog = getBlogInfo('twitterthecomic')
+    tagged_blog = getTaggedInfo("starbucks")
+    blogontag = getTaggedBlog("starbucks")
+    context = {'title': "What's up Starbucks?", 'blogData': blog, 'blogTag': tagged_blog, 'blogontag': blogontag}
+    return render(request, 'hackathon/tumblr.html', context)
+
+def linkedin(request):
+    userinfo = getUserInfo()
+    context = {'title': 'linkedin Example','userdata': userinfo}
+    return render(request, 'hackathon/linkedin.html', context)
+

+ 0 - 0
hackathon_starter/hackathon_starter/__init__.py


+ 107 - 0
hackathon_starter/hackathon_starter/settings.py

@@ -0,0 +1,107 @@
+"""
+Django settings for hackathon_starter project.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.7/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/1.7/ref/settings/
+"""
+
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+import os
+BASE_DIR = os.path.dirname(os.path.dirname(__file__))
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'keuhh=0*%do-ayvy*m2k=vss*$7)j8q!@u0+d^na7mi2(^!l!d'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+TEMPLATE_DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = (
+    'django.contrib.admin',
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    'hackathon',
+    'bootstrapform',
+    # 'django_openid',
+    'django_nose',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+    'django.middleware.clickjacking.XFrameOptionsMiddleware',
+    #'django_openid_consumer.SessionConsumer',
+)
+
+ROOT_URLCONF = 'hackathon_starter.urls'
+
+WSGI_APPLICATION = 'hackathon_starter.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+    }
+}
+
+# Internationalization
+# https://docs.djangoproject.com/en/1.7/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_L10N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/1.7/howto/static-files/
+
+STATIC_URL = '/static/'
+
+TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
+
+# Use nose to run all tests
+TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
+
+# Tell nose to measure coverage on the 'foo' and 'bar' apps
+NOSE_ARGS = [
+    '--with-coverage',
+    '--cover-package=hackathon/scripts',
+]
+
+############
+#   KEYS   #
+############
+
+GITHUB_CLIENT_ID = 'client_id=2404a1e21aebd902f6db'
+GITHUB_CLIENT_SECRET = 'client_secret=3da44769d4b7c9465fa4c812669148a163607c23'
+

+ 8 - 0
hackathon_starter/hackathon_starter/urls.py

@@ -0,0 +1,8 @@
+from django.conf.urls import patterns, include, url
+from django.contrib import admin
+
+urlpatterns = patterns('',
+    url(r'^hackathon/', include('hackathon.urls')),
+    url(r'^admin/', include(admin.site.urls)),
+    # url(r'^openid/(.*)', SessionConsumer()),
+)

+ 14 - 0
hackathon_starter/hackathon_starter/wsgi.py

@@ -0,0 +1,14 @@
+"""
+WSGI config for hackathon_starter project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
+"""
+
+import os
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hackathon_starter.settings")
+
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()

+ 10 - 0
hackathon_starter/manage.py

@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ == "__main__":
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hackathon_starter.settings")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)

+ 21 - 0
requirements.txt

@@ -0,0 +1,21 @@
+Django==1.7.6
+PyTumblr==0.0.6
+astroid==1.3.6
+beautifulsoup4==4.3.2
+coverage==4.0a5
+django-bootstrap-form==3.2
+django-bootstrap-forms==0.1
+django-bower==5.0.2
+django-nose==1.3
+httplib2==0.9
+httpretty==0.8.8
+logilab-common==0.63.2
+mock==1.0.1
+nose==1.3.4
+oauth2==1.5.211
+pylint==1.4.3
+python-openid==2.2.5
+requests==2.6.0
+simplejson==3.6.5
+six==1.9.0
+wsgiref==0.1.2