简体   繁体   English

我如何在MongoDB中使用内置的django身份验证和管理面板? 我如何在mongoDB的settings.py中建立类似于常规SQL的连接

[英]how can i use inbuilt django authentication and admin panel with MongoDB ? How can i make a connection like regular SQL in settings.py for mongoDB

connection with this settings works for CRUD methods but is incompatible for admin panel and authenticaion.if there is some way by which i can make connection with MongoDB like our regular POSTGRES,SQLITE eg with engine and port numbers in DATABASE Varibale in Settings.py file . 与此设置的连接适用于CRUD方法,但与管理面板和身份验证不兼容。如果可以通过某种方式与MongoDB建立连接,例如常规的POSTGRES,SQLITE,例如在Settings.py文件中的DATABASE Varibale中具有引擎和端口号。 Please Suggest 请建议

#

Settings.py Settings.py

from mongoengine import *
from calculator.settings import DBNAME
# Create your models here.

connect(DBNAME)

class information(Document):
    number1 = StringField(max_length=120)
    number2 = StringField(max_length=120)
    values = StringField(max_length=120)
    Result = StringField(max_length=120)
#

models.py models.py

 from mongoengine import * from calculator.settings import DBNAME # Create your models here. connect(DBNAME) class information(Document): number1 = StringField(max_length=120) number2 = StringField(max_length=120) values = StringField(max_length=120) Result = StringField(max_length=120) 
#

Please help me how should i proceed for admin panel and Authentication? 请帮助我如何继续进行管理面板和身份验证?

You can use django mongoengine . 您可以使用django mongoengine This is good for basic admin CRUD applications and will quickly get your work done. 这对于基本的admin CRUD应用程序非常有用,并且可以很快完成您的工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Django 中为 MongoDB 配置 settings.py? - How to configure settings.py in Django for MongoDB? 给定数据库的 ODBC 连接字符串,如何修改我的 settings.py 以便我的 Django 应用程序连接到它? - Given an ODBC connection string for a database, how can I modify my settings.py such that my Django app will connect to it? 如何为mongodb配置settings.py? - How to configure settings.py for mongodb ? 在Django 1.8中,如何设置settings.py以便管理静态文件? - In Django 1.8, how can I set settings.py so that manage static files? 如何在 Django settings.py 中获取第三方应用程序的路径 - How can I get path of 3rd party app in Django settings.py 我如何在 settings.py 的 django-ckeditor 中执行“removeEmptyTag:False” - how can i do "removeEmptyTag:False" in django-ckeditor in settings.py 在Django中,如何在项目之外的新应用程序中重用settings.py. - In Django, how can I reuse settings.py in a new app outside of the project 在具有不同版本的settings.py的Django项目中,我可以在设置上使用dict.update()方法吗? - In a Django project with different versions of settings.py, can I use a dict.update() method on a setting? 如何使urlpatterns和pattern可用于settings.py? - How do I make urlpatterns and patterns avaliable for settings.py? 如何在我的settings.py中的DEBUG变量在Django的模板中可用? - How do I make the DEBUG variable in my settings.py available in my templates in Django?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM