Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'django' (docker) #178

Open
jzbor opened this issue Jul 22, 2024 · 1 comment
Open

ModuleNotFoundError: No module named 'django' (docker) #178

jzbor opened this issue Jul 22, 2024 · 1 comment

Comments

@jzbor
Copy link

jzbor commented Jul 22, 2024

Hi,
I am trying to self-host the project with a Docker Compose file:

services:
  bitpoll:
    build: https://github.com/fsinfuhh/bitpoll.git
    volumes:
     - bitpoll_static:/opt/static
     - ./config:/opt/config
     - bitpoll_log:/opt/log
     - bitpoll_db:/opt/db

  bitpoll-proxy:
    image: nginx:1.23
    volumes:
     - ./config/nginx.conf:/etc/nginx/conf.d/default.conf
     - bitpoll_static:/opt/static
    networks:
     - default
     - rev-proxy_caddy

volumes:
  bitpoll_caddy:
  bitpoll_static:
  bitpoll_db:
  bitpoll_log:

networks:
  rev-proxy_caddy:
    external: true

However I get the following error:

[+] Running 2/0
 ✔ Container terminklick-bitpoll-proxy-1  Crea...                                         0.0s 
 ✔ Container terminklick-bitpoll-1        Created                                         0.0s 
Attaching to bitpoll-1, bitpoll-proxy-1
bitpoll-proxy-1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
bitpoll-proxy-1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
bitpoll-proxy-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
bitpoll-proxy-1  | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
bitpoll-proxy-1  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
bitpoll-proxy-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
bitpoll-proxy-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
bitpoll-proxy-1  | /docker-entrypoint.sh: Configuration complete; ready for start up
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: using the "epoll" event method
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: nginx/1.23.4
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: OS: Linux 6.9.9
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: start worker processes
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: start worker process 28
bitpoll-proxy-1  | 2024/07/22 14:48:58 [notice] 1#1: start worker process 29
bitpoll-1        | System check identified some issues:
bitpoll-1        | 
bitpoll-1        | WARNINGS:
bitpoll-1        | django_token_bucket.TokenBucket: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
bitpoll-1        | 	HINT: Configure the DEFAULT_AUTO_FIELD setting or the DjangoTokenBucketConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
bitpoll-1        | Operations to perform:
bitpoll-1        |   Apply all migrations: admin, auth, base, caldav, contenttypes, django_token_bucket, groups, invitations, poll, sessions
bitpoll-1        | Running migrations:
bitpoll-1        |   No migrations to apply.
bitpoll-1        | [uWSGI] getting INI configuration from /etc/uwsgi/bitpoll.ini
bitpoll-1        | [uwsgi-static] added mapping for /static => /opt/static
bitpoll-1        | *** Starting uWSGI 2.0.21-debian (64bit) on [Mon Jul 22 14:48:59 2024] ***
bitpoll-1        | compiled with version: 12.2.0 on 19 May 2023 13:59:29
bitpoll-1        | os: Linux-6.9.9 #1-NixOS SMP Thu Jul 11 10:51:24 UTC 2024
bitpoll-1        | nodename: 90ffb0ca92f9
bitpoll-1        | machine: aarch64
bitpoll-1        | clock source: unix
bitpoll-1        | pcre jit disabled
bitpoll-1        | detected number of CPU cores: 2
bitpoll-1        | current working directory: /opt/bitpoll
bitpoll-1        | detected binary path: /usr/bin/uwsgi-core
bitpoll-1        | setgid() to 33
bitpoll-1        | setuid() to 2008
bitpoll-1        | chdir() to /opt/bitpoll
bitpoll-1        | your memory page size is 4096 bytes
bitpoll-1        | detected max file descriptor number: 524288
bitpoll-1        | building mime-types dictionary from file /etc/mime.types...1545 entry found
bitpoll-1        | lock engine: pthread robust mutexes
bitpoll-1        | thunder lock: disabled (you can enable it with --thunder-lock)
bitpoll-1        | uwsgi socket 0 bound to TCP address :3008 fd 3
bitpoll-1        | uwsgi socket 1 bound to TCP address :3009 fd 4
bitpoll-1        | Python version: 3.11.2 (main, May  2 2024, 11:59:08) [GCC 12.2.0]
bitpoll-1        | Set PythonHome to /usr/local
bitpoll-1        | Python main interpreter initialized at 0xffff8b34fee8
bitpoll-1        | python threads support enabled
bitpoll-1        | your server socket listen backlog is limited to 100 connections
bitpoll-1        | your mercy for graceful operations on workers is 60 seconds
bitpoll-1        | mapped 938592 bytes (916 KB) for 32 cores
bitpoll-1        | *** Operational MODE: preforking+threaded ***
bitpoll-1        | Traceback (most recent call last):
bitpoll-1        |   File "/opt/bitpoll/bitpoll/wsgi.py", line 12, in <module>
bitpoll-1        |     from django.core.wsgi import get_wsgi_application
bitpoll-1        | ModuleNotFoundError: No module named 'django'
bitpoll-1        | unable to load app 0 (mountpoint='') (callable not found or import error)
bitpoll-1        | *** no app loaded. going in full dynamic mode ***
bitpoll-1        | *** uWSGI is running in multiple interpreter mode ***
bitpoll-1        | spawned uWSGI master process (pid: 7)
bitpoll-1        | spawned uWSGI worker 1 (pid: 11, cores: 4)
bitpoll-1        | spawned uWSGI worker 2 (pid: 12, cores: 4)

Any help is greatly appreciated...

@FelixBuehler
Copy link

I solved that with apt install python3-django (if still relevant)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants