diff --git a/docs/api/api.ipynb b/docs/api/api.ipynb index e80f81cc..cd2d3dfa 100644 --- a/docs/api/api.ipynb +++ b/docs/api/api.ipynb @@ -206,7 +206,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -236,7 +236,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -244,7 +244,7 @@ "output_type": "stream", "text": [ "{\n", - " \"count\": 1,\n", + " \"count\": 3,\n", " \"next\": null,\n", " \"previous\": null,\n", " \"results\": [\n", @@ -252,6 +252,16 @@ " \"id\": 1,\n", " \"first_name\": \"Lucek\",\n", " \"last_name\": \"Grzegorzewski\"\n", + " },\n", + " {\n", + " \"id\": 16,\n", + " \"first_name\": \"Marika T\",\n", + " \"last_name\": \"Granfors\"\n", + " },\n", + " {\n", + " \"id\": 42,\n", + " \"first_name\": \"L\",\n", + " \"last_name\": \"Granit\"\n", " }\n", " ]\n", "}\n" @@ -260,7 +270,7 @@ ], "source": [ "# Search for author\n", - "data = client.action(document, [\"authors\", \"list\"], params={\"search\":\"Gr\"} )\n", + "data = client.action(document, [\"authors\", \"list\"], params={\"search\": \"Gr\"} )\n", "print(json.dumps(data, indent=2))" ] }, @@ -272,17 +282,36 @@ }, "outputs": [ { - "ename": "ErrorMessage", - "evalue": "\n message: \"ProgrammingError at /api/v1/studies/\n column studies_study.abstract does not exist\n LINE 1: ... \\\"studies_study\\\".\\\"title\\\", \\\"studies_study\\\".\\\"pmid\\\", \\\"studies_s...\n ^\n \n \n Request Method: POST\n Request URL: http://0.0.0.0:8000/api/v1/studies/\n Django Version: 2.0.6\n Python Executable: /usr/local/bin/python\n Python Version: 3.6.6\n Python Path: ['/code', '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', '/usr/local/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/site-packages']\n Server time: Fri, 29 Jun 2018 14:19:48 +0000\n Installed Applications:\n ('django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'rest_framework',\n 'rest_framework.authtoken',\n 'django_filters',\n 'rest_framework_swagger',\n 'pkdb_app.users',\n 'pkdb_app.studies',\n 'pkdb_app.subjects',\n 'django_nose')\n Installed Middleware:\n ('django.middleware.security.SecurityMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware')\n \n \n Traceback:\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute\n 85. return self.cursor.execute(sql, params)\n \n The above exception (column studies_study.abstract does not exist\n LINE 1: ... \\\"studies_study\\\".\\\"title\\\", \\\"studies_study\\\".\\\"pmid\\\", \\\"studies_s...\n ^\n ) was the direct cause of the following exception:\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py\\\" in inner\n 35. response = get_response(request)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py\\\" in _get_response\n 128. response = self.process_exception_by_middleware(e, request)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py\\\" in _get_response\n 126. response = wrapped_callback(request, *callback_args, **callback_kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py\\\" in wrapped_view\n 54. return view_func(*args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/viewsets.py\\\" in view\n 103. return self.dispatch(request, *args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/views.py\\\" in dispatch\n 483. response = self.handle_exception(exc)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/views.py\\\" in handle_exception\n 443. self.raise_uncaught_exception(exc)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/views.py\\\" in dispatch\n 480. response = handler(request, *args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/mixins.py\\\" in create\n 21. self.perform_create(serializer)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/mixins.py\\\" in perform_create\n 26. serializer.save()\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/serializers.py\\\" in save\n 214. self.instance = self.create(validated_data)\n \n File \\\"/code/pkdb_app/studies/serializers.py\\\" in create\n 38. study, _ = Study.objects.update_or_create(pmid=validated_data[\\\"pmid\\\"],defaults = validated_data)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/manager.py\\\" in manager_method\n 82. return getattr(self.get_queryset(), name)(*args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in update_or_create\n 503. obj = self.select_for_update().get(**lookup)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in get\n 397. num = len(clone)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in __len__\n 254. self._fetch_all()\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in _fetch_all\n 1179. self._result_cache = list(self._iterable_class(self))\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in __iter__\n 53. results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\\\" in execute_sql\n 1068. cursor.execute(sql, params)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in execute\n 100. return super().execute(sql, params)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in execute\n 68. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute_with_wrappers\n 77. return executor(sql, params, many, context)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute\n 85. return self.cursor.execute(sql, params)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/utils.py\\\" in __exit__\n 89. raise dj_exc_value.with_traceback(traceback) from exc_value\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute\n 85. return self.cursor.execute(sql, params)\n \n Exception Type: ProgrammingError at /api/v1/studies/\n Exception Value: column studies_study.abstract does not exist\n LINE 1: ... \\\"studies_study\\\".\\\"title\\\", \\\"studies_study\\\".\\\"pmid\\\", \\\"studies_s...\n ^\n \n Request information:\n USER: AnonymousUser\n \n GET: No GET data\n \n POST: No POST data\n \n FILES: No FILES data\n \n COOKIES: No cookie data\n \n META:\n CONTENT_LENGTH = '313'\n CONTENT_TYPE = 'application/json'\n DJANGO_CONFIGURATION = 'Local'\n DJANGO_SECRET_KEY = 'local'\n DJANGO_SETTINGS_MODULE = 'pkdb_app.config'\n GATEWAY_INTERFACE = 'CGI/1.1'\n GPG_KEY = '0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D'\n HOME = '/root'\n HOSTNAME = '31d04f34d3ce'\n HTTP_ACCEPT = 'application/coreapi+json, application/vnd.coreapi+json, */*'\n HTTP_ACCEPT_ENCODING = 'gzip, deflate'\n HTTP_CONNECTION = 'keep-alive'\n HTTP_HOST = '0.0.0.0:8000'\n HTTP_USER_AGENT = 'coreapi'\n LANG = 'C.UTF-8'\n PATH = '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'\n PATH_INFO = '/api/v1/studies/'\n PWD = '/code'\n PYTHONUNBUFFERED = '1'\n PYTHON_PIP_VERSION = '10.0.1'\n PYTHON_VERSION = '3.6.6'\n QUERY_STRING = ''\n REMOTE_ADDR = '172.18.0.1'\n REMOTE_HOST = ''\n REQUEST_METHOD = 'POST'\n RUN_MAIN = 'true'\n SCRIPT_NAME = ''\n SERVER_NAME = '31d04f34d3ce'\n SERVER_PORT = '8000'\n SERVER_PROTOCOL = 'HTTP/1.1'\n SERVER_SOFTWARE = 'WSGIServer/0.2'\n SHLVL = '1'\n TZ = 'UTC'\n _ = './manage.py'\n wsgi.errors = <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'>\n wsgi.file_wrapper = ''\n wsgi.input = <_io.BufferedReader name=5>\n wsgi.multiprocess = False\n wsgi.multithread = True\n wsgi.run_once = False\n wsgi.url_scheme = 'http'\n wsgi.version = '(1, 0)'\n \n Settings:\n Using settings module pkdb_app.config\n ABSOLUTE_URL_OVERRIDES = {}\n ADMINS = \\\"(('Author', 'janekg89@hotmail.de'),)\\\"\n ALLOWED_HOSTS = ['*']\n APPEND_SLASH = False\n AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']\n AUTH_PASSWORD_VALIDATORS = '********************'\n AUTH_USER_MODEL = 'users.User'\n CACHES = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}\n CACHE_MIDDLEWARE_ALIAS = 'default'\n CACHE_MIDDLEWARE_KEY_PREFIX = '********************'\n CACHE_MIDDLEWARE_SECONDS = 600\n CONFIGURATION = 'pkdb_app.config.Local'\n CSRF_COOKIE_AGE = 31449600\n CSRF_COOKIE_DOMAIN = None\n CSRF_COOKIE_HTTPONLY = False\n CSRF_COOKIE_NAME = 'csrftoken'\n CSRF_COOKIE_PATH = '/'\n CSRF_COOKIE_SECURE = False\n CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'\n CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'\n CSRF_TRUSTED_ORIGINS = []\n CSRF_USE_SESSIONS = False\n DATABASES = {'default': {'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': '********************', 'HOST': 'postgres', 'PORT': 5432, 'CONN_MAX_AGE': 600, 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'OPTIONS': {}, 'TIME_ZONE': None, 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}}\n DATABASE_ROUTERS = []\n DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440\n DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000\n DATETIME_FORMAT = 'N j, Y, P'\n 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']\n DATE_FORMAT = 'N j, Y'\n 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']\n DEBUG = True\n DEBUG_PROPAGATE_EXCEPTIONS = False\n DECIMAL_SEPARATOR = '.'\n DEFAULT_CHARSET = 'utf-8'\n DEFAULT_CONTENT_TYPE = 'text/html'\n DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter'\n DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'\n DEFAULT_FROM_EMAIL = 'webmaster@localhost'\n DEFAULT_INDEX_TABLESPACE = ''\n DEFAULT_TABLESPACE = ''\n DISALLOWED_USER_AGENTS = []\n DOTENV_LOADED = None\n EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n EMAIL_HOST = 'localhost'\n EMAIL_HOST_PASSWORD = '********************'\n EMAIL_HOST_USER = ''\n EMAIL_PORT = 1025\n EMAIL_SSL_CERTFILE = None\n EMAIL_SSL_KEYFILE = '********************'\n EMAIL_SUBJECT_PREFIX = '[Django] '\n EMAIL_TIMEOUT = None\n EMAIL_USE_LOCALTIME = False\n EMAIL_USE_SSL = False\n EMAIL_USE_TLS = False\n FILE_CHARSET = 'utf-8'\n FILE_UPLOAD_DIRECTORY_PERMISSIONS = None\n FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler']\n FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440\n FILE_UPLOAD_PERMISSIONS = None\n FILE_UPLOAD_TEMP_DIR = None\n FIRST_DAY_OF_WEEK = 0\n FIXTURE_DIRS = []\n FORCE_SCRIPT_NAME = None\n FORMAT_MODULE_PATH = None\n FORM_RENDERER = 'django.forms.renderers.DjangoTemplates'\n IGNORABLE_404_URLS = []\n INSTALLED_APPS = \\\"('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'rest_framework.authtoken', 'django_filters', 'rest_framework_swagger', 'pkdb_app.users', 'pkdb_app.studies', 'pkdb_app.subjects', 'django_nose')\\\"\n INTERNAL_IPS = []\n LANGUAGES = [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokm\\u00e5l'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('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'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]\n LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']\n LANGUAGE_CODE = 'en-us'\n LANGUAGE_COOKIE_AGE = None\n LANGUAGE_COOKIE_DOMAIN = None\n LANGUAGE_COOKIE_NAME = 'django_language'\n LANGUAGE_COOKIE_PATH = '/'\n LOCALE_PATHS = []\n LOGGING = {'version': 1, 'disable_existing_loggers': False, 'formatters': {'django.server': {'()': 'django.utils.log.ServerFormatter', 'format': '[%(server_time)s] %(message)s'}, 'verbose': {'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'}, 'simple': {'format': '%(levelname)s %(message)s'}}, 'filters': {'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}}, 'handlers': {'django.server': {'level': 'INFO', 'class': 'logging.StreamHandler', 'formatter': 'django.server'}, 'console': {'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'simple'}, 'mail_admins': {'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler'}}, 'loggers': {'django': {'handlers': ['console'], 'propagate': True}, 'django.server': {'handlers': ['django.server'], 'level': 'INFO', 'propagate': False}, 'django.request': {'handlers': ['mail_admins', 'console'], 'level': 'ERROR', 'propagate': False}, 'django.db.backends': {'handlers': ['console'], 'level': 'INFO'}}}\n LOGGING_CONFIG = 'logging.config.dictConfig'\n LOGIN_REDIRECT_URL = '/'\n LOGIN_URL = 'rest_framework:login'\n LOGOUT_REDIRECT_URL = None\n LOGOUT_URL = 'rest_framework:logout'\n MANAGERS = []\n MEDIA_ROOT = '/code/media'\n MEDIA_URL = '/media/'\n MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'\n MIDDLEWARE = \\\"('django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')\\\"\n MIGRATION_MODULES = {}\n MONTH_DAY_FORMAT = 'F j'\n NOSE_ARGS = ['/code/pkdb_app', '-s', '--nologcapture', '--with-coverage', '--with-progressive', '--cover-package=pkdb']\n NUMBER_GROUPING = 0\n PASSWORD_HASHERS = '********************'\n PASSWORD_RESET_TIMEOUT_DAYS = '********************'\n PREPEND_WWW = False\n REST_FRAMEWORK = {'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'PAGE_SIZE': 10, 'DATETIME_FORMAT': '%Y-%m-%dT%H:%M:%S%z', 'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer', 'rest_framework.renderers.BrowsableAPIRenderer'), 'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.AllowAny'], 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.SessionAuthentication',), 'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',)}\n ROOT_URLCONF = 'pkdb_app.urls'\n SECRET_KEY = '********************'\n SECURE_BROWSER_XSS_FILTER = False\n SECURE_CONTENT_TYPE_NOSNIFF = False\n SECURE_HSTS_INCLUDE_SUBDOMAINS = False\n SECURE_HSTS_PRELOAD = False\n SECURE_HSTS_SECONDS = 0\n SECURE_PROXY_SSL_HEADER = None\n SECURE_REDIRECT_EXEMPT = []\n SECURE_SSL_HOST = None\n SECURE_SSL_REDIRECT = False\n SERVER_EMAIL = 'root@localhost'\n SESSION_CACHE_ALIAS = 'default'\n SESSION_COOKIE_AGE = 1209600\n SESSION_COOKIE_DOMAIN = None\n SESSION_COOKIE_HTTPONLY = True\n SESSION_COOKIE_NAME = 'sessionid'\n SESSION_COOKIE_PATH = '/'\n SESSION_COOKIE_SECURE = False\n SESSION_ENGINE = 'django.contrib.sessions.backends.db'\n SESSION_EXPIRE_AT_BROWSER_CLOSE = False\n SESSION_FILE_PATH = None\n SESSION_SAVE_EVERY_REQUEST = False\n SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'\n SETTINGS_MODULE = 'pkdb_app.config'\n SHORT_DATETIME_FORMAT = 'm/d/Y P'\n SHORT_DATE_FORMAT = 'm/d/Y'\n SIGNING_BACKEND = 'django.core.signing.TimestampSigner'\n SILENCED_SYSTEM_CHECKS = []\n STATICFILES_DIRS = []\n STATICFILES_FINDERS = \\\"('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder')\\\"\n STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'\n STATIC_ROOT = '/code/static'\n STATIC_URL = '/static/'\n SWAGGER_SETTINGS = {'LOGIN_URL': 'rest_framework:login', 'LOGOUT_URL': 'rest_framework:logout', 'USE_SESSION_AUTH': True, 'DOC_EXPANSION': 'list', 'APIS_SORTER': '********************', 'SECURITY_DEFINITIONS': {'basic': {'type': 'basic'}}}\n TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages']}}]\n TEST_NON_SERIALIZED_APPS = []\n TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'\n THOUSAND_SEPARATOR = ','\n TIME_FORMAT = 'P'\n TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']\n TIME_ZONE = 'UTC'\n USE_ETAGS = False\n USE_I18N = False\n USE_L10N = True\n USE_THOUSAND_SEPARATOR = False\n USE_TZ = True\n USE_X_FORWARDED_HOST = False\n USE_X_FORWARDED_PORT = False\n WSGI_APPLICATION = 'pkdb_app.wsgi.application'\n X_FRAME_OPTIONS = 'SAMEORIGIN'\n YEAR_MONTH_FORMAT = 'F Y'\n \n \n You're seeing this error because you have DEBUG = True in your\n Django settings file. Change that to False, and Django will\n display a standard page generated by the handler for this status code.\n \n \"", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mErrorMessage\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 12\u001b[0m ]\n\u001b[1;32m 13\u001b[0m }\n\u001b[0;32m---> 14\u001b[0;31m \u001b[0mclient\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maction\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdocument\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"studies\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"create\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstudy_dict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m~/envs/pkdb/lib/python3.6/site-packages/coreapi/client.py\u001b[0m in \u001b[0;36maction\u001b[0;34m(self, document, keys, params, validate, overrides, action, encoding, transform)\u001b[0m\n\u001b[1;32m 176\u001b[0m \u001b[0;31m# Perform the action, and return a new document.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 177\u001b[0m \u001b[0mtransport\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdetermine_transport\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtransports\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlink\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 178\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mtransport\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtransition\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlink\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecoders\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mparams\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlink_ancestors\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mlink_ancestors\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m~/envs/pkdb/lib/python3.6/site-packages/coreapi/transports/http.py\u001b[0m in \u001b[0;36mtransition\u001b[0;34m(self, link, decoders, params, link_ancestors, force_codec)\u001b[0m\n\u001b[1;32m 384\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 385\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mError\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 386\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mexceptions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mErrorMessage\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 387\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 388\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mErrorMessage\u001b[0m: \n message: \"ProgrammingError at /api/v1/studies/\n column studies_study.abstract does not exist\n LINE 1: ... \\\"studies_study\\\".\\\"title\\\", \\\"studies_study\\\".\\\"pmid\\\", \\\"studies_s...\n ^\n \n \n Request Method: POST\n Request URL: http://0.0.0.0:8000/api/v1/studies/\n Django Version: 2.0.6\n Python Executable: /usr/local/bin/python\n Python Version: 3.6.6\n Python Path: ['/code', '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', '/usr/local/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/site-packages']\n Server time: Fri, 29 Jun 2018 14:19:48 +0000\n Installed Applications:\n ('django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'rest_framework',\n 'rest_framework.authtoken',\n 'django_filters',\n 'rest_framework_swagger',\n 'pkdb_app.users',\n 'pkdb_app.studies',\n 'pkdb_app.subjects',\n 'django_nose')\n Installed Middleware:\n ('django.middleware.security.SecurityMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware')\n \n \n Traceback:\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute\n 85. return self.cursor.execute(sql, params)\n \n The above exception (column studies_study.abstract does not exist\n LINE 1: ... \\\"studies_study\\\".\\\"title\\\", \\\"studies_study\\\".\\\"pmid\\\", \\\"studies_s...\n ^\n ) was the direct cause of the following exception:\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py\\\" in inner\n 35. response = get_response(request)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py\\\" in _get_response\n 128. response = self.process_exception_by_middleware(e, request)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py\\\" in _get_response\n 126. response = wrapped_callback(request, *callback_args, **callback_kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py\\\" in wrapped_view\n 54. return view_func(*args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/viewsets.py\\\" in view\n 103. return self.dispatch(request, *args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/views.py\\\" in dispatch\n 483. response = self.handle_exception(exc)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/views.py\\\" in handle_exception\n 443. self.raise_uncaught_exception(exc)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/views.py\\\" in dispatch\n 480. response = handler(request, *args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/mixins.py\\\" in create\n 21. self.perform_create(serializer)\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/mixins.py\\\" in perform_create\n 26. serializer.save()\n \n File \\\"/usr/local/lib/python3.6/site-packages/rest_framework/serializers.py\\\" in save\n 214. self.instance = self.create(validated_data)\n \n File \\\"/code/pkdb_app/studies/serializers.py\\\" in create\n 38. study, _ = Study.objects.update_or_create(pmid=validated_data[\\\"pmid\\\"],defaults = validated_data)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/manager.py\\\" in manager_method\n 82. return getattr(self.get_queryset(), name)(*args, **kwargs)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in update_or_create\n 503. obj = self.select_for_update().get(**lookup)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in get\n 397. num = len(clone)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in __len__\n 254. self._fetch_all()\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in _fetch_all\n 1179. self._result_cache = list(self._iterable_class(self))\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\\\" in __iter__\n 53. results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\\\" in execute_sql\n 1068. cursor.execute(sql, params)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in execute\n 100. return super().execute(sql, params)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in execute\n 68. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute_with_wrappers\n 77. return executor(sql, params, many, context)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute\n 85. return self.cursor.execute(sql, params)\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/utils.py\\\" in __exit__\n 89. raise dj_exc_value.with_traceback(traceback) from exc_value\n \n File \\\"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\\\" in _execute\n 85. return self.cursor.execute(sql, params)\n \n Exception Type: ProgrammingError at /api/v1/studies/\n Exception Value: column studies_study.abstract does not exist\n LINE 1: ... \\\"studies_study\\\".\\\"title\\\", \\\"studies_study\\\".\\\"pmid\\\", \\\"studies_s...\n ^\n \n Request information:\n USER: AnonymousUser\n \n GET: No GET data\n \n POST: No POST data\n \n FILES: No FILES data\n \n COOKIES: No cookie data\n \n META:\n CONTENT_LENGTH = '313'\n CONTENT_TYPE = 'application/json'\n DJANGO_CONFIGURATION = 'Local'\n DJANGO_SECRET_KEY = 'local'\n DJANGO_SETTINGS_MODULE = 'pkdb_app.config'\n GATEWAY_INTERFACE = 'CGI/1.1'\n GPG_KEY = '0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D'\n HOME = '/root'\n HOSTNAME = '31d04f34d3ce'\n HTTP_ACCEPT = 'application/coreapi+json, application/vnd.coreapi+json, */*'\n HTTP_ACCEPT_ENCODING = 'gzip, deflate'\n HTTP_CONNECTION = 'keep-alive'\n HTTP_HOST = '0.0.0.0:8000'\n HTTP_USER_AGENT = 'coreapi'\n LANG = 'C.UTF-8'\n PATH = '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'\n PATH_INFO = '/api/v1/studies/'\n PWD = '/code'\n PYTHONUNBUFFERED = '1'\n PYTHON_PIP_VERSION = '10.0.1'\n PYTHON_VERSION = '3.6.6'\n QUERY_STRING = ''\n REMOTE_ADDR = '172.18.0.1'\n REMOTE_HOST = ''\n REQUEST_METHOD = 'POST'\n RUN_MAIN = 'true'\n SCRIPT_NAME = ''\n SERVER_NAME = '31d04f34d3ce'\n SERVER_PORT = '8000'\n SERVER_PROTOCOL = 'HTTP/1.1'\n SERVER_SOFTWARE = 'WSGIServer/0.2'\n SHLVL = '1'\n TZ = 'UTC'\n _ = './manage.py'\n wsgi.errors = <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'>\n wsgi.file_wrapper = ''\n wsgi.input = <_io.BufferedReader name=5>\n wsgi.multiprocess = False\n wsgi.multithread = True\n wsgi.run_once = False\n wsgi.url_scheme = 'http'\n wsgi.version = '(1, 0)'\n \n Settings:\n Using settings module pkdb_app.config\n ABSOLUTE_URL_OVERRIDES = {}\n ADMINS = \\\"(('Author', 'janekg89@hotmail.de'),)\\\"\n ALLOWED_HOSTS = ['*']\n APPEND_SLASH = False\n AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']\n AUTH_PASSWORD_VALIDATORS = '********************'\n AUTH_USER_MODEL = 'users.User'\n CACHES = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}\n CACHE_MIDDLEWARE_ALIAS = 'default'\n CACHE_MIDDLEWARE_KEY_PREFIX = '********************'\n CACHE_MIDDLEWARE_SECONDS = 600\n CONFIGURATION = 'pkdb_app.config.Local'\n CSRF_COOKIE_AGE = 31449600\n CSRF_COOKIE_DOMAIN = None\n CSRF_COOKIE_HTTPONLY = False\n CSRF_COOKIE_NAME = 'csrftoken'\n CSRF_COOKIE_PATH = '/'\n CSRF_COOKIE_SECURE = False\n CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'\n CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'\n CSRF_TRUSTED_ORIGINS = []\n CSRF_USE_SESSIONS = False\n DATABASES = {'default': {'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': '********************', 'HOST': 'postgres', 'PORT': 5432, 'CONN_MAX_AGE': 600, 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'OPTIONS': {}, 'TIME_ZONE': None, 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}}\n DATABASE_ROUTERS = []\n DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440\n DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000\n DATETIME_FORMAT = 'N j, Y, P'\n 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']\n DATE_FORMAT = 'N j, Y'\n 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']\n DEBUG = True\n DEBUG_PROPAGATE_EXCEPTIONS = False\n DECIMAL_SEPARATOR = '.'\n DEFAULT_CHARSET = 'utf-8'\n DEFAULT_CONTENT_TYPE = 'text/html'\n DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter'\n DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'\n DEFAULT_FROM_EMAIL = 'webmaster@localhost'\n DEFAULT_INDEX_TABLESPACE = ''\n DEFAULT_TABLESPACE = ''\n DISALLOWED_USER_AGENTS = []\n DOTENV_LOADED = None\n EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n EMAIL_HOST = 'localhost'\n EMAIL_HOST_PASSWORD = '********************'\n EMAIL_HOST_USER = ''\n EMAIL_PORT = 1025\n EMAIL_SSL_CERTFILE = None\n EMAIL_SSL_KEYFILE = '********************'\n EMAIL_SUBJECT_PREFIX = '[Django] '\n EMAIL_TIMEOUT = None\n EMAIL_USE_LOCALTIME = False\n EMAIL_USE_SSL = False\n EMAIL_USE_TLS = False\n FILE_CHARSET = 'utf-8'\n FILE_UPLOAD_DIRECTORY_PERMISSIONS = None\n FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler']\n FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440\n FILE_UPLOAD_PERMISSIONS = None\n FILE_UPLOAD_TEMP_DIR = None\n FIRST_DAY_OF_WEEK = 0\n FIXTURE_DIRS = []\n FORCE_SCRIPT_NAME = None\n FORMAT_MODULE_PATH = None\n FORM_RENDERER = 'django.forms.renderers.DjangoTemplates'\n IGNORABLE_404_URLS = []\n INSTALLED_APPS = \\\"('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'rest_framework.authtoken', 'django_filters', 'rest_framework_swagger', 'pkdb_app.users', 'pkdb_app.studies', 'pkdb_app.subjects', 'django_nose')\\\"\n INTERNAL_IPS = []\n LANGUAGES = [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokm\\u00e5l'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('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'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]\n LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']\n LANGUAGE_CODE = 'en-us'\n LANGUAGE_COOKIE_AGE = None\n LANGUAGE_COOKIE_DOMAIN = None\n LANGUAGE_COOKIE_NAME = 'django_language'\n LANGUAGE_COOKIE_PATH = '/'\n LOCALE_PATHS = []\n LOGGING = {'version': 1, 'disable_existing_loggers': False, 'formatters': {'django.server': {'()': 'django.utils.log.ServerFormatter', 'format': '[%(server_time)s] %(message)s'}, 'verbose': {'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'}, 'simple': {'format': '%(levelname)s %(message)s'}}, 'filters': {'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}}, 'handlers': {'django.server': {'level': 'INFO', 'class': 'logging.StreamHandler', 'formatter': 'django.server'}, 'console': {'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'simple'}, 'mail_admins': {'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler'}}, 'loggers': {'django': {'handlers': ['console'], 'propagate': True}, 'django.server': {'handlers': ['django.server'], 'level': 'INFO', 'propagate': False}, 'django.request': {'handlers': ['mail_admins', 'console'], 'level': 'ERROR', 'propagate': False}, 'django.db.backends': {'handlers': ['console'], 'level': 'INFO'}}}\n LOGGING_CONFIG = 'logging.config.dictConfig'\n LOGIN_REDIRECT_URL = '/'\n LOGIN_URL = 'rest_framework:login'\n LOGOUT_REDIRECT_URL = None\n LOGOUT_URL = 'rest_framework:logout'\n MANAGERS = []\n MEDIA_ROOT = '/code/media'\n MEDIA_URL = '/media/'\n MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'\n MIDDLEWARE = \\\"('django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')\\\"\n MIGRATION_MODULES = {}\n MONTH_DAY_FORMAT = 'F j'\n NOSE_ARGS = ['/code/pkdb_app', '-s', '--nologcapture', '--with-coverage', '--with-progressive', '--cover-package=pkdb']\n NUMBER_GROUPING = 0\n PASSWORD_HASHERS = '********************'\n PASSWORD_RESET_TIMEOUT_DAYS = '********************'\n PREPEND_WWW = False\n REST_FRAMEWORK = {'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'PAGE_SIZE': 10, 'DATETIME_FORMAT': '%Y-%m-%dT%H:%M:%S%z', 'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer', 'rest_framework.renderers.BrowsableAPIRenderer'), 'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.AllowAny'], 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.SessionAuthentication',), 'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',)}\n ROOT_URLCONF = 'pkdb_app.urls'\n SECRET_KEY = '********************'\n SECURE_BROWSER_XSS_FILTER = False\n SECURE_CONTENT_TYPE_NOSNIFF = False\n SECURE_HSTS_INCLUDE_SUBDOMAINS = False\n SECURE_HSTS_PRELOAD = False\n SECURE_HSTS_SECONDS = 0\n SECURE_PROXY_SSL_HEADER = None\n SECURE_REDIRECT_EXEMPT = []\n SECURE_SSL_HOST = None\n SECURE_SSL_REDIRECT = False\n SERVER_EMAIL = 'root@localhost'\n SESSION_CACHE_ALIAS = 'default'\n SESSION_COOKIE_AGE = 1209600\n SESSION_COOKIE_DOMAIN = None\n SESSION_COOKIE_HTTPONLY = True\n SESSION_COOKIE_NAME = 'sessionid'\n SESSION_COOKIE_PATH = '/'\n SESSION_COOKIE_SECURE = False\n SESSION_ENGINE = 'django.contrib.sessions.backends.db'\n SESSION_EXPIRE_AT_BROWSER_CLOSE = False\n SESSION_FILE_PATH = None\n SESSION_SAVE_EVERY_REQUEST = False\n SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'\n SETTINGS_MODULE = 'pkdb_app.config'\n SHORT_DATETIME_FORMAT = 'm/d/Y P'\n SHORT_DATE_FORMAT = 'm/d/Y'\n SIGNING_BACKEND = 'django.core.signing.TimestampSigner'\n SILENCED_SYSTEM_CHECKS = []\n STATICFILES_DIRS = []\n STATICFILES_FINDERS = \\\"('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder')\\\"\n STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'\n STATIC_ROOT = '/code/static'\n STATIC_URL = '/static/'\n SWAGGER_SETTINGS = {'LOGIN_URL': 'rest_framework:login', 'LOGOUT_URL': 'rest_framework:logout', 'USE_SESSION_AUTH': True, 'DOC_EXPANSION': 'list', 'APIS_SORTER': '********************', 'SECURITY_DEFINITIONS': {'basic': {'type': 'basic'}}}\n TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages']}}]\n TEST_NON_SERIALIZED_APPS = []\n TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'\n THOUSAND_SEPARATOR = ','\n TIME_FORMAT = 'P'\n TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']\n TIME_ZONE = 'UTC'\n USE_ETAGS = False\n USE_I18N = False\n USE_L10N = True\n USE_THOUSAND_SEPARATOR = False\n USE_TZ = True\n USE_X_FORWARDED_HOST = False\n USE_X_FORWARDED_PORT = False\n WSGI_APPLICATION = 'pkdb_app.wsgi.application'\n X_FRAME_OPTIONS = 'SAMEORIGIN'\n YEAR_MONTH_FORMAT = 'F Y'\n \n \n You're seeing this error because you have DEBUG = True in your\n Django settings file. Change that to False, and Django will\n display a standard page generated by the handler for this status code.\n \n \"" - ] + "data": { + "text/plain": [ + "OrderedDict([('comment', None),\n", + " ('description', None),\n", + " ('title',\n", + " '4-quinolones inhibit joiijojiojioijojioji of caffeine.'),\n", + " ('pmid', '19125908'),\n", + " ('authors',\n", + " [OrderedDict([('id', 2),\n", + " ('first_name', 'C-Y'),\n", + " ('last_name', 'Fun')]),\n", + " OrderedDict([('id', 3),\n", + " ('first_name', 'Y-L'),\n", + " ('last_name', 'Law')]),\n", + " OrderedDict([('id', 4),\n", + " ('first_name', 'W-M'),\n", + " ('last_name', 'Lim')]),\n", + " OrderedDict([('id', 5),\n", + " ('first_name', 'W'),\n", + " ('last_name', 'Fan')]),\n", + " OrderedDict([('id', 6),\n", + " ('first_name', 'C-L'),\n", + " ('last_name', 'Lim')])]),\n", + " ('abstract', None),\n", + " ('file', None)])" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ diff --git a/pkdb_app/data_management/fill_database.py b/pkdb_app/data_management/fill_database.py index 4a6c511a..2e8da657 100644 --- a/pkdb_app/data_management/fill_database.py +++ b/pkdb_app/data_management/fill_database.py @@ -26,7 +26,7 @@ def upload_study(json_study): def get_graph(**options): graph = bonobo.Graph() - #add studies + # add studies graph.add_chain( get_study_json_path, open_json, diff --git a/pkdb_app/studies/models.py b/pkdb_app/studies/models.py index a4a84fa7..a33e1fb8 100644 --- a/pkdb_app/studies/models.py +++ b/pkdb_app/studies/models.py @@ -14,6 +14,7 @@ class Author(models.Model): def __str__(self): return '%s %s' % (self.first_name, self.last_name) + class Study(Commentable, Describable, models.Model): """ Single clinical study.