pycloudinary
pycloudinary copied to clipboard
Set cloudinary url in flask config
Is there a way to set the cloudinary url in flask config so that we don't have to define it as an env variable?
Hi @alexwaters, I'm sorry for the response delay. Unfortunately we currently don't have flask integration and therefore don't currently support Flask's configurations.
Hi, Just add in your env: CLOUDINARY_URL=cloudinary://your_api_key:api_secret@name
Hey can you please assign this to me. I want to work on this issue.
Import the cloudinary module and set the Cloudinary URL in your Flask app's configuration. You should have your Cloudinary URL, which you can obtain from your Cloudinary account:
import cloudinary
app.config['CLOUDINARY_URL'] = 'your_cloudinary_url_here'
app.config['CLOUDINARY_API_KEY'] = 'your_api_key_here'
app.config['CLOUDINARY_API_SECRET'] = 'your_api_secret_here'
Then initialize Cloudinary within your Flask app by using the cloudinary.config() method
cloudinary.config(
cloud_name=app.config['CLOUDINARY_URL'].split('@')[1].split('/')[2],
api_key=app.config['CLOUDINARY_API_KEY'],
api_secret=app.config['CLOUDINARY_API_SECRET']
)
Can you please add hacktoberfest label and close this issue as completed.