我是Django新手,教程直接应用了这个命令,没有解释。
经过搜索,我发现它在 Django 中调用迁移,但也不理解它,因为我对此完全是新手。
python manage.py migrate该命令的具体作用是什么?什么是迁移?
我是使用地图的新手,当我尝试使用下面的代码对其进行排序时
#include <iostream>
#include<map>
#include<algorithm>
using namespace std;
int main()
{
map<int,int> mp;
mp[2]++;
mp[5]++;
mp[1]++;
sort(mp.begin(), mp.end());
}
Run Code Online (Sandbox Code Playgroud)
抛出一个错误:
In file included from /usr/include/c++/6/algorithm:62:0,
from main.cpp:11:
/usr/include/c++/6/bits/stl_algo.h: In instantiation of ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::_Rb_tree_iterator<std::pair<const int, int> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
/usr/include/c++/6/bits/stl_algo.h:4707:18: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = std::_Rb_tree_iterator<std::pair<const int, int> >]’
<span class="error_line" onclick="ide.gotoLine('main.cpp',21)">main.cpp:21:30</span>: required from here
/usr/include/c++/6/bits/stl_algo.h:1966:22: error: no match for ‘operator-’ (operand types are ‘std::_Rb_tree_iterator >’ and ‘std::_Rb_tree_iterator >’)
std::__lg(__last - …Run Code Online (Sandbox Code Playgroud)