Error finding Upload-Folder. Maybe it does not exist?

51 views
Skip to first unread message

Michał T. Lorenc

unread,
May 24, 2021, 6:25:39 PM5/24/21
to django...@googlegroups.com
Hello,
I found a Django project and failed to get it running in Docker container in the following way:

 2. `$ cat requirements.txt` in this files the below dependencies had to be updated:
    - psycopg2==2.8.6 

I have the following Dockerfile:

```
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
```

For `docker-compose.yml` I use:

```
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
```

```
$ cat scripts/install-extensions.sql 
CREATE EXTENSION hstore;
```

I had to change:

```
    $ vim i5k/settings.py
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'postgres',
            'USER': 'postgres',
            'PASSWORD': 'postgres',
            'HOST': 'db',
            'PORT': '5432',
            }
    }
```

Next, I ran:
  1. `docker-compose up --build`
  2. `docker-compose run web python manage.py`
  3. `docker-compose run web python manage.py migrate`
  4. `docker-compose run web python manage.py createsuperuser`
Finally, I opened in Browser `http://localhost:8000/admin/blast/blastdb/add/` and try to upload a file and got this error:

```
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
```
Where do I have to create blast/db folder?


Thank you in advance

Mic

unread,
May 26, 2021, 9:09:36 AM5/26/21
to Django users
I tried to create the missing `blast/db` folder in the following way but it still does not work:

```
$ docker-compose exec web /bin/bash
# pwd
/code
# mkdir -p blast/db
# mkdir -p i5k/blast/db
```
Where do I have to create blast/db folder?

Thank you in advance,

Michal
Reply all
Reply to author
Forward
0 new messages