Go to advanced search

by jadro
Sun Aug 04, 2019 8:22 pm
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Re: Flask security issue

This is my new code for start: from flask import Flask, jsonify, request from flask_jwt_extended import ( JWTManager, jwt_required, create_access_token, get_jwt_identity ) app = Flask(__name__) # Setup the Flask-JWT-Extended extension app.config['JWT_SECRET_KEY'] = 'super-secret' # Change this! jwt ...
by jadro
Sun Aug 04, 2019 12:49 pm
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Re: Flask security issue

Two hours ago i follow this code and this works great with get and post with Postman: https://github.com/vimalloc/flask-jwt-extended/blob/master/examples/simple.py This will be my start point to do RestFul api using jwt. I learned a lot from this example. Now I will build my whole project based on t...
by jadro
Sat Aug 03, 2019 2:51 pm
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Re: Flask security issue

Anybody knows how to set up postman to get http://localhost:5000/api/v1/private with jwt from my code in last topic?
I try, then try from Google, trying to red couple of pages but postman did not respond to my configs.
I'am new to API RESTFull. Someone to deal with postman?
by jadro
Sat Aug 03, 2019 11:06 am
Forum: General discussion
Topic: Using A Relay Board - Newbie Question
Replies: 2
Views: 158

Re: Using A Relay Board - Newbie Question

I use relay board with GPIO pin for triggering signal and I don't ever connect directly GPIO to IN on relay board because never knows when some problem will occur, that way I got transistor for put signal between 5V raspberry pi GPIO and relay IN and transistor base PIN. Second problem was in my cas...
by jadro
Sat Aug 03, 2019 10:53 am
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Re: Flask security issue

I found this. It may help me to get best RESTApi security + JWT. Is there someone that have been using this module? Here is the code from http://polyglot.ninja/securing-rest-apis-basic-http-authentication-python-flask/: from flask import Flask from flask_restful import Resource, Api from flask_httpa...
by jadro
Thu Aug 01, 2019 5:12 am
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Re: Flask security issue

Thanks for the steps, i will try to implement this. But why REST/CRUD operations that we seen every day from companies do this over http with apikey in encrypted format? Encripted or not, key is in plain text and if stolen, we now that key is compared with key in database, right? This is potencial s...
by jadro
Wed Jul 31, 2019 1:38 pm
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Re: Flask security issue

I alredy have NGINX server with MySql database
by jadro
Tue Jul 30, 2019 3:59 pm
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Re: Flask security issue

Hi, i think do this over http. MySecretKey will be stored in mysql data table users where all users will have unique SecretKey belong to them. My TODO code will take some user data from database table. And if PUT is in path then will update my DataTable. For now, all operations will be on data table...
by jadro
Mon Jul 29, 2019 8:00 pm
Forum: Python
Topic: Flask security issue
Replies: 12
Views: 700

Flask security issue

Hi, is there a security issue if I have on my Flask code route without user login, just as API to get data from database if route url contains apropriate apikey? #here goes some apropriate imports @app.route('/api/v1/data/< string:apikey>/', methods=['GET', 'POST']) def user_data(apikey): #here will...
by jadro
Sun Jun 30, 2019 8:24 pm
Forum: General discussion
Topic: Mqtt restarting user
Replies: 3
Views: 169

Re: Mqtt restarting user

Now I try with sudo /etc/init.d/mosquitto stop and sudo /etc/init.d/mosquitto start and now this works, my mqtt client script in python did not show exception. If my exception occure then I will do screenshot and put on this topic.
by jadro
Sat Jun 29, 2019 8:50 pm
Forum: General discussion
Topic: MQTT client
Replies: 1
Views: 263

Re: MQTT client

I did it, i put my third nodemcu lua mqtt client into local mqtt server two days ago. But strange situation stais, how can second nodemcu bee connected to web online broker and my local mqtt client gets payloads from it.
by jadro
Sat Jun 29, 2019 8:45 pm
Forum: General discussion
Topic: Mqtt restarting user
Replies: 3
Views: 169

Re: Mqtt restarting user

I will try as son as possible, I am on the weekend, when arrive to home I will try to put code and exception
by jadro
Sat Jun 29, 2019 8:39 pm
Forum: General discussion
Topic: Mqtt restarting user
Replies: 3
Views: 169

Mqtt restarting user

Hi, I have 3 users in my mosquitto password file and acl file with topics for users. When I add new topic to user, i have to restart whole raspberry because restarting mqtt server does not work. Can I restart just one user? If I do stop and start mosquitto then my raspberry python mqtt client can no...
by jadro
Fri Jun 28, 2019 9:04 am
Forum: Python
Topic: Python IDE
Replies: 2
Views: 431

