Skip to main content

Simple MongoDB Administrative Interface for Flask

Project description

This is an Apache2-licensed Flask extension to perform basic queries and updates to MongoDB collections. It is a thin wrapper around pymongo, and as such it relies on it for validation and error checking.

This is a work in progres; I would love for this to become a feature-complete frontend to MongoDB which makes it easy to add on to any flask project.

Features

  • Connect to Mongo databases or replica sets

  • Browse all databases available to a given connection string

  • Create new collections (specify capped, max size, etc)

  • Run queries against collections

  • Create and edit documents

  • Handles AutoReconnect errors and connection string errors

There are many useful things which are not yet part of this extension. Pull requests are absolutely welcome.

Installation

Couldn’t be easier:

$ pip install Flask-MongoMyAdmin

Quickstart

All you need is a valid MongoDB connection URI. This extension can manage multiple databases. You set them via key-value pairs in app.config['MONGOMYADMIN_DATABASES'].

The key is just a display name for that mongo connection. You may set it to whatever you would like. The value is a mongo connection string.

Here is a sample Flask app to get started:

from flask import Flask
from flask.ext.mongomyadmin import MongoMyAdmin

app = Flask(__name__)

app.config['SECRET_KEY'] = 'app secret key'

app.config['MONGOMYADMIN_DATABASES'] = {
    'local': 'mongodb://127.0.0.1:27017',
    'remote_qa': 'mongodb://user@pass:mongo.example.com:27017',
}

m = MongoMyAdmin(app)

@app.route('/')
def index():
    return 'hello'

if __name__ == '__main__':
    app.run(debug=True)

From there, navigate to http://localhost:5000/MongoMyAdmin and you will see your databases.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-MongoMyAdmin-0.1.tar.gz (94.5 kB view details)

Uploaded Source

File details

Details for the file Flask-MongoMyAdmin-0.1.tar.gz.

File metadata

File hashes

Hashes for Flask-MongoMyAdmin-0.1.tar.gz
Algorithm Hash digest
SHA256 95d1d53f2bf802ccc2d55718d7ca52540045fa23decf653d5f14137ba394c588
MD5 2d6bb9e5b314a2fe2a41bcd07f282947
BLAKE2b-256 964729d4135efa4ebfe9640832c29b2c40346ce7dc59ff3eefbb21757cbb0d55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page