Giter Site home page Giter Site logo

codeforamerica / councilmatic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshmarcus/philly_legislative

58.0 81.0 22.0 5.11 MB

A subscription service for city council legislative information, started in Philadelphia.

Home Page: http://councilmatic.org

Shell 0.45% Python 65.83% CSS 13.43% JavaScript 7.64% Ruby 0.04% XSLT 1.39% HTML 10.93% Makefile 0.29%

councilmatic's Introduction

Councilmatic! Build Status

City Council Legislative Subscription Service.

Contact Us

Getting Started

IMPORTANT: If you are interested in setting up Councilmatic for your city, you'll want to start with a sample local instance. In most cases, this is the right place to start. If instead you are interested in making modification to the core of Councilmatic, proceed with these instructions.

Installation

First check out the project code.

git clone git://github.com/codeforamerica/councilmatic.git

We recommend setting up a virtual environment for working with any project, so that you can manage your project-specific dependencies. This is optional but recommended:

virtualenv env --no-site-packages
source env/bin/activate

Next, install the requirements for Councilmatic (we recommend working in a virtual environment, but it's not strictly necessary).

$ pip install -r requirements.txt

Be sure to also install the scraper library for your city's legislative management system. For cities using Granicus's latest version of Legistar, this will be @fgregg's https://github.com/fgregg/legistar-scrape.

Non-Python requirements include:

  • pdftotext and pdftohtml (use apt-get install poppler-utils on Ubuntu)

Legislation source

Copy the file councilmatic/local_settings.py.template to councilmatic/local_settings.py. Fill in the LEGISLATION setting in this file. By default, it is set up to scrape from Philadelphia's legislation system.

Database

Create a database for Councilmatic. Typically this is done like:

createdb -T template_postgis councilmatic

where template_postgis is the name of your PostGIS database template. If you do not yet have one, you can find instructions for getting your system ready for Django and PostGIS online. For example, here are instructions for Mac, and Ubuntu. For other platforms, and for further instructions, the GeoDjango docs are a good place to look.

NOTE that PostGIS 2.0 is not compatible with Django 1.4. As Councilmatic is currently not set up to run on Django 1.5, you should install PostGIS 1.5

Set up the project database and populate it with city council data (when the syncdb command prompts you to create an administrative user, go ahead and do so). There is a lot of data to be loaded, so downloading it all may take a while.

cd local-councilmatic-sample
python manage.py syncdb # Create admin account when prompted.
python manage.py migrate
python manage.py updatelegfiles
python manage.py rebuild_index # For searches. Say yes when prompted.
python manage.py collectstatic # For js and css. Say yes when prompted.

Development server

Finally, to run the server:

$ python manage.py runserver

Now, check that everything is working by browsing to http://localhost:8000/. Now browse to http://localhost:8000/admin and enter the admin username and password you supplied and you should have access to all of the legislative files!

Architecture

The core of Councilmatic is implemented as a Django app. It cannot be run without a Django project. The local-councilmatic-sample folder contains a minimal Django project.

Copyright

Copyright (c) 2010 Code for America Laboratories See LICENSE for details.

Code for America Tracker

councilmatic's People

Contributors

corydissinger avatar danmelton avatar derekeder avatar fgregg avatar joannecheng avatar joshmarcus avatar matthewloveless avatar migurski avatar mildmojo avatar mjumbewu avatar non avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

councilmatic's Issues

API references should be by URL and internal ID

API references should be by URL and internal ID. For example, on the legislation endpoint (http://www.councilmatic.org/api/v2/files/), the sponsors are referred only by URL. This is necessary for a well-connected REST interface, but is not sufficient for a useful interface considering conventions of REST-based JS frameworks in particular. It would be prudent to use a small object with {"id": "123", "uri": "http://..."} in favor of just a URI (though it is technically redundant).

Also, all resources should include their own URI in their definition. For example, a councilmember (http://www.councilmatic.org/api/v2/councilmembers/29) has no self-uri reference.

Only send email when there have been updates

I learn to ignore the email notifications when I get one each day that says that nothing happened. I'm liable to miss when something does. So, only send if something does happen. Then, if I get an email, I know to pay attention.

Error when loading legislative file

python manage.py loadlegfiles
Local copy of database already exists.
(u'000682', u'Bill', u'http://legislation.phila.gov/detailreport/?key=824', u'ENACTED', u'Providing for civil liability for violations of certain provisions of the Pennsylvania Motor Vehicle Code relating to obedience to steady red-light signals and stopping at an intersection or crossing; and establishing an administrative system for adjudicating liability in connection with such violations; all under certain terms and conditions.', u'Committee on Streets and Services', u'2000-11-02', u'2003-05-15', u'1', u'', u"Councilmember Rizzo, Councilmember Goode, Councilmember Tasco, Councilmember Clarke, Councilmember Miller, Councilmember Ortiz, Councilmember Longstreth, Councilmember O'Neill, Councilmember Nutter, Councilmember Krajewski, Councilmember Blackwell")

... Not showing all the printout, can put back if useful ... 

Traceback (most recent call last):
  File "manage.py", line 11, in 
    execute_from_command_line(sys.argv)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/home/ec2-user/councilmatic/councilmatic/phillyleg/management/commands/loadlegfiles.py", line 33, in handle
    self._get_new_files(force_download)
  File "/home/ec2-user/councilmatic/councilmatic/phillyleg/management/commands/loadlegfiles.py", line 56, in _get_new_files
    ds.save_legis_file(record, attachments, actions, minutes)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/transaction.py", line 209, in inner
    return func(*args, **kwargs)
  File "/home/ec2-user/councilmatic/councilmatic/phillyleg/management/scraper_wrappers/stores/councilmatic_orm.py", line 105, in save_legis_file
    self._save_or_ignore(LegMinutes, minutes_record)
  File "/home/ec2-user/councilmatic/councilmatic/phillyleg/management/scraper_wrappers/stores/councilmatic_orm.py", line 199, in _save_or_ignore
    model_instance.save()
  File "/home/ec2-user/councilmatic/councilmatic/phillyleg/models.py", line 367, in save
    address=location['address']
TypeError: tuple indices must be integers, not str

See councilmember's info by clicking on their picture

Sponsors of a given bill have their pictures plastered at the top of a piece of legislation. Users should be able to click the councilmembers' images to get a list of their sponsored legislation. This can just search for bills sponsored by the member for now.

Creating an account generates an error

My wife got a 404 earlier trying to create an account. I got the following error when I reached the end of the process:

NoReverseMatch at /register/

Reverse for 'registration_complete' with arguments '()' and keyword arguments '{}' not found.

Request Method: POST
Request URL: http://www.councilmatic.org/register/
Django Version: 1.4
Exception Type: NoReverseMatch
Exception Value:

Reverse for 'registration_complete' with arguments '()' and keyword arguments '{}' not found.

Exception Location: /home/dotcloud/env/lib/python2.6/site-packages/django/core/urlresolvers.py in _reverse_with_prefix, line 396
Python Executable: /home/dotcloud/git-8f33fb0/
Python Version: 2.6.5
Python Path:

['/home/dotcloud/current',
'.',
'',
'/home/dotcloud/env/lib/python2.6/site-packages/pip-1.0.1-py2.6.egg',
'/home/dotcloud/env/src/django-registration',
'/home/dotcloud/env/src/beautifulsoup',
'/home/dotcloud/env/src/django-recaptcha',
'/home/dotcloud/env/lib/python2.6',
'/home/dotcloud/env/lib/python2.6/plat-linux2',
'/home/dotcloud/env/lib/python2.6/lib-tk',
'/home/dotcloud/env/lib/python2.6/lib-old',
'/home/dotcloud/env/lib/python2.6/lib-dynload',
'/usr/lib/python2.6',
'/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk',
'/usr/lib64/python2.6/lib-tk',
'/home/dotcloud/env/lib/python2.6/site-packages',
'/usr/local/lib/python2.6/dist-packages/virtualenv-1.6.1-py2.6.egg',
'/usr/local/lib/python2.6/site-packages',
'/usr/local/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages',
'/usr/lib/pymodules/python2.6',
'/home/dotcloud/current/councilmatic']

Server time: Mon, 16 Jul 2012 20:58:37 -0500
Traceback Switch to copy-and-paste view

/home/dotcloud/env/lib/python2.6/site-packages/django/core/handlers/base.py in get_response

                            response = callback(request, *callback_args, **callback_kwargs)

    ...
▶ Local vars
/home/dotcloud/env/src/django-registration/registration/views.py in register

                    return redirect(to, *args, **kwargs)

    ...
▶ Local vars
/home/dotcloud/env/lib/python2.6/site-packages/django/shortcuts/__init__.py in redirect

            return redirect_class(urlresolvers.reverse(to, args=args, kwargs=kwargs))

    ...
▶ Local vars
/home/dotcloud/env/lib/python2.6/site-packages/django/core/urlresolvers.py in reverse

        return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))

    ...
▶ Local vars
/home/dotcloud/env/lib/python2.6/site-packages/django/core/urlresolvers.py in _reverse_with_prefix

                    "arguments '%s' not found." % (lookup_view_s, args, kwargs))

    ...
