-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d8bf14
commit 6de4853
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Installation | ||
|
||
Cloudvault is built off of the [Cloudinary](https://cloudinary.com/) platform. So before installing the package, it will be great to create an account and get the 'API CREDENTIALS'. | ||
|
||
Click [here](https://cloudinary.com/users/register_free) to create an account and then get your credentials on login. | ||
|
||
After that, you can proceed to `cloudvault` installation. | ||
|
||
``` | ||
pip install cloudvault | ||
``` | ||
|
||
Once `cloudvault` is installed, go to your project's settings.py and add the following lines | ||
|
||
``` | ||
#!/usr/bin/python | ||
# settings.py | ||
INSTALLED_APPS = [ | ||
# ... other apps | ||
"cloudvault" # can be omitted | ||
] | ||
CLOUDINARY = { | ||
"cloud_name": "your_cloud_name", | ||
"api_key": "your_api_key", | ||
"api_secret": "your_api_secret" | ||
} | ||
DEFAULT_FILE_STORAGE = "cloudvault.cloud_storage.CloudinaryStorage" | ||
``` | ||
|
||
## Usage | ||
Nothing changes when using `cloudvault` in your project. | ||
|
||
``` | ||
#!/usr/bin/python | ||
# models.py | ||
class Picture(models.Model): | ||
image = models.ImageField() | ||
def __str__(self); | ||
return str(self.id) | ||
``` | ||
|
||
When a `Picture` instance is saved, it saves it to cloudinary `self.image.url` returns a url that points to the image on `cloudinary` | ||
|
||
|
||
## Installing the Project Locally | ||
|
||
To install the project, simply clone the project to your system and then run | ||
|
||
``` | ||
python -m pip install /path/to/project/cloudvault/cloudvault/dist/cloudvault-1.1.tar.gz | ||
``` | ||
|
||
The project should install successfully. | ||
|
||
### Author | ||
Gabriel Michael Ojomakpene\ | ||
[email protected]\ | ||
09020617734 |