0

I have coding challenge must use technologies:
- Python/Django
- Backend : Django
- Frontend : Angular
- Database : MongoDB
I found some problems in login, in django how i can login using database mongodb

views

def auth_login(request, on_success='/', on_fail='/account/login'):  
user = authenticate(username=request.POST['email'], password=request.POST['password'])
if user is not None:
    login(request, user)
    return redirect(on_success)
else:
    return redirect(on_fail)

Error :
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

2
  • post the database settings in settings.py. Commented Dec 27, 2017 at 23:21
  • @aircraft DATABASES = { 'default': { 'ENGINE': 'django.db.backends.dummy', } } AUTHENTICATION_BACKENDS = ( 'products.backend.AuthBackend', ) from mongoengine import * connect('shops') Commented Dec 27, 2017 at 23:27

1 Answer 1

1

The correct configuration of mongodb database in settings:

DATABASES = {
    'default': {
        'ENGINE': 'django_mongodb_engine',
        'NAME': 'your-database',
        'USER': 'your-databaseuser',
        'PASSWORD': 'your-password',
        'HOST': '127.0.0.1',
        'PORT': 'the-port',
    }
}

Django uses dummy if the database ENGINE setting is empty (None or empty string).

and it raise Exception:

ImproperlyConfigured("settings.DATABASES is improperly configured. "
                       "Please supply the ENGINE value. Check "
                       "settings documentation for more details.")

So, your error is caused by setting the ENGINE to django.db.backends.dummy

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you i think it support just python 2.x i'm using 3 but np i will use 2.x
But port must be an int instead of a string

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.