Module “django.core.context_processors” does not define a “auth” callable request processor

后端 未结 2 2004
花落未央
花落未央 2020-12-29 01:32

I have a Django live website , i want to do some kind of maintenance on it but when I downloaded it and tried to open it from my local machine and my debug mode is true I

2条回答
  •  情书的邮戳
    2020-12-29 02:08

    First check your Django version:

    go into your app and run

    $./manage.py shell
    import django
    django.get_version()
    

    In Django >1.4 the previously deprecated-marked setting DATABASE_ENGINE is removed. (This deprecation/removal like tic/toc-cycle is typical for the Django project. )

    I am using the following code to fix legacy scripts, which for some reasons have to be kept obsolete...

        if not ((hasattr(settings, 'DATABASE_ENGINE') and (settings.DATABASES['default']['ENGINE'] or 'ENGINE' in [x for y in settings.DATABASES.itervalues() for x in y]))):
          try:
            setattr(settings, 'DATABASE_ENGINE', settings.DATABASES['default']['ENGINE'])
          except:
            raise Exception('No default ENGINE set in settings.DATABASES!')
    

    Hope this helps.

提交回复
热议问题