Skip to content

Instantly share code, notes, and snippets.

from bs4 import BeautifulSoup
import requests
from django.core.management.base import BaseCommand, CommandError
import sunlight
import selenium
from politics import settings
from finder.models import Legislator
from django.core.management.base import BaseCommand, CommandError
from bs4 import BeautifulSoup
import requests
import sunlight
from politics import settings
from finder.models import Legislator
sunlight.config.API_KEY = settings.SUNLIGHT_API
from django.core.management.base import BaseCommand, CommandError
from bs4 import BeautifulSoup
import requests
import sunlight
from politics import settings
from finder.models import Legislator
sunlight.config.API_KEY = settings.SUNLIGHT_API
import time
import datetime
import pprint
from django.core.management.base import BaseCommand, CommandError
from django.db import IntegrityError, transaction
from finder.api import recent_votes
from finder.models import Legislator, Vote, Bill
@mekhami
mekhami / models.py
Last active February 27, 2016 18:58
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/query.py", line 405, in get_or_create
return self.get(**lookup), False
File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/query.py", line 334, in get
self.model._meta.object_name
finder.models.DoesNotExist: Bill matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
Attempting an entry for Raul Ruiz
Ruiz
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/vagrant/.virtualenvs/politracker/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/home/vagrant/.virtualenvs/politracker/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/vagrant/.virtualenvs/politracker/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
@mekhami
mekhami / error.txt
Last active February 27, 2016 18:59
Environment:
Request Method: POST
Request URL: http://localhost:8000/rsvp/
Django Version: 1.8.3
Python Version: 3.4.0
Installed Applications:
('django.contrib.admin',
@mekhami
mekhami / error.txt
Last active February 27, 2016 18:59
Traceback (most recent call last):
File "/home/ldvp/virt/wedding/lib/python3.4/site-packages/django/core/urlresolvers.py", line 394, in urlconf_module
return self._urlconf_module
AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ldvp/virt/wedding/lib/python3.4/site-packages/django/core/urlresolvers.py", line 404, in url_patterns
iter(patterns)
@mekhami
mekhami / urls.py
Last active February 27, 2016 18:59
"""wedding URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
from django.conf.urls import include, url
from django.contrib import admin
from .views import HomePageView
urlpatterns = [
url(r'^$', HomePageView.as_view(), name='index'),
]