YunoHost-Apps / bookwyrm_ynh

Bookwyrm package for YunoHost
https://joinbookwyrm.com/fr/
GNU Affero General Public License v3.0
9 stars 6 forks source link

Cannot generate the admin code #57

Closed belatedly closed 10 months ago

belatedly commented 10 months ago

Describe the bug

I copied the command that is required to generate the admin code and am getting this error:

 sudo -u bookwyrm /var/www/bookwyrm/venv/bin/python3 /var/www/bookwyrm/manage.py admin_code
Traceback (most recent call last):
  File "/var/www/bookwyrm/manage.py", line 18, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/bookwyrm/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/var/www/bookwyrm/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 363, in execute
    settings.INSTALLED_APPS
  File "/var/www/bookwyrm/venv/lib/python3.9/site-packages/django/conf/__init__.py", line 82, in __getattr__
    self._setup(name)
  File "/var/www/bookwyrm/venv/lib/python3.9/site-packages/django/conf/__init__.py", line 69, in _setup
    self._wrapped = Settings(settings_module)
  File "/var/www/bookwyrm/venv/lib/python3.9/site-packages/django/conf/__init__.py", line 170, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/var/www/bookwyrm/bookwyrm/settings.py", line 19, in <module>
    with open("VERSION", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'VERSION'

Context

Steps to reproduce

Expected behavior

The admin code should be generated

Logs

Error message noted above

oufmilo commented 10 months ago

Can you try this command:

sudo -u bookwyrm venv/bin/python3 manage.py admin_code

belatedly commented 10 months ago

sudo: venv/bin/python3: command not found

oufmilo commented 10 months ago

cd /var/www/bookwyrm sudo -u bookwyrm venv/bin/python3 manage.py admin_code

belatedly commented 10 months ago

Thank you, that worked