Re: Python IDE

I think (I read somewhere) that PyScripter can do this https://sourceforge.net/projects/pyscripter/
It is free and there is also good comunity on google
Jadro
by jadro
Thu Jun 27, 2019 6:46 am
Forum: General discussion
Topic: MQTT client
Replies: 1
Views: 263

MQTT client

Hi folks, Two years ago my Raspberry Pi was connected to my CloudMqtt account user and python application works with connection to that online broker. Then I decided that is time to run ownlocal Mosquitto server and this works for two years from then. Ma python application works with no problems con...
by jadro
Mon Jun 24, 2019 8:30 pm
Forum: General discussion
Topic: Regular restart vs power on after electricity drop down
Replies: 11
Views: 1194

Re: Regular restart vs power on after electricity drop down

Today i start to upgrade jessie to stretch. About one hour has upgraded but at least it was done. After reboot my new OS was unable to operate Upgrading from previous releases is not supported or recommended, and now you know why. Hopefully you made a backup. Best bet is to copy any configuration f...
by jadro
Mon Jun 24, 2019 7:22 pm
Forum: General discussion
Topic: Regular restart vs power on after electricity drop down
Replies: 11
Views: 1194

Re: Regular restart vs power on after electricity drop down

Today i start to upgrade jessie to stretch. About one hour has upgraded but at least it was done. After reboot my new OS was unable to operate normaly. My mqtt server fails, mysql fails, my python installations like beautifulsoap fails, many things fails, then i restore my backup and i am back to je...
by jadro
Mon Jun 24, 2019 4:58 am
Forum: Python
Topic: Pythonanywhere
Replies: 4
Views: 983

Re: Pythonanywhere

Thanx to all for informations
by jadro
Sat Jun 22, 2019 7:46 pm
Forum: Python
Topic: Pythonanywhere
Replies: 4
Views: 983

Re: Pythonanywhere

Is pythonanywhere or trinket.io something like web hostings, can I create and put pages in flask there? Can I connect it that my web www.something.com works in this sites?
by jadro
Sat Jun 22, 2019 7:43 pm
Forum: General discussion
Topic: Regular restart vs power on after electricity drop down
Replies: 11
Views: 1194

Re: Regular restart vs power on after electricity drop down

Does what ever your auto start script is doing relay on networking ? because after a power fail your networking may take longer to establish because your router will be rebooting too, so your auto start script will fail becuae it can't connect. I think I do not have code that needs to do anything o...
by jadro
Sat Jun 22, 2019 7:40 pm
Forum: General discussion
Topic: Regular restart vs power on after electricity drop down
Replies: 11
Views: 1194

Re: Regular restart vs power on after electricity drop down

Why are you using Raspbian Jessie when it has been superseded by Raspbian Stretch for nearly two years? The preferred way to start non-GUI programs is to use systemd. You only have to create a little simple systemd service file to do that. For example like this: https://www.raspberrypi.org/forums/v...
by jadro
Sat Jun 22, 2019 7:08 am
Forum: General discussion
Topic: Regular restart vs power on after electricity drop down
Replies: 11
Views: 1194

Regular restart vs power on after electricity drop down

Hi, maybe is just coincidence, but couple of times... When reboot my Raspberry pi after update and so, just regular (Raspbian Jessie) it reboot with my start script (autostart). But when electricity goes down and came back, autostart does not start anytime. Is there another Raspberry start mechanism...
by jadro
Sat Jun 22, 2019 7:03 am
Forum: Python
Topic: Pythonanywhere
Replies: 4
Views: 983

Pythonanywhere

Hi,

I fount this site and didn't try it for now.
Anyone with experience with this site and Python develop?
Thanks,
Jadro
by jadro
Mon Jun 17, 2019 9:51 am
Forum: General discussion
Topic: Motion sensor problems
Replies: 14
Views: 688

Re: Motion sensor problems - [SOLVED]

I move sensor about 1 meter from my wifi router, and for now, motion sensor does not trigger false anymore. Thanx for this solution. I did not know this can be a problem.
Jadro
by jadro
Sat Jun 15, 2019 2:39 pm
Forum: General discussion
Topic: Motion sensor problems
Replies: 14
Views: 688

Re: Motion sensor problems

Yes thanx, this will be my next step, removing it from wifi or remove raspberry because they are 30 centimeter from wifi device. And this maybe a problem because this start to happening when i replace my old router wifi

Go to advanced search