130
The problem was that I deleted an __init__.py
file. Apparently, django uses them to know which folders are apps, so they are kind of important.
2
The error is in your ledger
app. Is this a custom app?
From the Django source code, the error comes from _path_from_module(app_module)
# Filesystem path to the application directory eg.
# u'/usr/lib/python2.7/dist-packages/django/contrib/admin'. Unicode on
# Python 2 and a str on Python 3.
if not hasattr(self, 'path'):
self.path = self._path_from_module(app_module)
As a quick fix, if this is your app, you can configure it with an AppConfig
subclass that has a valid path
attribute, which will stop the bug from executing. I’m looking into it further now.
If ledger
is not your app, and you’ve updated it through pip
or some other means, this explains why checking out an older version does not fix the problem. Try getting an older version of that app from its repository (if applicable) and submit a bug report.
- [Django]-Django queries – id vs pk
- [Django]-Django-rest-framework: api versioning
- [Django]-No module named urllib.parse (How should I install it?)
1
Inside the application directory, edit the file apps.py
and add the path
attribute as the error says. For example:
from django.apps import AppConfig
import os
from django.conf import settings
class TranslatorConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'translator'
path = os.path.join(settings.BASE_DIR, 'translator')
And … BOOM!!
- [Django]-How to get the username of the logged-in user in Django?
- [Django]-Unit testing with django-celery?
- [Django]-Django's SuspiciousOperation Invalid HTTP_HOST header