MongoAdmin 2012-04-22

Introducing a new admin interface for MongoDB, written in Python using Django and Bootstrap.

Features

  • Beautiful interface with Bootstrap.
  • Flexible JSON object editor on JavaScript that supports editing nested objects.
  • Filter collections with a query and specify the columns to show.

Screenshots

Code

Get the code from GitHub (https://github.com/thomasst/mongoadmin/):

git clone https://github.com/thomasst/mongoadmin.git

Alternatively, download mongoadmin_project-0.1.tar.bz2 (v0.1, revision 472d30a).

Getting started

Make sure you have the following packages installed:

  • Django 1.4
  • mongo-python-driver

Make a copy the included default project settings:

cp mongoadmin_project/settings.py.dist mongoadmin_project/settings.py

Create a database for Django (by default, it is a MySQL database called mongoadmin, but you can change it in DATABASES in the settings). This database is required to store sessions or to save database connection details.

Fill in SECRET_KEY (can be any random string) in the settings.py file that you created.

Create SQL database tables:

python manage.py syncdb

Run the server:

python manage.py runserver

Go to http://127.0.0.1:8000/ and connect to your Mongo database.

License

BSD

Ideas for further development

Interested in developing MongoAdmin? Here are just a few ideas for improvements:

  • Connecting: Store favorites, support for SSH tunnels
  • Collection view: Ability to store filters / views
  • Support for indexes, etc.

Looking forward to hearing your feedback and seeing your pull requests!


Comments (21)

Thomas says: 2012-05-29

@Brett: Thanks, I fixed this in master.

Brett says: 2012-05-09

This is really great! Will save me a lot of time at the mongo console...

One note: I had pymongo 2.2 (the latest) installed and couldn't get this to run out of the box because pymongo.objectid and pymongo.json_util have been moved to bson.objectid and bson.json_util respectively. Making that change in views.py and forms.py got me up and running.

Thomas says: 2012-05-02

Great! I added this to the README so people hopefully don't run into this problem again.

Arthur says: 2012-05-01

Ok thank you, it works :-)
I forgot to run "python manage.py syncdb"...

Thomas says: 2012-05-01

@Arthur and @Tobias, make sure you have DEBUG enabled so you can see a detailed error message. I will change it to be True by default.

@Tobias, there is no need to use virtualenv. Note that easy_install shouldn't be used anymore. Instead, you could use pip to install your packages. Another option is to manually download the modules and symlink them in a lib directory and add that directory to your PYTHONPATH. I'm sorry that my installation instructions aren't specific enough if you've never used Python.

I'll also consider adding a 500 template to the project so the server error page looks nicer.

Arthur says: 2012-04-30

Hi,

I've got the same problem as Tobias:
- 500.html template seems to be missing,
- "A server error occurred. Please contact the administrator."

I am on OS X 10.6.8.

Any suggestion ?
Thanks,
Arthur

Tobias says: 2012-04-29

Finally, after I reinstalled all modules via virtualenv the server starts. You should maybe consider to describe virtualenv in your instructions. However, a 500.html template seems to be missing. Here is the output when I load the login page: http://pastebin.com/PdqcBemD

Though, the database connection fails with a simple "A server error occurred. Please contact the administrator." message. No hints in the console.

Tobias says: 2012-04-29

I configured the database and mongoadmin as described. Though, when I start the application an error message occurs. There is the same error with Python 2.6.6 and 2.7.0+ but another with 3.2. I am running Ubuntu 10.10. What do I have to do?

$ /usr/bin/python2.7 manage.py runserver
Error: No module named staticfiles

I also tried with Python 3.2

$ /usr/bin/python3.2 manage.py runserver
Traceback (most recent call last):
File "manage.py", line 7, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

Tobias says: 2012-04-29

Hi Thomas.

I would like to encourage you to add some more details to the requirements part of your installation. You should add some more information on how to install "django" and "mongo-python-driver". First question someone could come up with is which version of python is needed? Second question: How do I install the required software. Under Ubuntu you need to do ..

sudo apt-get install python python-dev python-django
sudo easy_install pymongo

I think, some more details will make it much easier to try out your project without having worked with python and django before.
Best, Tobias

Jan Paricka says: 2012-04-24

I'm working on a UI for Cassandra. Same thing, python, Django... I call it Djandra.
If any of you guys have good xhtml, and a little bit of JS, perhaps you can help me to roll this out rapidly...... jparicka(at)gmail.com is the email to reach me on. Creative common license.
Anyways, I absolutely love MongoAdmin!
Kudos for putting the efforts in! :)

Jan Paricka says: 2012-04-24

Wicked! :)

vvo says: 2012-04-23

Great work! I'm sure this will come in handy.

Matt says: 2012-04-23

I think you need to configure the static file URLs for when running locally without a web server.

georgedorn says: 2012-04-23

Keep in mind that this is an interface between django and mongodb, not a means of using django's ORM with mongo.

For that, see the django-nonrel project at https://github.com/django-nonrel/django-nonrel, which allows you to build a 100% mongodb-powered django project using almost all of django core and many third-party django apps.

That's not to take away from this project - mongoadmin and django-nonrel are different solutions to different problems.

Ashu says: 2012-04-23

Well admin was one thing that holds me back in trying mangodb with django

Zohar says: 2012-04-23

You do know mongo is a database right? Why would your app need another db to run?

jesus says: 2012-04-23

You managed to create ugly interface using twitter bootstrap? Congratulations.
Awful whitespace...

BilalBudhani says: 2012-04-23

what a co-incidence !! I'm also writing an interface for mongoDB with same name in php using same bootstrap. Anyways, Nice work

Brian Armstrong says: 2012-04-23

Nice work! Have wanted something like this for a while. I assume this can run on Heroku since they support Django now. https://devcenter.heroku.com/articles/django Would be cool to see a quick start guide there with authentication. Awesome job tho, this is great!

Simon says: 2012-04-22

Great, definitely have this bookmarked.

cyluss says: 2012-04-22

awesome


Leave a comment


↩ Back to homepage