dstndstn / astrometry.net

Astrometry.net -- automatic recognition of astronomical images
http://astrometry.net
Other
650 stars 184 forks source link

ModuleNotFoundError: No module named 'astrometry.net.appsecrets.django' #264

Closed digiwang closed 1 year ago

digiwang commented 1 year ago

Expected behavior: to build the astrometry.net webservice as a Docker image. Repository hash: fafce3ff1f97186cf912639cd788375b97e019bc

Full Error:

root@68aa718c76ef:/workspace/src/astrometry/net# python manage.py makemigrations
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 402, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 443, in execute
    self.check()
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 475, in check
    all_issues = checks.run_checks(
  File "/usr/local/lib/python3.8/dist-packages/django/core/checks/registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/usr/local/lib/python3.8/dist-packages/django/core/checks/translation.py", line 43, in check_setting_languages
    for tag, _ in settings.LANGUAGES
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 92, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 79, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 190, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/workspace/astrometry/lib/python/astrometry/net/settings.py", line 3, in <module>
    from astrometry.net.settings_common import *
  File "/workspace/astrometry/lib/python/astrometry/net/settings_common.py", line 5, in <module>
    import astrometry.net.appsecrets.django as djsecrets
ModuleNotFoundError: No module named 'astrometry.net.appsecrets.django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 19, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 415, in run_from_argv
    connections.close_all()
  File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 84, in close_all
    for conn in self.all(initialized_only=True):
  File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 76, in all
    return [
  File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 73, in __iter__
    return iter(self.settings)
  File "/usr/local/lib/python3.8/dist-packages/django/utils/functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 45, in settings
    self._settings = self.configure_settings(self._settings)
  File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 148, in configure_settings
    databases = super().configure_settings(databases)
  File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 50, in configure_settings
    settings = getattr(django_settings, self.settings_name)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 92, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 79, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 190, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/workspace/astrometry/lib/python/astrometry/net/settings.py", line 3, in <module>
    from astrometry.net.settings_common import *
  File "/workspace/astrometry/lib/python/astrometry/net/settings_common.py", line 5, in <module>
    import astrometry.net.appsecrets.django as djsecrets
ModuleNotFoundError: No module named 'astrometry.net.appsecrets.django'

I am wondering if line #5 (import astrometry.net.appsecrets.django as djsecrets) in settings_common.py is ok to remove? There is no django file in the appsecrets directory. Also, the instructions don't call for creating it either. Maybe an error in the instructions or an error in the file.

dstndstn commented 1 year ago

Sorry, that's an error in the documentation. I just added an example appsecrets directory with example file contents.

https://github.com/dstndstn/astrometry.net/tree/main/net/appsecrets-example

digiwang commented 1 year ago

No worries. Thank you for responding. I ended up doing exactly that. Relieved I "kind of" know how things are working.