连接每个对象的社交帐户的python软件包-django

时间:2020-09-23 11:22:24

标签: python django django-allauth

#include <GL/glut.h> #include <iostream> void display(); void init(); void reshape(int, int); void mouseFunc(int, int, int, int); const int XMAX = 600; const int YMAX = 600; const int GRID_SIZE = 20; int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB); glutInitWindowPosition(100,100); glutInitWindowSize(XMAX, YMAX); glutCreateWindow("test pgm"); glutDisplayFunc(display); glutReshapeFunc(reshape); glutMouseFunc(mouseFunc); init(); glutMainLoop(); } void display() { glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity(); glPointSize(14); //POINT SIZE #pragma region draw_here glBegin(GL_POINTS); float grid_x = GRID_SIZE - 1; float grid_y = GRID_SIZE - 1; for (float x = -grid_x; x < GRID_SIZE; x++) { for (float y = grid_y; y > -GRID_SIZE; y--) { glVertex2f(x, y); } } glEnd(); #pragma endregion glFlush(); } void init() { glClearColor(0.0, 0.0, 0.0, 1.0); } void reshape(int w, int h) { glViewport(0, 0, (GLsizei)w, (GLsizei)h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-GRID_SIZE, GRID_SIZE, -GRID_SIZE, GRID_SIZE); glMatrixMode(GL_MODELVIEW); } void mouseFunc(int button, int state, int mouse_x, int mouse_y) { int x = -GRID_SIZE - (XMAX / (mouse_x + 1) * 20); int y = GRID_SIZE - (YMAX / (mouse_y + 1) * 20); if(state == 0) std::cout << "button:" << button << "\nstate:" << state << "\n(x,y):(" << x << "," << y << ")\n------\n"; } 和其他社交身份验证软件包的默认行为是它将用户与社交帐户绑定,但是您如何才能实现每个对象的社交身份验证。

这是我的情况。

我是userX,在我的Django应用中,我有一个名为python-social-auth的模型,userX管理着多个公司,每个公司都有自己的Twitter和其他社交帐户。因此,userX将添加每个公司的twitter帐户,但要经过twitter的验证。

有没有一种方法可以修改python-social-auth或all-auth程序包来实现此功能,或者可以推荐其他任何python程序包。

我不想放Company并让用户手动填写社交网址。

0 个答案:

没有答案
相关问题