Django admin and MongoDB, possible at all?

前端 未结 7 822
野的像风
野的像风 2021-02-04 03:01

I\'m building a simple short URL service, ala bitly, for our company use. And I would like to use mongodb to store the data, but I will need some kind of simple interface to add

7条回答
  •  天命终不由人
    2021-02-04 03:36

    I have confirmed that django-nonrel project does support the admin interface. I did have a problem where the default SITE_ID was picked up as a number, which is not allowed as a primary key in MongoDB. I resolved this by setting:

    SITE_ID = '4d421623b0207acdc500001d'

    in my settings.py

    I got the number by printing the id of the first site value in the collection through the shell.

    I have not tested this extensively, but did register an admin for a Poll object and see it work.

提交回复
热议问题