Category : python

I have to perform a XOR operation on the two strings, I got the python implementation of it: def sxor(s1,s2): return ”.join(chr(ord(a) ^ ord(b)) for a,b in zip(s1,s2)) In the above code , we are running the for loop on the strings and we are creating the tuples of it. string 1: abcdefghijklmn string 2: ..

Read more

ERROR: Could not find a version that satisfies the requirement django-iedge==0.1 (from versions: none) ERROR: No matching distribution found for django-iedge==0.1 The command ‘/bin/sh -c /bin/pip3.6 install -r /web/www/requirements.txt’ returned a non-zero code: 1 I changed it to django-edge=0.1 still return error Source: Angular..

Read more

I’ve made an implementation of a login system using django as backend and angular as frontend. In the backend the authentication is implemented via the view associated to auth/signup from django.contrib import admin from django.urls import include, path from rest_framework import routers from shopping.views import listatodoseventos from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token urlpatterns = [ path(‘admin/’, ..

Read more

I have the python server (Flask more precisely) up and running and it is connecting correctly to my CAS server, redirecting to CAS login, and returning correct user data upon login. This is relevant code from flask server: cas_client = CASClient( version=3, service_url="http://localhost:5000/login?next=%2Fprofile", server_url=’https://django-cas-ng-demo-server.herokuapp.com/cas/’ ) @app.route("/profile") def profile(method=["GET"]): if "username" in session: return render_template( "profile.html", ..

Read more

I am developing a simple live chat using Web Socket using flask_socketio with Angular on frontend. web-socket.service.ts openWebSocket(): void { this.webSocket = new WebSocket(‘ws://localhost:5000’); this.webSocket.onopen = (event) => { console.log(‘Opened connection: ‘, event); }; this.webSocket.onmessage = (event) => { const chatMessageDTO = JSON.parse(event.data); this.chatMessages.push(chatMessageDTO); }; this.webSocket.onclose = (event) => { console.log(‘Closed connection: ‘, event); }; ..

Read more