Skip to content

Commit

Permalink
Added readme documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
codewitgabi committed Jun 9, 2023
1 parent 9d8bf14 commit 6de4853
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions README.md
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

0 comments on commit 6de4853

Please sign in to comment.