1.连接mongodb数据库(如果mongo命令没有做环境变量配置,需要定位到有mongo命令的目录) root@AY140709212620347s22Z:~# mongo MongoDB shell version: 2.4.10 connecting to: test 2.切换到admin数据库,并添加管理员,退出(ctrl+c) > use admin switched to db admin > db.addUser('admin','admin') { "_id"
1.新建一个类,设置角色: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using System.Web.Security; namespace InfoData.Enum { public enum ERoles { Admin,
1.users相关的api开发 1.在settings中添加APPID,SECRET 2.在apps/users/views.py内: from chaoyuecun.settings import APPID,SECRET import urllib.request from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.renderers