A simple application to demonstrate how you can upload and save your images in Cloudinary.
- HTML
- SCSS
- Python and Flask
- Flask-SQLAlchemy
- Flask-Migrate
- Flask-WTF
- SQLite
- Clone this repository on your computer:
$ git clone https://github.com/Remy349/upload-images-cloudinary-python.git
$ cd upload-images-cloudinary-python
- Once inside the repository create and activate a virtual environment:
# For Linux
$ python3 -m venv venv
# Now activate the virtual enviroment
$ . venv/bin/activate
# For Windows(py -3 -m venv venv or...)
$ python -m venv venv
# Now activate the virtual enviroment
$ venv\Scripts\activate
- Install the requirements:
# For Windows could be just "pip"
(venv) $ pip3 install -r requirements.txt
- You will have to add an ".env" file and in it you will have to add the following values for the necessary environment variables:
# .env - Example values
SECRET_KEY=yourownsecretkey
CLOUDINARY_CLOUD_NAME=yourCloudinaryCLOUD_NAME
CLOUDINARY_API_KEY=yourCloudinaryAPI_KEY
CLOUDINARY_API_SECRET=yourCloudinaryAPI_SECRET
To get this data from Cloudinary, you must create your own account, it is very easy to do, I leave you the link:
- Now just run the following commands in the terminal to add the tables to the database and run the server:
# Adding table models to the database
(venv) $ flask db upgrade
# Run the server
(venv) $ flask run
* Serving Flask app 'application.py'
* Running on http://127.0.0.1:5000 (Press CTRL+C to quit)