Skip to main content

django mongoadmin

This a drop in replacement for the django admin that works with monodb. It uses the django admin stuff wherever possible and can be used together with normal django models and a SQL database.

Requirements

Usage

Add mongoadmin to INSTALLED_APPS settings

INSTALLED_APPS = (
    ...
    'mongoadmin',
    'django.contrib.admin',
    ...
)

Add mongoadmin to urls.py

from django.contrib import admin
admin.autodiscover()

from mongoadmin import site

urlpatterns = patterns('',
    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(site.urls)),
)

The admin.py for your app needs to use mongoadmin instead of django’s admin:

from mongoadmin import site, DocumentAdmin

from app.models import AppDocument

class AppDocumentAdmin(DocumentAdmin):
    pass
site.register(AppDocument, AppDocumentAdmin)

Now the document should appear as usual in django’s admin.

Using third party apps with mongoadmin

To use third party apps (i.e. apps that register their admin classes in django.contrib.admin.site) with mongoadmin you have to add MONGOADMIN_OVERRIDE_ADMIN = True to your settings file. This overrides the django admin site with mongoadmin’s admin site.

What works and doesn’t work

django-mongoadmin currently only supports the most basic things and even they are not really tested.

You probably won’t be able to use all of the nice stuff Django provides for relations. The problem is that Django bi-directional relations with a lot of magic, while mongoengine has a uni-directional ReferenceField. So in order to make relations really work one would either have to inject so much code into the documents and querysets that they become clones of Django’s stuff or rewrite huge parts of the admin. If you feel that either approach is worth it, go for it and submit a pull request. Otherwise feel free to submit an issue but don’t get your hopes up for a fix.

Metadata

Release files for mongoadmin 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mongoadmin 0.2
File Size Uploaded
mongoadmin-0.2.tar.gz 35.7 kB Details

Release files / mongoadmin-0.2.tar.gz

Download URL mongoadmin-0.2.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a4c8149b441eb55607e6359b9bd9185cb558db379b74f87ca022d741e4da9c90
BLAKE2b-256 checksum
How to use checksums
d983b0ae472244b9300ab0d9ba4f90848d7843f52efeeafff9bd6e4d2e69be26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page