DrkSephy / django-hackathon-starter

A boilerplate for Django web applications
1.61k stars 298 forks source link

/hackathon/githubTopRepositories/ fails #36

Closed edelans closed 7 years ago

edelans commented 7 years ago

Athough /hackathon/githubResume/ and /hackathon/githubUser/ work properly on my resh install on a brand new virtualenv, /hackathon/githubTopRepositories/ fails.

Here is my stacktrace :

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/hackathon/githubTopRepositories/

Django Version: 1.7.6
Python Version: 2.7.12
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'hackathon',
 'bootstrapform',
 'django_nose',
 'rest_framework',
 'corsheaders')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 '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')

Traceback:
File "/home/edelans/.virtualenvs/django-starter/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/edelans/github/django-hackathon-starter/hackathon_starter/hackathon/views.py" in githubTopRepositories
  532.         list = getTopContributedRepositories(user, repositories, settings.GITHUB_CLIENT_ID, settings.GITHUB_CLIENT_SECRET)
File "/home/edelans/github/django-hackathon-starter/hackathon_starter/hackathon/scripts/github.py" in getTopContributedRepositories
  260.         jsonList.append(json.loads(req.content))
File "/home/edelans/.virtualenvs/django-starter/local/lib/python2.7/site-packages/simplejson/__init__.py" in loads
  505.         return _default_decoder.decode(s)
File "/home/edelans/.virtualenvs/django-starter/local/lib/python2.7/site-packages/simplejson/decoder.py" in decode
  370.         obj, end = self.raw_decode(s)
File "/home/edelans/.virtualenvs/django-starter/local/lib/python2.7/site-packages/simplejson/decoder.py" in raw_decode
  400.         return self.scan_once(s, idx=_w(s, idx).end())

Exception Type: JSONDecodeError at /hackathon/githubTopRepositories/
Exception Value: Expecting value: line 1 column 1 (char 0)
edelans commented 7 years ago

hum, might be because of an unreliable internet connection. gonna double check and come back here.

DrkSephy commented 7 years ago

It could also be due to running out of Github API requests, causing you to be rate limited. As such, the JSON decoding would fail since it isn't getting any JSON response from the API.

edelans commented 7 years ago

@DrkSephy yeah that's what happened, i got some errors telling me I exceeded the API rate-limit.

Thanks for pointing that out !

DrkSephy commented 7 years ago

No problem :). Closing this issue now.