IntegrityError at /classes/169/ (1062, "Duplicate entry '538-169' for key 'user_id'") Request Method:	POST Request URL:	http://chiport.mysqool.com/classes/169/ Django Version:	1.4 Exception Type:	IntegrityError Exception Value:	 (1062, "Duplicate entry '538-169' for key 'user_id'") Exception Location:	/home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/MySQLdb/connections.py in defaulterrorhandler, line 36 Python Executable:	/usr/bin/python Python Version:	2.7.3 Python Path:	 ['/home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',  '/home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/pip-1.1-py2.7.egg',  '/home/ubuntu/sites/mysqool/pyenv/src/ajax-select',  '/home/ubuntu/sites/mysqool',  '/home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages',  '/home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/PIL',  '/usr/lib/python2.7',  '/usr/lib/python2.7/plat-linux2',  '/usr/lib/python2.7/lib-tk',  '/usr/lib/python2.7/lib-old',  '/usr/lib/python2.7/lib-dynload',  '/usr/local/lib/python2.7/dist-packages',  '/usr/lib/python2.7/dist-packages',  '/home/ubuntu/sites/mysqool',  '/home/ubuntu/sites/mysqool/apps',  '/home/ubuntu/sites/mysqool/mysqool',  '/home/ubuntu/sites/mysqool/mysqool/../apps/',  '/home/ubuntu/sites/mysqool/mysqool/'] Server time:	Mon, 22 Oct 2012 10:24:41 -0500 Traceback Switch to copy-and-paste view  /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/core/handlers/base.py in get_response                         response = callback(request, *callback_args, **callback_kwargs) ... ▶ Local vars /home/ubuntu/sites/mysqool/apps/classes/views/klass.py in class_detail                                               transaction=class_transaction) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/models/manager.py in create         return self.get_query_set().create(**kwargs) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/models/query.py in create         obj.save(force_insert=True, using=self.db) ... ▶ Local vars /home/ubuntu/sites/mysqool/apps/enrollment/models.py in save         super(Enrollment, self).save(*args, **kwargs) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/models/base.py in save         self.save_base(using=using, force_insert=force_insert, force_update=force_update) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/models/base.py in save_base                 result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/models/manager.py in _insert         return insert_query(self.model, objs, fields, **kwargs) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/models/query.py in insert_query     return query.get_compiler(using=using).execute_sql(return_id) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py in execute_sql             cursor.execute(sql, params) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/backends/util.py in execute             return self.cursor.execute(sql, params) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/django/db/backends/mysql/base.py in execute             return self.cursor.execute(query, args) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/MySQLdb/cursors.py in execute             self.errorhandler(self, exc, value) ... ▶ Local vars /home/ubuntu/sites/mysqool/pyenv/lib/python2.7/site-packages/MySQLdb/connections.py in defaulterrorhandler     raise errorclass, errorvalue ... ▶ Local vars Request information  GET No GET data POST Variable	Value enroll	 u'Enroll' csrfmiddlewaretoken	 u'EY4XM6MqG0yE6afiqZtGwFh2v511Y4TT' users	 u'310' FILES No FILES data COOKIES Variable	Value csrftoken	 'EY4XM6MqG0yE6afiqZtGwFh2v511Y4TT' sessionid	 'ddb59a24417d9786170978a5346e3c9b' META Variable	Value mod_wsgi.listener_port	 '80' HTTP_REFERER	 'http://chiport.mysqool.com/classes/169/' mod_wsgi.listener_host	 '' SERVER_SOFTWARE	 'Apache/2.2.22 (Ubuntu)' SCRIPT_NAME	 u'' mod_wsgi.handler_script	 '' SERVER_SIGNATURE	 '<address>Apache/2.2.22 (Ubuntu) Server at chiport.mysqool.com Port 80</address>\n' REQUEST_METHOD	 'POST' PATH_INFO	 u'/classes/169/' HTTP_ORIGIN	 'http://chiport.mysqool.com' SERVER_PROTOCOL	 'HTTP/1.1' QUERY_STRING	 '' CONTENT_LENGTH	 '86' HTTP_USER_AGENT	 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25' HTTP_CONNECTION	 'keep-alive' HTTP_COOKIE	 'csrftoken=EY4XM6MqG0yE6afiqZtGwFh2v511Y4TT; sessionid=ddb59a24417d9786170978a5346e3c9b' SERVER_NAME	 'chiport.mysqool.com' REMOTE_ADDR	 '71.201.52.157' mod_wsgi.request_handler	 'wsgi-script' wsgi.url_scheme	 'http' PATH_TRANSLATED	 '/home/ubuntu/sites/mysqool/mysqool.wsgi/classes/169/' SERVER_PORT	 '80' wsgi.multiprocess	 True mod_wsgi.input_chunked	 '0' SERVER_ADDR	 '10.39.97.132' DOCUMENT_ROOT	 '/etc/apache2/htdocs' mod_wsgi.process_group	 '' SCRIPT_FILENAME	 '/home/ubuntu/sites/mysqool/mysqool.wsgi' SERVER_ADMIN	 'info@mysqool.com' wsgi.input	 <mod_wsgi.Input object at 0x7f847d321c70> HTTP_HOST	 'chiport.mysqool.com' wsgi.multithread	 True mod_wsgi.callable_object	 'application' REQUEST_URI	 '/classes/169/' HTTP_ACCEPT	 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' wsgi.version	 (1, 1) GATEWAY_INTERFACE	 'CGI/1.1' wsgi.run_once	 False wsgi.errors	 <mod_wsgi.Log object at 0x7f847d321af0> REMOTE_PORT	 '57290' HTTP_ACCEPT_LANGUAGE	 'en-us' mod_wsgi.version	 (3, 3) CONTENT_TYPE	 'application/x-www-form-urlencoded' mod_wsgi.application_group	 'staging.mysqool.com|' mod_wsgi.script_reloading	 '1' wsgi.file_wrapper	 '' CSRF_COOKIE	 'EY4XM6MqG0yE6afiqZtGwFh2v511Y4TT' HTTP_ACCEPT_ENCODING	 'gzip, deflate' Settings Using settings module mysqool.settings Setting	Value USE_L10N	 False USE_THOUSAND_SEPARATOR	 False CSRF_COOKIE_SECURE	 False LANGUAGE_CODE	 'en-us' ROOT_URLCONF	 'mysqool.urls' MANAGERS	 (('', ''),) DEFAULT_CHARSET	 'utf-8' STATIC_ROOT	 '/home/ubuntu/sites/mysqool/mysqool/static/' MESSAGE_STORAGE	 'django.contrib.messages.storage.fallback.FallbackStorage' 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') SESSION_COOKIE_DOMAIN	 None SESSION_COOKIE_NAME	 'sessionid' ADMIN_FOR	 () TIME_INPUT_FORMATS	 ('%H:%M %p', '%P', '%H:%M%A', '%H:%M %A', '%H:%M%a', '%H:%M %a') DATABASES	 {'default': {'ENGINE': 'django.db.backends.mysql',              'HOST': '',              'NAME': 'mysqool',              'OPTIONS': {},              'PASSWORD': u'********************',              'PORT': '',              'TEST_CHARSET': None,              'TEST_COLLATION': None,              'TEST_MIRROR': None,              'TEST_NAME': None,              'TIME_ZONE': 'America/Chicago',              'USER': 'mysqool'}} FILE_UPLOAD_PERMISSIONS	 None FILE_UPLOAD_HANDLERS	 ('django.core.files.uploadhandler.MemoryFileUploadHandler',  'django.core.files.uploadhandler.TemporaryFileUploadHandler') DEFAULT_CONTENT_TYPE	 'text/html' TEST_RUNNER	 'django.test.simple.DjangoTestSuiteRunner' AJAX_SELECT_BOOTSTRAP	 True APPEND_SLASH	 True FIRST_DAY_OF_WEEK	 0 DATABASE_ROUTERS	 [] YEAR_MONTH_FORMAT	 'F Y' STATICFILES_STORAGE	 'django.contrib.staticfiles.storage.StaticFilesStorage' CACHES	 {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',              'LOCATION': ''}} SERVER_EMAIL	 'noreply@mysqool.com' SESSION_COOKIE_PATH	 '/' USE_X_FORWARDED_HOST	 False MIDDLEWARE_CLASSES	 ('mediagenerator.middleware.MediaMiddleware',  'django.middleware.common.CommonMiddleware',  'django.contrib.sessions.middleware.SessionMiddleware',  'django.middleware.csrf.CsrfViewMiddleware',  'django.contrib.auth.middleware.AuthenticationMiddleware',  'django.contrib.messages.middleware.MessageMiddleware',  'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',  'debug_toolbar.middleware.DebugToolbarMiddleware',  'mysqool.middleware.authentication.EnforceLoginMiddleware') USE_I18N	 False THOUSAND_SEPARATOR	 ',' SECRET_KEY	 u'********************' LANGUAGE_COOKIE_NAME	 'django_language' DEFAULT_INDEX_TABLESPACE	 '' TRANSACTIONS_MANAGED	 False LOGGING_CONFIG	 'django.utils.log.dictConfig' TEMPLATE_LOADERS	 ('django.template.loaders.filesystem.Loader',  'django.template.loaders.app_directories.Loader') WSGI_APPLICATION	 'mysqool.wsgi.application' TEMPLATE_DEBUG	 True X_FRAME_OPTIONS	 'SAMEORIGIN' AUTHENTICATION_BACKENDS	 ('mysqool.backends.authentication.EmailOrUsernameModelBackend',  'django.contrib.auth.backends.ModelBackend') FORCE_SCRIPT_NAME	 None CACHE_BACKEND	 'locmem://' SIGNING_BACKEND	 'django.core.signing.TimestampSigner' 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.humanize',  'django.contrib.sessions',  'django.contrib.sites',  'django.contrib.messages',  'django.contrib.staticfiles',  'django.contrib.flatpages',  'django.contrib.admin',  'django.contrib.webdesign',  'administration',  'attendance',  'calendars',  'classes',  'dashboard',  'enrollment',  'helper',  'people',  'schools',  'transactions',  'mediagenerator',  'widget_tweaks',  'crispy_forms',  'ajax_select',  'debug_toolbar',  'registration',  'profiles',  'oembed',  'south',  'tagging') 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 STATICFILES_DIRS	 ('/home/ubuntu/sites/mysqool/mysqool/static-files/',) PREPEND_WWW	 False SECURE_PROXY_SSL_HEADER	 None AUTH_PROFILE_MODULE	 'people.Profile' SESSION_COOKIE_HTTPONLY	 True DEBUG_PROPAGATE_EXCEPTIONS	 False CACHE_MIDDLEWARE_ALIAS	 'default' MONTH_DAY_FORMAT	 'F j' LOGIN_URL	 '/login/' SESSION_EXPIRE_AT_BROWSER_CLOSE	 False TIME_FORMAT	 ('%I:%M %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') CSRF_COOKIE_NAME	 'csrftoken' EMAIL_HOST_PASSWORD	 u'********************' PASSWORD_RESET_TIMEOUT_DAYS	 u'********************' AJAX_LOOKUP_CHANNELS	 {'student_name': ('schools.lookups', 'UserLookup')} SESSION_SAVE_EVERY_REQUEST	 False ADMIN_MEDIA_PREFIX	 '/static//admin/' NUMBER_GROUPING	 0 SESSION_ENGINE	 'django.contrib.sessions.backends.db' CSRF_FAILURE_VIEW	 'django.views.csrf.csrf_failure' CSRF_COOKIE_PATH	 '/' LOGIN_REDIRECT_URL	 '/' PUBLIC_URLS	 ('api/', 'login/', 'logout/', 'registration/password/reset/(.*)') PROJECT_ROOT	 '/home/ubuntu/sites/mysqool/mysqool' LOGGING	 {'disable_existing_loggers': False,  'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},  'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',                               'filters': ['require_debug_false'],                               'level': 'ERROR'}},  'loggers': {'django.request': {'handlers': ['mail_admins'],                                 'level': 'ERROR',                                 'propagate': True}},  'version': 1} IGNORABLE_404_URLS	 () LOCALE_PATHS	 () TEMPLATE_STRING_IF_INVALID	 '' LOGOUT_URL	 '/accounts/logout/' EMAIL_USE_TLS	 True FIXTURE_DIRS	 () EMAIL_HOST	 'smtp.sendgrid.net' DATE_FORMAT	 'N j, Y' MEDIA_ROOT	 '/home/ubuntu/sites/mysqool/mysqool/media/' DEFAULT_EXCEPTION_REPORTER_FILTER	 'django.views.debug.SafeExceptionReporterFilter' ADMINS	 (('', ''),) FORMAT_MODULE_PATH	 None DEFAULT_FROM_EMAIL	 'noreply@mysqool.com' MEDIA_URL	 '/media/' DATETIME_FORMAT	 'N j, Y, P' TEMPLATE_DIRS	 ('/home/ubuntu/sites/mysqool/mysqool/templates',) DIF	 ('%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') SITE_ID	 1 DISALLOWED_USER_AGENTS	 () ALLOWED_INCLUDE_ROOTS	 () DECIMAL_SEPARATOR	 '.' SHORT_DATE_FORMAT	 'm/d/Y' AJAX_SELECT_INLINES	 'inline' 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.core.context_processors.request',  'django.core.context_processors.tz',  'django.contrib.messages.context_processors.messages',  'mysqool.context_processors.school_info') SESSION_COOKIE_AGE	 86400 SETTINGS_MODULE	 'mysqool.settings' USE_ETAGS	 False LANGUAGES_BIDI	 ('he', 'ar', 'fa') FILE_UPLOAD_TEMP_DIR	 None INTERNAL_IPS	 ('127.0.0.1',) STATIC_URL	 '/static/' EMAIL_PORT	 587 USE_TZ	 False SHORT_DATETIME_FORMAT	 'm/d/Y P' PASSWORD_HASHERS	 u'********************' ABSOLUTE_URL_OVERRIDES	 {} CACHE_MIDDLEWARE_SECONDS	 600 DEBUG_TOOLBAR_CONFIG	 {'INTERCEPT_REDIRECTS': False} 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',  '%m/%d/%Y %I:%M %p',  '%m/%d/%Y %I:%M%p') EMAIL_HOST_USER	 'sandersnewmedia' 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.