RadicalxChange / rxc-voice

An app for decentralized democratic governance.
https://voice.radicalxchange.org/
Other
42 stars 14 forks source link

can't setup without errors while following instructions in readme #32

Closed whatSocks closed 3 years ago

whatSocks commented 3 years ago

here are my incremental changes as I try to get this project working locally following the readme https://github.com/RadicalxChange/rxc-voice/pull/34

Following the documentation in the readme, i wasn't able to run with the recommended docker command. I was able to with docker-compose -f docker-compose-polis.yml build

alexrandaccio commented 3 years ago

what version of docker do you have installed?

whatSocks commented 3 years ago

3.2.2 (i just updated to 3.3.1)

alexrandaccio commented 3 years ago

Hmm, I'm not sure why docker-compose -f <filepath> up --build isn't working for you, you are the first person it hasn't worked for. However, it's just a way of building and running in one command instead of two. If docker-compose -f <filepath> build works for you, then you should be able to use docker-compose -f <filepath> up after that. Let me know if that doesn't work!

whatSocks commented 3 years ago

works, I do get this error though (following readme step by step):

Attaching to rxc-voice_db_1, rxc-voice_api_1, rxc-voice_web_1
api_1  | Traceback (most recent call last):
api_1  |   File "/backend/RxcVoiceApi/manage.py", line 22, in <module>
db_1   | Error: Database is uninitialized and superuser password is not specified.
db_1   |        You must specify POSTGRES_PASSWORD to a non-empty value for the
db_1   |        superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
db_1   |
db_1   |        You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
db_1   |        connections without a password. This is *not* recommended.
db_1   |
db_1   |        See PostgreSQL documentation about "trust":
db_1   |        https://www.postgresql.org/docs/current/auth-trust.html
api_1  |     main()
api_1  |   File "/backend/RxcVoiceApi/manage.py", line 18, in main
api_1  |     execute_from_command_line(sys.argv)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
api_1  |     utility.execute()
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
api_1  |     self.fetch_command(subcommand).run_from_argv(self.argv)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 330, in run_from_argv
api_1  |     self.execute(*args, **cmd_options)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 368, in execute
api_1  |     self.check()
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 392, in check
api_1  |     all_issues = checks.run_checks(
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/checks/registry.py", line 70, in run_checks
api_1  |     new_errors = check(app_configs=app_configs, databases=databases)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/checks/caches.py", line 14, in check_default_cache_is_configured
api_1  |     if DEFAULT_CACHE_ALIAS not in settings.CACHES:
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 83, in __getattr__
api_1  |     self._setup(name)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 70, in _setup
api_1  |     self._wrapped = Settings(settings_module)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 196, in __init__
api_1  |     raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
api_1  | django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
api_1  | Traceback (most recent call last):
api_1  |   File "/backend/RxcVoiceApi/manage.py", line 22, in <module>
api_1  |     main()
api_1  |   File "/backend/RxcVoiceApi/manage.py", line 18, in main
rxc-voice_db_1 exited with code 1
api_1  |     execute_from_command_line(sys.argv)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
api_1  |     utility.execute()
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
api_1  |     self.fetch_command(subcommand).run_from_argv(self.argv)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 330, in run_from_argv
api_1  |     self.execute(*args, **cmd_options)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 371, in execute
api_1  |     output = self.handle(*args, **options)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 82, in wrapped
api_1  |     saved_locale = translation.get_language()
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/translation/__init__.py", line 254, in get_language
api_1  |     return _trans.get_language()
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/translation/__init__.py", line 57, in __getattr__
api_1  |     if settings.USE_I18N:
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 83, in __getattr__
api_1  |     self._setup(name)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 70, in _setup
api_1  |     self._wrapped = Settings(settings_module)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 196, in __init__
api_1  |     raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
api_1  | django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
api_1  | Traceback (most recent call last):
api_1  |   File "/backend/RxcVoiceApi/manage.py", line 22, in <module>
api_1  |     main()
api_1  |   File "/backend/RxcVoiceApi/manage.py", line 18, in main
api_1  |     execute_from_command_line(sys.argv)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
api_1  |     utility.execute()
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
api_1  |     self.fetch_command(subcommand).run_from_argv(self.argv)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 330, in run_from_argv
api_1  |     self.execute(*args, **cmd_options)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 61, in execute
api_1  |     super().execute(*args, **options)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 371, in execute
api_1  |     output = self.handle(*args, **options)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 68, in handle
api_1  |     if not settings.DEBUG and not settings.ALLOWED_HOSTS:
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 83, in __getattr__
api_1  |     self._setup(name)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 70, in _setup
api_1  |     self._wrapped = Settings(settings_module)
api_1  |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 196, in __init__
api_1  |     raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
api_1  | django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
rxc-voice_api_1 exited with code 1
whatSocks commented 3 years ago

I try creating users using the command on readme and it says:

 docker exec -it rxc-voice_api_1 ./manage.py createsuperuser
Error response from daemon: Container c07102cd6ccd6e9c8938cc1c80d1501a49196254a0dc4f5cd9bf84a7fb612992 is not running
alexrandaccio commented 3 years ago

django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

You just need to create a secret key and assign it in .env Then the container will start up properly and you will be able to create a superuser.

If you have Django installed you can generate secret keys with this command: python -c 'from django.core.management.utils import get_random_secret_key; \ print(get_random_secret_key())'

alexrandaccio commented 3 years ago

Closing this for now--let's continue the discussion about improving documentation for local development in #23