▶ Local vars

Request information
GET

No GET data
POST
Variable Value
username

u'boutell'

password1

u'dogfish1024'

password2

u'dogfish1024'

recaptcha_response_field

u'Council rpirien'

recaptcha_challenge_field

u'03AHJ_VutOzYJypH-GeZvO8TaHFE_LVIO65l4dM2qFsMkuB895IwxGM3OzvzqGDSCyIg7n5Sq2py93FIk3sLRzO-rS1EjBRQArZBhiIIh1gkBKYcZpgmbjKrtnGGfh3ntWyh8PTW6UIN9WI2JOkKMHpI4eTuTcJ8c0wQ'

csrfmiddlewaretoken

u'dx83oIZK1fW5V43ygO1mLrzlb5mm8RYm'

email

u'[email protected]'

FILES

No FILES data
COOKIES
Variable Value
__utmz

'186975290.1342455195.1.1.utmcsr=technicallyphilly.com|utmccn=(referral)|utmcmd=referral|utmcct=/2012/07/16/councilmatic-18-months-in-the-making-use-this-web-app-to-track-city-council-legislation'

__unam

'ef29eea-13890916244-6be71a07-3'

csrftoken

'dx83oIZK1fW5V43ygO1mLrzlb5mm8RYm'

__utma

'186975290.454183550.1342455195.1342455195.1342490258.2'

