You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to set up geonode on Docker. Django container is stuck on perpetual restart loop and returns below errors when I examine the logs using docker-compose logs -f django
django4project_geonode | GeoNode databases are up - executing command
django4project_geonode | waitfordbs tasks done
django4project_geonode | DOCKER_ENV=production
django4project_geonode | migrations*****
django4project_geonode | Traceback (most recent call last):
django4project_geonode | File "/usr/src/project_geonode/manage.py", line 31, in
django4project_geonode | execute_from_command_line(sys.argv)
django4project_geonode | File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
django4project_geonode | utility.execute()
django4project_geonode | File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 363, in execute
django4project_geonode | settings.INSTALLED_APPS
django4project_geonode | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 82, in getattr
django4project_geonode | self._setup(name)
django4project_geonode | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 69, in _setup
django4project_geonode | self._wrapped = Settings(settings_module)
django4project_geonode | File "/usr/local/lib/python3.10/site-packages/django/conf/init.py", line 170, in init
django4project_geonode | mod = importlib.import_module(self.SETTINGS_MODULE)
django4project_geonode | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
django4project_geonode | return _bootstrap._gcd_import(name[level:], package, level)
django4project_geonode | File "", line 1050, in _gcd_import
django4project_geonode | File "", line 1027, in _find_and_load
django4project_geonode | File "", line 1006, in _find_and_load_unlocked
django4project_geonode | File "", line 688, in _load_unlocked
django4project_geonode | File "", line 883, in exec_module
django4project_geonode | File "", line 241, in _call_with_frames_removed
django4project_geonode | File "/usr/src/project_geonode/project_geonode/settings.py", line 79, in
django4project_geonode | TEMPLATES[0]['DIRS'].insert(0, os.path.join(LOCAL_ROOT, "templates"))
django4project_geonode | IndexError: list index out of range
Here is the /usr/src/project_geonode/project_geonode/settings.py file:
# Django settings for the GeoNode project.
import os
import ast
try:
from urllib.parse import urlparse, urlunparse
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen, Request
from urlparse import urlparse, urlunparse
# Load more settings from a file called local_settings.py if it exists
try:
from project_geonode.local_settings import *
# from geonode.local_settings import *
except ImportError:
from project_geonode.settings import *
#
# General Django development settings
#
PROJECT_NAME = 'project_geonode'
SITEURL = os.getenv("SITEURL", 'https://143.198.129.220/')
# add trailing slash to site url. geoserver url will be relative to this
if not SITEURL.endswith('/'):
SITEURL = '{}/'.format(SITEURL)
SITENAME = os.getenv("SITENAME", 'project_geonode')
# Defines the directory that contains the settings file as the LOCAL_ROOT
# It is used for relative settings elsewhere.
# Defines the directory that contains the settings file as the LOCAL_ROOT
# It is used for relative settings elsewhere.
LOCAL_ROOT = os.path.abspath(os.path.dirname(__file__))
WSGI_APPLICATION = "{}.wsgi.application".format(PROJECT_NAME)
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = os.getenv('LANGUAGE_CODE', "en")
INSTALLED_APPS = [];
if PROJECT_NAME not in INSTALLED_APPS:
INSTALLED_APPS += (PROJECT_NAME,)
# Location of url mappings
ROOT_URLCONF = os.getenv('ROOT_URLCONF', '{}.urls'.format(PROJECT_NAME))
# Additional directories which hold static files
# - Give priority to local geonode-project ones
STATICFILES_DIRS = [];
STATICFILES_DIRS = [os.path.join(LOCAL_ROOT, "static"), ] + STATICFILES_DIRS
# Location of locale file
LOCALE_PATHS = ('locale',)
LOCALE_PATHS = (
os.path.join(LOCAL_ROOT, 'locale'),
) + LOCALE_PATHS
TEMPLATES = []
TEMPLATES[0]['DIRS'].insert(0, os.path.join(LOCAL_ROOT, "templates"))
loaders = TEMPLATES[0]['OPTIONS'].get('loaders') or ['django.template.loaders.filesystem.Loader','django.template.loaders.app_directories.Loader']
# loaders.insert(0, 'apptemplates.Loader')
TEMPLATES[0]['OPTIONS']['loaders'] = loaders
TEMPLATES[0].pop('APP_DIRS', None)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d '
'%(thread)d %(message)s'
},
'simple': {
'format': '%(message)s',
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'console': {
'level': 'ERROR',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler',
}
},
"loggers": {
"django": {
"handlers": ["console"], "level": "ERROR", },
"geonode": {
"handlers": ["console"], "level": "INFO", },
"geoserver-restconfig.catalog": {
"handlers": ["console"], "level": "ERROR", },
"owslib": {
"handlers": ["console"], "level": "ERROR", },
"pycsw": {
"handlers": ["console"], "level": "ERROR", },
"celery": {
"handlers": ["console"], "level": "DEBUG", },
"mapstore2_adapter.plugins.serializers": {
"handlers": ["console"], "level": "DEBUG", },
"geonode_logstash.logstash": {
"handlers": ["console"], "level": "DEBUG", },
},
}
CENTRALIZED_DASHBOARD_ENABLED = ast.literal_eval(os.getenv('CENTRALIZED_DASHBOARD_ENABLED', 'False'))
if CENTRALIZED_DASHBOARD_ENABLED and USER_ANALYTICS_ENABLED and 'geonode_logstash' not in INSTALLED_APPS:
INSTALLED_APPS += ('geonode_logstash',)
CELERY_BEAT_SCHEDULE['dispatch_metrics'] = {
'task': 'geonode_logstash.tasks.dispatch_metrics',
'schedule': 3600.0,
}
LDAP_ENABLED = ast.literal_eval(os.getenv('LDAP_ENABLED', 'False'))
if LDAP_ENABLED and 'geonode_ldap' not in INSTALLED_APPS:
INSTALLED_APPS += ('geonode_ldap',)
# Add your specific LDAP configuration after this comment:
# https://docs.geonode.org/en/master/advanced/contrib/#configuration
Trying to set up geonode on Docker. Django container is stuck on perpetual restart loop and returns below errors when I examine the logs using
docker-compose logs -f django
Here is the
/usr/src/project_geonode/project_geonode/settings.py
file:Here is my
docker-compose.yml
:The text was updated successfully, but these errors were encountered: