Ресурс не отображается в списке Мои ресурсы после загрузки виджетов и гибридов - PullRequest
0 голосов
/ 04 января 2019

enter image description here

enter image description here

В моем списке ресурсов нет виджетов и гибридных приложений. Даже после загрузки вручную виджет загружается, но его не видно в списке «Мои ресурсы». После его загрузки снова появляется сообщение об ошибке «виджет уже существует». Я развернул wirecloud из докера и интегрировал базу данных postgres. Нужно ли включать какие-либо настройки в wirecloud, чтобы виджеты и гибридные приложения могли отображаться. Кроме того, он показывает мне сообщение в списке Мои ресурсы и виджет, как показано на скриншоте.

Найдите раздел wirecloud и postgres, который я использую, в файле docker-compose.yml

   postgres:
        container_name: postgres
        hostname: postgres
        restart: always
        image: postgres:latest
        ports:
            - 127.0.0.1:5432:5432
        volumes:
            - ./postgres-data:/var/lib/postgresql/data
        networks:
            - db
        logging:
            options:
                max-size: "100m"
                max-file: "5"


     wirecloud:
            container_name: wirecloud
            hostname: wirecloud
            restart: always
            image: fiware/wirecloud
            ports:
                - 127.0.0.1:8000:8000
            volumes:
                - ./wirecloud_instance:/opt/wirecloud_instance
                - ./static:/var/www/static
                - ./config-idm.sh:/opt/wirecloud_instance/config-idm.sh
                - ./config-django-admin.py:/opt/wirecloud_instance/config-django-admin.py
                - ./change-user-permissions.py:/opt/wirecloud_instance/change-user-permissions.py
            depends_on:
                - postgres
                - fiware-idm
            networks:
                - db
                - frontend
            logging:
                options:
                    max-size: "100m"
                    max-file: "5"

Пожалуйста, найдите файл settings.py. Я попытался запустить его с настройкой поиска по умолчанию Haystack, указанной в "https://wirecloud.readthedocs.io/en/stable/installation_guide/#whoosh-configuration", но все еще с той же ошибкой.

# -*- coding: utf-8 -*-
# Django settings for wirecloud_instance project.

from os import path
from wirecloud.commons.utils.conf import load_default_wirecloud_conf
from django.core.urlresolvers import reverse_lazy

DEBUG = True
BASEDIR = path.dirname(path.abspath(__file__))
load_default_wirecloud_conf(locals())

USE_XSENDFILE = False

SESSION_COOKIE_NAME = "wcsessionid"
CSRF_COOKIE_NAME = "wccsrftoken"

ADMINS = (
    # ('Your Name', 'your_email@example.com'),
)

MANAGERS = ADMINS


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',       # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'postgres',           # Or path to database file if using sqlite3.
        # The following settings are not used with sqlite3:
        'USER': 'postgres',
        'PASSWORD': 'postgres',
        'HOST': 'postgres',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
        'PORT': '5432',                      # Set to empty string for default.
    }
}




# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = '/var/www/static'

# Controls the absolute file path that linked static will be read from and
# compressed static will be written to when using the default COMPRESS_STORAGE.
COMPRESS_ROOT = STATIC_ROOT

# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
# Additional locations of static files
# STATICFILES_DIRS = (
#     # Put strings here, like "/home/html/static" or "C:/www/django/static".
#     # Always use forward slashes, even on Windows.
#     # Don't forget to use absolute paths, not relative paths.
# )

# List of finder classes that know how to find static files in
# various locations.
# STATICFILES_FINDERS += (
#     'django.contrib.staticfiles.finders.FileSystemFinder',
#     'django.contrib.staticfiles.finders.DefaultStorageFinder',
# )

# Make this unique, and don't share it with anybody.
SECRET_KEY = '=8&cve7*neymifn7i1e%3rn94o3xid0ib(h91%c96m9f==wwlm'

ROOT_URLCONF = 'wirecloud_instance.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'wirecloud_instance.wsgi.application'

INSTALLED_APPS += (
    # 'django.contrib.sites',
   # 'wirecloud.oauth2provider',
    'social_django',
    'wirecloud.fiware',
)

# Login/logout URLs
LOGIN_URL = reverse_lazy('login')
LOGOUT_URL = reverse_lazy('wirecloud.root')
LOGIN_REDIRECT_URL = reverse_lazy('wirecloud.root')

THEME_ACTIVE = "wirecloud.defaulttheme"
DEFAULT_LANGUAGE = 'browser'

FIWARE_IDM_SERVER = "http://fiwareidm:3000"
SOCIAL_AUTH_FIWARE_KEY = "8d111720-68ae-45bc-b342-xxxxxxxx"
SOCIAL_AUTH_FIWARE_SECRET = "8598084e-9b6a-4816-b8ca-xxxxxxx"
# WGT deployment dirs
CATALOGUE_MEDIA_ROOT = path.join(BASEDIR, 'catalogue_resources')
GADGETS_DEPLOYMENT_DIR = path.join(BASEDIR, 'widget_files')

# Cache settings
CACHES = {
    'default': {
        'BACKEND': 'wirecloud.platform.cache.backends.locmem.LocMemCache',
        'OPTIONS': {
            'MAX_ENTRIES': 3000,
        },
    }
}

# WireCloud autodiscover Wirecloud plugins by default. Uncomment this for settings
# the list of plugins manually.
#
# WIRECLOUD_PLUGINS = (
#     'wirecloud.oauth2provider.plugins.OAuth2ProviderPlugin',
#     'wirecloud.fiware.plugins.FiWarePlugin',
# )

AUTHENTICATION_BACKENDS = (
     'wirecloud.fiware.social_auth_backend.FIWAREOAuth2',
     'django.contrib.auth.backends.ModelBackend',
)


NOT_PROXY_FOR = ['localhost', '127.0.0.1']
...