__utmb

'186975290.3.10.1342490258'

__utmc

'186975290'

META
Variable Value
wsgi.multiprocess

True

HTTP_REFERER

'http://www.councilmatic.org/register/'

UWSGI_SCRIPT

'wsgi'

uwsgi.version

'0.9.6.5'

SCRIPT_NAME

u''

HTTP_X_FORWARDED_PORT

'80'

PATH_INFO

u'/register/'

SERVER_PROTOCOL

'HTTP/1.0'

QUERY_STRING

''

HTTP_X_REAL_IP

'::ffff:68.81.107.211'

CONTENT_LENGTH

'375'

HTTP_USER_AGENT

'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20100101 Firefox/13.0.1'

HTTP_CONNECTION

'close'

HTTP_COOKIE

'csrftoken=dx83oIZK1fW5V43ygO1mLrzlb5mm8RYm; __utma=186975290.454183550.1342455195.1342455195.1342490258.2; __utmc=186975290; __utmz=186975290.1342455195.1.1.utmcsr=technicallyphilly.com|utmccn=(referral)|utmcmd=referral|utmcct=/2012/07/16/councilmatic-18-months-in-the-making-use-this-web-app-to-track-city-council-legislation; __unam=ef29eea-13890916244-6be71a07-3; __utmb=186975290.3.10.1342490258'

SERVER_NAME

'councilmatic-default-www-0'

