Ich habe dieses Django Projekt gefunden:
- `git clone git clone https://github.com/NAL-i5K/django-blast.git`
- `$ cat requirements.txt` in this files the below dependencies had to be updated:
- psycopg2==2.8.6
Code: Alles auswählen
FROM python:2
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y postgresql-client
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
RUN mkdir -p /var/log/django
RUN mkdir -p /var/log/i5k
Dies ist mein `docker-compose.yml`:
Code: Alles auswählen
version: "3"
services:
db:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
- ./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sql
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
links:
- db
Code: Alles auswählen
$ cat scripts/install-extensions.sql
CREATE EXTENSION hstore;
Diese Datei musste ich aendern:
Code: Alles auswählen
$ vim i5k/settings_prod.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'db',
'PORT': '5432',
}
}
`docker-compose up --build`
`docker-compose run web python manage.py`
`docker-compose run web python manage.py migrate`
`docker-compose run web python manage.py createsuperuser`
Wenn ich in Browser `http://localhost:8000/admin/blast/blastdb/add/` eine Datei upload wollte diese Fehlermeldung wurde erzeugt:
Code: Alles auswählen
web_1 | [24/May/2021 18:04:53] "POST /admin/blast/sequencetype/add/?_to_field=id&_popup=1 HTTP/1.1" 200 237
web_1 | [24/May/2021 18:04:58] "GET /admin/blast/blastdb/add/ HTTP/1.1" 200 15281
web_1 | [24/May/2021 18:04:58] "GET /admin/jsi18n/ HTTP/1.1" 200 2372
web_1 | django.request ERROR 2021-05-24 18:05:05,381 10 [Internal Server Error: /admin/filebrowser/browse/]
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
web_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
web_1 | File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
web_1 | return view_func(request, *args, **kwargs)
web_1 | File "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
web_1 | response = view_func(request, *args, **kwargs)
web_1 | File "/code/filebrowser/views.py", line 89, in browse
web_1 | raise ImproperlyConfigured, _("Error finding Upload-Folder. Maybe it does not exist?")
web_1 | ImproperlyConfigured: Error finding Upload-Folder. Maybe it does not exist?
web_1 | [24/May/2021 18:05:05] "GET /admin/filebrowser/browse/?pop=1&dir=blast/db/&type=FASTA&filter_type=FASTA HTTP/1.1" 500 101471