Open DTHerrera opened 4 years ago
permission_required and admin_required can be used above any routes that you want, case in point:
@main.route('/') @admin_required def index(): return render_template('index.html')
alternatively for permission_required, you need to indicate a minimum permission level to be met:
@main.route('/') @permission_required(Permission.FOLLOW) def index(): return render_template('index.html')
The Stream API Key and Stream Secret are obtained through getstream.io!
Hope this answers your questions
Thanks a lot for your answer.
regardas
Hello Porter, I already have the API KEY and Scret of STREAM, but when I try to execute the command "flask db init" it sends me the following message:
File "C:"Users-DTapia-Downloads-offbrand-react-tutorial-master-app-init.py", line 8, in create_app app.config.from_object(config[config_name]) KeyError: <flask.cli.ScriptInfo object at 0x000001E3E05AB608>
some idea that I'm doing wrong.
On the other hand on the page of "getstream.io" there is a tutorial "https://getstream.io/blog/series-building-a-social-network-with-flask-stream-part-1/" that refers to this page, but the code is very different, you will know where I can download the full code from the tutorial?
Thank you so much for your help.
Best regards.
You need to set the flask application in environment variables before trying to initialize the database.
You can do this is command line with:
(Windows) '''set FLASK_APP=application.py'''
Or
(MAC) '''Export FLASK_APP=application.py'''
Okay, thanks, I continue to have the same problem, I think it's necessary to define somewhere the variable "config_name"
Hello Porter97, how do you implement the use of permission_required decoration and admin_required?
On the other hand there are two data required in the program that are:
STREAM_API_KEY ''#Your API key here STREAM_SECRET ''#Your Secret here
this data as I get it?
thank you very much for your support Kind regards