REMOTE_PORT

'57073'

HTTP_X_FORWARDED_PROTOCOL

'http'

wsgi.url_scheme

'http'

SERVER_PORT

'80'

DOCUMENT_ROOT

'/home/dotcloud/current'

HTTP_CONTENT_LENGTH

'375'

HTTP_X_FORWARDED_PROTO

'http'

wsgi.input

<open file 'wsgi_input', mode 'r' at 0xc7a300>

HTTP_HOST

'www.councilmatic.org'

wsgi.multithread

False

HTTP_CONTENT_TYPE

'application/x-www-form-urlencoded'

REQUEST_URI

'/register/'

HTTP_ACCEPT

'text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8'

wsgi.version

(1, 0)

HTTP_X_FORWARDED_FOR

'::ffff:68.81.107.211'

wsgi.errors

<open file 'wsgi_input', mode 'w' at 0xc7a390>

REMOTE_ADDR

'10.13.66.82'

HTTP_ACCEPT_LANGUAGE

'en-us,en;q=0.5'

wsgi.run_once

False

REQUEST_METHOD

'POST'

CONTENT_TYPE

'application/x-www-form-urlencoded'

wsgi.file_wrapper

''

CSRF_COOKIE

'dx83oIZK1fW5V43ygO1mLrzlb5mm8RYm'

HTTP_ACCEPT_ENCODING

'gzip, deflate'

Settings
Using settings module councilmatic.settings
Setting Value
MONTH_DAY_FORMAT

'F j'

USE_L10N

False

USE_THOUSAND_SEPARATOR

False

CSRF_COOKIE_SECURE

False

LANGUAGE_CODE

'en-us'

ROOT_URLCONF

'urls'

MANAGERS

()

ACCOUNT_ACTIVATION_DAYS

7

STATIC_ROOT

'/home/dotcloud/current/councilmatic/../static'

DB_USER

u'root'

GOOGLE_ANALYTICS_ACCOUNT

'UA-17831608-6'

RECAPTCHA_PRIVATE_KEY

u'********************'

EMAIL_SUBJECT_PREFIX

'[Django] '

SEND_BROKEN_LINK_EMAILS

False

URL_VALIDATOR_USER_AGENT

'Django/1.4 (https://www.djangoproject.com)'

STATICFILES_FINDERS

('django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder')

SESSION_COOKIE_DOMAIN

None

SESSION_COOKIE_NAME

'sessionid'

DB_NAME

'councilmatic'

ADMIN_FOR

()

TIME_INPUT_FORMATS

('%H:%M:%S', '%H:%M')

DATABASES

{'default': {'ENGINE': 'django.contrib.gis.db.backends.postgis',
'HOST': u'councilmatic-YGFXOXWC.dotcloud.com',
'NAME': 'councilmatic',
'OPTIONS': {},
'PASSWORD': u'********************',
'PORT': u'27330',
'TEST_CHARSET': None,
'TEST_COLLATION': None,
'TEST_MIRROR': None,
'TEST_NAME': None,
'TIME_ZONE': 'America/Chicago',
'USER': u'root'}}

RECAPTCHA_PUBLIC_KEY

u'********************'

FILE_UPLOAD_PERMISSIONS

None

FILE_UPLOAD_HANDLERS

('django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler')

DEFAULT_CONTENT_TYPE

'text/html'

APPEND_SLASH

True

FIRST_DAY_OF_WEEK

0

DATABASE_ROUTERS

[]

MY_REUSABLE_APPS

('model_blocks', 'mustachejs')

YEAR_MONTH_FORMAT

'F Y'

STATICFILES_STORAGE

'django.contrib.staticfiles.storage.StaticFilesStorage'

CACHES

