|
4 | 4 | sys.path.append("..") |
5 | 5 |
|
6 | 6 | # #### set your private_key public_key, url_endpoint, url ### ## |
7 | | -private_key = "" |
8 | | -public_key = "" |
9 | | -url_endpoint = "https://ik.imagekit.io/pshbwfiho" |
| 7 | +private_key = "your_public_api_key" |
| 8 | +public_key = "your_private_api_key" |
| 9 | +url_endpoint = "https://ik.imagekit.io/your_imagekit_id/" |
10 | 10 | # dummy image url |
11 | 11 | url = "https://file-examples.com/wp-content/uploads/2017/10/file_example_JPG_100kB.jpg" |
12 | 12 |
|
|
23 | 23 | file_name="testing_upload_binary_signed_private.jpg", |
24 | 24 | options={ |
25 | 25 | "response_fields": ["is_private_file", "tags"], |
26 | | - "is_private_file": True, |
| 26 | + "is_private_file": False, |
27 | 27 | "folder" : "/testing-python-folder/", |
28 | 28 | "tags": ["abc", "def"] |
29 | 29 | }, |
|
33 | 33 | print("Upload with binary") |
34 | 34 | print("-------------------------------------") |
35 | 35 | print(upload, end="\n\n") |
36 | | - |
| 36 | + |
37 | 37 | image_url = imagekit.url( |
38 | 38 | { |
39 | 39 | "path": upload['response']['filePath'], |
|
143 | 143 | file_name="testing-url.jpg", |
144 | 144 | options={ |
145 | 145 | "response_fields": ["is_private_file"], |
146 | | - "is_private_file": True, |
| 146 | + "is_private_file": False, |
147 | 147 | "tags": ["abc", "def"], |
148 | 148 | }, |
149 | 149 | ) |
|
162 | 162 | file_name="testing-base64.jpg", |
163 | 163 | options={ |
164 | 164 | "response_fields": ["is_private_file", "metadata", "tags"], |
165 | | - "is_private_file": True, |
| 165 | + "is_private_file": False, |
166 | 166 | "tags": ["abc", "def"], |
167 | 167 | }, |
168 | 168 | ) |
|
0 commit comments