python - Django mongonaut : 'You do not have permissions to access this content.'

标签 python django mongodb mongoengine

我从这里得到了示例简单的 Django + Mongoengine 应用程序 https://github.com/sneawo/django_mongo_test 这是在 Mongodb 中存储帖子的简单博客应用程序。 现在我想要管理界面,为此我找到了 django-mongonaut http://django-mongonaut.readthedocs.org/en/latest/installation.html

我通过了所有安装说明,但在尝试访问 localhost:8000/mongonaut/ 时我仍然看到 您没有访问此内容的权限。 什么是最糟糕的是 - 没有任何登录表单。

这是我的 mongoadmin.py

# myapp/mongoadmin.py   http://django-mongonaut.readthedocs.org/en/latest/configuration.html

# Import the MongoAdmin base class
from mongonaut.sites import MongoAdmin

# Import your custom models
from blog.models import Post, Tag

# Instantiate the MongoAdmin class
# Then attach the mongoadmin to your model
Post.mongoadmin = MongoAdmin()
Tag.mongoadmin = MongoAdmin()

我是 django 的新手,这是我最后一次使用 Django + Mongodb 的机会,我花了几天时间浏览了我在网上找到的多个教程 - 尝试了 django-nonrel 和 mongodb-engine,以及其他选项。

我真的很沮丧,因为我找不到完整的工作教程,其中一些有效,但出现意外错误。 我也试过 Quokka http://quokkaproject.org/but它是 alpha 版,有些页面也无法正常工作...

最佳答案

答案是:我需要使用标准管理界面和 sqlite3.db 登录到 Django,然后 session 引擎开始识别 mongonaut 管理(我认为这是糟糕的工作流程)。 我也在用https://pypi.python.org/pypi/regme/0.2.5

关于python - Django mongonaut : 'You do not have permissions to access this content.' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22361620/

相关文章:

python - 序列化器在 Django shell 中工作但在 View 中失败

mongodb - 是否可以在 I5/OS 或 IBMi 服务器上安装 MongoDB?

mongodb - mongodb 中的集合扫描是什么?

node.js - Expressjs 中的 Nodemailer 出错?

python - python 中的压缩列表

python - 如何提高 Python3 的代码覆盖率

python - 如何将列表中的n个数字一一输入?

python - 我惊呆了 : weird problem with python and sockets + threads

python - 在 django 中通过 SSO + OpenID 对 Google Apps 自定义域的用户进行身份验证

python - 图像未在 for 循环中显示