{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': ''}}

SERVER_EMAIL

'root@localhost'

SESSION_COOKIE_PATH

'/'

USE_X_FORWARDED_HOST

False

DB_PORT

u'27330'

MIDDLEWARE_CLASSES

('django.middleware.common.CommonMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.csrf.CsrfViewMiddleware')

COMMUNITY_APPS

('registration',
'captcha',
'south',
'haystack',
'uni_form',
'django_nose',
'debug_toolbar',
'social_auth',
'ebdata',
'compressor',
'djangorestframework')

THOUSAND_SEPARATOR

','

SECRET_KEY

u'********************'

LANGUAGE_COOKIE_NAME

'django_language'

FILE_UPLOAD_TEMP_DIR

None

TRANSACTIONS_MANAGED

False

LOGGING_CONFIG

'django.utils.log.dictConfig'

SIGNING_BACKEND

'django.core.signing.TimestampSigner'

TEMPLATE_LOADERS

('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader')

WSGI_APPLICATION

None

TEMPLATE_DEBUG

True

X_FRAME_OPTIONS

'SAMEORIGIN'

AUTHENTICATION_BACKENDS

('social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
'social_auth.backends.google.GoogleBackend',
'social_auth.backends.contrib.linkedin.LinkedinBackend',
'social_auth.backends.OpenIDBackend',
'django.contrib.auth.backends.ModelBackend')

HAYSTACK_CONNECTIONS

{'default': {'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': '/home/dotcloud/whoosh_index'}}

FORCE_SCRIPT_NAME

None

CACHE_BACKEND

'locmem://'

DEFAULT_CHARSET

'utf-8'

SESSION_COOKIE_SECURE

False

CSRF_COOKIE_DOMAIN

None

FILE_CHARSET

'utf-8'

DEBUG

True

SESSION_FILE_PATH

None

DEFAULT_FILE_STORAGE

'django.core.files.storage.FileSystemStorage'

INSTALLED_APPS

('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.comments',
'django.contrib.gis',
'registration',
'captcha',
'south',
'haystack',
'uni_form',
'django_nose',
'debug_toolbar',
'social_auth',
'ebdata',
'compressor',
'djangorestframework',
'model_blocks',
'mustachejs',
'cm',
'cm_api',
'phillyleg',
'subscriptions',
'bookmarks',
'activity_log',
'opinions',
'main',
'utils')

LANGUAGES

(('ar', 'Arabic'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('bn', 'Bengali'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('el', 'Greek'),
('en', 'English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy-nl', 'Frisian'),
('ga', 'Irish'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hu', 'Hungarian'),
('id', 'Indonesian'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('nb', 'Norwegian Bokmal'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('th', 'Thai'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('vi', 'Vietnamese'),
('zh-cn', 'Simplified Chinese'),
('zh-tw', 'Traditional Chinese'))

COMMENTS_ALLOW_PROFANITIES

False

PROJECT_APPS

('cm',
'cm_api',
'phillyleg',
'subscriptions',
'bookmarks',
'activity_log',
'opinions',
'main',
'utils')

PREPEND_WWW

False

SECURE_PROXY_SSL_HEADER

None

SESSION_COOKIE_HTTPONLY

True

FACEBOOK_APP_ID

'177047239036217'

DEBUG_PROPAGATE_EXCEPTIONS

False

LINKEDIN_CONSUMER_KEY

u'********************'

LOGIN_URL

'/login/'

SESSION_EXPIRE_AT_BROWSER_CLOSE

False

SOUTH_TESTS_MIGRATE

False

LINKEDIN_CONSUMER_SECRET

u'********************'

TIME_FORMAT

'P'

DATE_INPUT_FORMATS

('%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y')

LOGIN_ERROR_URL

'/login/error'

CSRF_COOKIE_NAME

'csrftoken'

EMAIL_HOST_PASSWORD

u'********************'

PASSWORD_RESET_TIMEOUT_DAYS

u'********************'

TWITTER_CONSUMER_KEY

u'********************'

CACHE_MIDDLEWARE_ALIAS

'default'

SESSION_SAVE_EVERY_REQUEST

False

NUMBER_GROUPING

0

TWITTER_CONSUMER_SECRET

u'********************'

SESSION_ENGINE

'django.contrib.sessions.backends.db'

CSRF_FAILURE_VIEW

'django.views.csrf.csrf_failure'

CSRF_COOKIE_PATH

'/'

GOOGLE_CONSUMER_SECRET

u'********************'

LOGIN_REDIRECT_URL

'/'

LOGFILE_PATH

'/home/dotcloud/logs/councilmatic.log'

LOGGING

{'disable_existing_loggers': True,
'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},
'formatters': {'simple': {'format': '%(levelname)s %(message)s'},
'verbose': {'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'}},
'handlers': {'console': {'class': 'logging.StreamHandler',
'formatter': 'verbose',
'level': 'INFO'},
'logfile': {'class': 'logging.handlers.RotatingFileHandler',
'filename': '/home/dotcloud/logs/councilmatic.log',
'formatter': 'verbose',
'level': 'DEBUG'},
'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
'filters': ['require_debug_false'],
'include_html': True,
'level': 'ERROR'},
'null': {'class': 'django.utils.log.NullHandler',
'level': 'DEBUG'}},
'loggers': {'councilmatic': {'handlers': ['console',
'logfile',
'mail_admins'],
'level': 'DEBUG'},
'django': {'handlers': ['null'],
'level': 'INFO',
'propagate': True},
'django.request': {'handlers': ['logfile', 'mail_admins'],
'level': 'WARNING',
'propagate': False},
'phillyleg.management': {'handlers': ['console',
'logfile',
'mail_admins'],
'level': 'DEBUG'}},
'version': 1}

COMPRESS_PRECOMPILERS

(('text/coffeescript', 'coffee --compile --stdio'),
('text/less', 'lessc {infile} {outfile}'),
('text/x-sass', 'sass {infile} {outfile}'),
('text/x-scss', 'sass --scss {infile} {outfile}'))

IGNORABLE_404_URLS

()

DB_PASSWORD

u'********************'

LOCALE_PATHS

()

TEMPLATE_STRING_IF_INVALID

''

MESSAGE_STORAGE

'django.contrib.messages.storage.fallback.FallbackStorage'

GOOGLE_CONSUMER_KEY

u'********************'

LOGOUT_URL

'/accounts/logout/'

EMAIL_USE_TLS

False

FIXTURE_DIRS

()

EMAIL_HOST

'localhost'

DATE_FORMAT

'N j, Y'

FACEBOOK_API_SECRET

u'********************'

MEDIA_ROOT

''

DEFAULT_EXCEPTION_REPORTER_FILTER

'django.views.debug.SafeExceptionReporterFilter'

ADMINS

()

FORMAT_MODULE_PATH

None

DEFAULT_FROM_EMAIL

'webmaster@localhost'

STATICFILES_DIRS

('/home/dotcloud/current/councilmatic/static',)

MEDIA_URL

''

DATETIME_FORMAT

'N j, Y, P'

TEMPLATE_DIRS

('/home/dotcloud/current/councilmatic/phillyleg',
'/home/dotcloud/current/councilmatic/templates')

DB_ENGINE

'postgis'

SITE_ID

1

DISALLOWED_USER_AGENTS

()

ALLOWED_INCLUDE_ROOTS

()

USE_I18N

True

WHOOSH_PATH

'/home/dotcloud/whoosh_index'

DECIMAL_SEPARATOR

'.'

SHORT_DATE_FORMAT

'm/d/Y'

TEST_RUNNER

'django_nose.NoseTestSuiteRunner'

CACHE_MIDDLEWARE_KEY_PREFIX

u'********************'

TIME_ZONE

'America/Chicago'

FILE_UPLOAD_MAX_MEMORY_SIZE

2621440

EMAIL_BACKEND

'django.core.mail.backends.smtp.EmailBackend'

DEFAULT_TABLESPACE

''

TEMPLATE_CONTEXT_PROCESSORS

('django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
'utils.context_processors.settings.GOOGLE_ANALYTICS_ACCOUNT')

SESSION_COOKIE_AGE

1209600

SETTINGS_MODULE

'councilmatic.settings'

USE_ETAGS

False

LANGUAGES_BIDI

('he', 'ar', 'fa')

DEFAULT_INDEX_TABLESPACE

''

INTERNAL_IPS

('127.0.0.1',)

STATIC_URL

'/static/'

EMAIL_PORT

25

USE_TZ

False

SHORT_DATETIME_FORMAT

'm/d/Y P'

PASSWORD_HASHERS

u'********************'

HAYSTACK_ITERATOR_LOAD_PER_QUERY

800

ABSOLUTE_URL_OVERRIDES

{}

CACHE_MIDDLEWARE_SECONDS

600

DEBUG_TOOLBAR_CONFIG

{'INTERCEPT_REDIRECTS': False}

DB_HOST

u'councilmatic-YGFXOXWC.dotcloud.com'

DATETIME_INPUT_FORMATS

('%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M',
'%m/%d/%y')

EMAIL_HOST_USER

''

PROFANITIES_LIST

u'********************'

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page.

Create a local sample project for others to get started from

The structure of Councilmatic has changed in an attempt to make it a little easier to deploy. The core of Councilmatic (essentially this repository) is no longer meant to be forked whenever someone wants to set up a new instance. Instead, this core should be treated like a library (a Django app) that a local project will install and include. For example, see https://github.com/mjumbewu/philly-councilmatic and https://github.com/mjumbewu/chicago-councilmatic.

We need a solid sample local project for others to fork that includes examples of:

  • where to put initial data such as council members and pictures
  • how to customize templates
  • how to customize views and queries
  • how to add components that aren't in core

Error when setting up superadmin

Got the following error when running the setup procedure the first time. Was able to get past it by manually setting the is_superuser = 1 manually

python manage.py syncdb

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'ec2-user'): 
E-mail address: [email]
Password: 
Password (again): 
Traceback (most recent call last):
  File "manage.py", line 11, in 
    execute_from_command_line(sys.argv)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/south/management/commands/syncdb.py", line 90, in handle_noargs
    syncdb.Command().execute(**options)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 73, in create_superuser
    call_command("createsuperuser", interactive=True, database=db)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/__init__.py", line 150, in call_command
    return klass.execute(*args, **defaults)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 124, in handle
    User.objects.db_manager(database).create_superuser(username, email, password)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/contrib/auth/models.py", line 164, in create_superuser
    u = self.create_user(username, email, password)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/contrib/auth/models.py", line 160, in create_user
    user.save(using=self._db)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/base.py", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/base.py", line 565, in save_base
    created=(not record_exists), raw=raw, using=using)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/ec2-user/councilmatic/councilmatic/subscriptions/models.py", line 139, in create_subscriber_for_user
    user.subscriber.save()
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/base.py", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/base.py", line 506, in save_base
    self.save_base(cls=parent, origin=org, using=using)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/base.py", line 524, in save_base
    manager.using(using).filter(pk=pk_val).exists())):
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/query.py", line 562, in exists
    return self.query.has_results(using=self.db)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/sql/query.py", line 441, in has_results
    return bool(compiler.execute_sql(SINGLE))
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
    cursor.execute(sql, params)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/backends/util.py", line 40, in execute
    return self.cursor.execute(sql, params)
  File "/home/ec2-user/councilmatic/.env/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
    return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block

Disable social media sign in

Without a pipeline requiring your email address, and no way to edit your account to provide an email address, social media sign-in is just dangerous.

Allow search ordering by date

Right now they're ordered by whatever the default ordering for haystack/whoosh is. It might be relevance, and that's fine, but there should be an order-by-date option.

Add support for caching

Should cache most of the content on the home page template, on all of the individual legislation page templates, and the teasers on the search listing. Should also cache subscription info in subscriptions.models.Subscriber.

heroku ssl issue on custom domain

Hi,

When I navigate to the site, I'm directed to http, rather than https. If I try to navigate directly to https, Chrome flags the cert as untrusted, because the cert is for *.heroku-app.com, not for your custom domain. I think this is an issue with using custom domains for heroku apps.

Nate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.