-
I'm trying to start the docs project following the guide in https://github.com/wrabit/django-cotton/blob/main/CONTRIBUTING.md#documentation. But the following errors happen in my system (fresh installation) => ERROR [base 6/6] RUN SECRET_KEY=dummy STATIC_URL='/staticfiles/' python manage.py collectstatic --noinput --verbosity 2 1.6s
------
> [base 6/6] RUN SECRET_KEY=dummy STATIC_URL='/staticfiles/' python manage.py collectstatic --noinput --verbosity 2:
1.448 Traceback (most recent call last):
1.448 File "/app/manage.py", line 22, in <module>
1.448 main()
1.448 File "/app/manage.py", line 18, in main
1.448 execute_from_command_line(sys.argv)
1.448 File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
1.449 utility.execute()
1.449 File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 416, in execute
1.449 django.setup()
1.449 File "/usr/local/lib/python3.12/site-packages/django/__init__.py", line 24, in setup
1.449 apps.populate(settings.INSTALLED_APPS)
1.449 File "/usr/local/lib/python3.12/site-packages/django/apps/registry.py", line 91, in populate
1.449 app_config = AppConfig.create(entry)
1.449 ^^^^^^^^^^^^^^^^^^^^^^^
1.449 File "/usr/local/lib/python3.12/site-packages/django/apps/config.py", line 193, in create
1.449 import_module(entry)
1.449 File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
1.449 return _bootstrap._gcd_import(name[level:], package, level)
1.449 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.449 File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
1.449 File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
1.449 File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
1.449 ModuleNotFoundError: No module named 'django_cotton'
------
Dockerfile:35
--------------------
33 | && poetry install
34 |
35 | >>> RUN SECRET_KEY=dummy STATIC_URL='/staticfiles/' python manage.py collectstatic --noinput --verbosity 2
36 |
37 | CMD [ "python", "manage.py", "runserver", "0.0.0.0:8000" ]
--------------------
ERROR: failed to solve: process "/bin/sh -c SECRET_KEY=dummy STATIC_URL='/staticfiles/' python manage.py collectstatic --noinput --verbosity 2" did not complete successfully: exit code: 1 I made a pull request #215 that I thought that solved my problem #215 (comment). I see that in this commit 5836a69 this was reverted. So the error to start the docs happen again. Am I doing something wrong? Could someone replicate my error? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@daniboygg The issue is I reverted because after tests of removing all images I was not getting the error. It seems I was too quick to assume it - apologies there. The rudimentary approach is to just |
Beta Was this translation helpful? Give feedback.
@daniboygg The issue is
python manage.py collectstatic
runs the app, that hasdjango_cotton
listed inINSTALLED_APPS
. Django cotton directory is only mapped when running the container, after build, so at build time the folder is not mapped causing the error.I reverted because after tests of removing all images I was not getting the error. It seems I was too quick to assume it - apologies there. The rudimentary approach is to just
poetry remove django-cotton
at the end of the build so that when the container next runs, we are using the local version of cotton instead. When I get time today I'll line up that PR, unless you want to get to it sooner.