Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection by MongoDB URI #66

Closed
jvc26 opened this issue Sep 8, 2013 · 3 comments
Closed

Connection by MongoDB URI #66

jvc26 opened this issue Sep 8, 2013 · 3 comments
Labels
stage: waiting-for-contributor Waiting for answer from original contributor. type: enhancement Enhancement update for old feature

Comments

@jvc26
Copy link

jvc26 commented Sep 8, 2013

I think it would be cleaner to enable configuration using a MongoDB URI, which can be parsed to fill in the required environment variables.

For example, storing a simple 1-variable URI in the environment

MONGODB_URI = 'mongodb://test:test@test.com/testdb'

Which is then parsed and used for the connection, if present.

Is there a design choice to not enable this feature, or is it something you'd consider a patch for?

@JSteunou
Copy link

JSteunou commented Sep 8, 2013

It works with 'HOST' but as weird as it can be, it need 'DB' (not empty string) being set even if it does not use it.

@lafrech
Copy link
Member

lafrech commented Feb 26, 2016

From what I understand of _create_connection, I think this is obsolete:

    # Handle uri style connections
    elif "://" in conn.get('host', ''):
        uri_dict = uri_parser.parse_uri(conn['host'])
        conn['db'] = uri_dict['database']

    return mongoengine.connect(conn.pop('db', 'test'), **conn)

Should this issue be closed?

@lafrech lafrech added stage: waiting-for-contributor Waiting for answer from original contributor. type: enhancement Enhancement update for old feature labels Feb 26, 2016
@losintikfos
Copy link
Member

This has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: waiting-for-contributor Waiting for answer from original contributor. type: enhancement Enhancement update for old feature
Projects
None yet
Development

No branches or pull requests

4 participants