I have installed Graphite in RHEL7 server using the source. I have created a database in Postgresql. Modified the local_settings.py with Postgresql database.
When I execute the below command for sync, it throws an error
PYTHONPATH=/app/graphite/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb
Error :
Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 4, in <module>
__import__('pkg_resources').run_script('Django==2.2.1', 'django-admin.py') File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns) File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1446, in run_script
exec(code, namespace, namespace) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/EGG-INFO/scripts/django-admin.py", line 5, in <module>
management.execute_from_command_line() File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute() File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/management/base.py", line 361, in execute
self.check() File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/management/base.py", line 390, in check
include_deployment_checks=include_deployment_checks, File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/management/commands/migrate.py", line 64, in _run_checks
issues = run_checks(tags=[Tags.database]) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/core/checks/database.py", line 9, in check_database_backends
for conn in connections.all(): File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/db/utils.py", line 216, in all
return [self[alias] for alias in self] File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/db/utils.py", line 213, in __iter__
return iter(self.databases) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/utils/functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/db/utils.py", line 147, in databases
self._databases = settings.DATABASES File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/conf/__init__.py", line 79, in __getattr__
self._setup(name) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed File "/app/graphite/webapp/graphite/settings.py", line 22, in <module>
from django.contrib.contenttypes.models import ContentType File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/contrib/contenttypes/models.py", line 133, in <module>
class ContentType(models.Model): File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/db/models/base.py", line 103, in __new__
app_config = apps.get_containing_app_config(module) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/apps/registry.py", line 252, in get_containing_app_config
self.check_apps_ready() File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/apps/registry.py", line 134, in check_apps_ready
settings.INSTALLED_APPS File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/conf/__init__.py", line 79, in __getattr__
self._setup(name) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module) File "/usr/local/lib/python3.7/site-packages/Django-2.2.1-py3.7.egg/django/conf/__init__.py", line 176, in __init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.") django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
The SECRET_KEY
is added in local_settings.py, app_settings.py and settings.py. But still it thorws the same error. I have done the fresh installation of graphite and modified the DB values.