dry-python/bookshelf

Profile matching query does not exist error on accessing admin's profile

Hiyorimi opened this issue · 4 comments

I get "DoesNotExist at /profile/ Profile matching query does not exist." error when trying access profile when I'm logged in as an admin.

Suggested behaviour: create profile for admin if it is absent, or display verbose error, not exception.

Hi,

Thank you for giving the dry-python project a try.

I saw all the PRs you've sent. I'll take a closer look at them on Monday.

If you have any questions, don't hesitate to ask.

Have a good weekend.

Best regards,
Artem.

waiting )

Yep, I could confirm

$ . .env/bin/activate
(.env) $ pip install -r requirements.txt 
Obtaining dependencies from git+https://github.com/dry-python/dependencies.git@e2b09b1f4244aa2b7d74566324b725a3d8e6c975#egg=dependencies (from -r requirements.txt (line 1))
  Cloning https://github.com/dry-python/dependencies.git (to revision e2b09b1f4244aa2b7d74566324b725a3d8e6c975) to ./.env/src/dependencies
Collecting attrs==19.1.0 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl
Collecting django-debug-toolbar==2.0 (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/67/ed/587fd4fd954717fb4cd6b87fa3345ff793ecb995d91c604fcaf26510eeff/django_debug_toolbar-2.0-py3-none-any.whl
Collecting django-extensions==2.2.1 (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/72/0d/fde2cf0ae7e1d12d105683d0259c17c151de4efd5d166c0ec1335541e7ba/django_extensions-2.2.1-py2.py3-none-any.whl
Collecting django==2.2.5 (from -r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/94/9f/a56f7893b1280e5019482260e246ab944d54a9a633a01ed04683d9ce5078/Django-2.2.5-py3-none-any.whl
Collecting djangorestframework==3.10.3 (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/33/8e/87a4e0025e3c4736c1dc728905b1b06a94968ce08de15304417acb40e374/djangorestframework-3.10.3-py3-none-any.whl
Collecting pytz==2018.9 (from -r requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl
Collecting six==1.12.0 (from -r requirements.txt (line 8))
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting sqlparse==0.2.4 (from -r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/65/85/20bdd72f4537cf2c4d5d005368d502b2f464ede22982e724a82c86268eda/sqlparse-0.2.4-py2.py3-none-any.whl
Collecting stories==0.10.1 (from -r requirements.txt (line 10))
  Downloading https://files.pythonhosted.org/packages/93/2a/78402bf55dfa06f9304957d45898b981a6055b814ca25aea1a19fe04be2f/stories-0.10.1-py2.py3-none-any.whl
Installing collected packages: dependencies, attrs, pytz, sqlparse, django, django-debug-toolbar, six, django-extensions, djangorestframework, stories
  Running setup.py develop for dependencies
Successfully installed attrs-19.1.0 dependencies django-2.2.5 django-debug-toolbar-2.0 django-extensions-2.2.1 djangorestframework-3.10.3 pytz-2018.9 six-1.12.0 sqlparse-0.2.4 stories-0.10.1
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(.env) $ python manage.py createsuperuser
SystemCheckError: System check identified some issues:

ERRORS:
?: (admin.E404) 'django.contrib.messages.context_processors.messages' must be enabled in DjangoTemplates (TEMPLATES) in order to use the admin application.

The preferred way to fix this:

  • Implement service class for something like setup, bootstrap, or similar.
  • Wrap it into an injector.
  • Add repository functions as necessary.
  • Use injector in the management command.

If you are really motivated to solve it the right way in the "dry-python spirit", try to implement proofit404/dependencies#156 first.

Best regards,
Artem.

Fixed by #60.