Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ujblockchain/django_ipfs
IPFS file storage using Django and Pinata
https://github.com/ujblockchain/django_ipfs
django ipfs pinata pinata-api pinata-ipfs
Last synced: 4 days ago
JSON representation
IPFS file storage using Django and Pinata
- Host: GitHub
- URL: https://github.com/ujblockchain/django_ipfs
- Owner: ujblockchain
- License: mit
- Created: 2024-02-20T17:22:45.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-16T18:02:37.000Z (9 months ago)
- Last Synced: 2024-11-09T19:28:25.920Z (about 1 month ago)
- Topics: django, ipfs, pinata, pinata-api, pinata-ipfs
- Language: Python
- Homepage: https://blockchain.uj.ac..za
- Size: 3.25 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![UJ Blockchain Logo](https://blockchain.uj.ac.za/static/images/main-logo.png)
# UJ Blockchain
South Africa-Switzerland Bilateral Research Chair in Blockchain Technology (UJ Blockchain) aims to explore blockchain integrations with real-world applications and development in Agric food.
## About Project.
DJIPFS uses django and Pinata to store files in IPFS (Interplanetary File System). Files are first checked using SHA256 to verify their hash using file byte string in memory before saving to a local directory. This is done to prevent duplicate in the media root. If a file has not been uploaded before after checking their unique hash, they are then uploaded to IPFS using Pinata API with a copy in the media root. The corresponding ipfs hash, pin size and timestamp are then save to the database along with other details. This project uses the pinata IPFS gateway to lookup files but you can use other gateways like Cloudflare IPFS gateway
## Setup
Set environment variable for Django Secret Key, Debug, Allowed Host, Admin Path and Django Axes Config.
```
SECRET_KEY = '...'
DEBUG = ..
ALLOWED_HOSTS = '...'
ADMIN_PATH = '...'SILENCED_SYSTEM_CHECKS = '...'
AXES_FAILURE_LIMIT = '...'
AXES_COOLOFF_TIME = '...'
AXES_ONLY_ADMIN_SITE = '...'
AXES_LOCKOUT_TEMPLATE = '...'
AXES_LOCKOUT_URL = '...'
AXES_USERNAME_FORM_FIELD = '...'
AXES_RESET_ON_SUCCESS = '...'
AXES_NEVER_LOCKOUT_WHITELIST = '...'
AXES_IP_WHITELIST = '...'
AXES_ENABLE_ACCESS_FAILURE_LOG = '...'
AXES_RESET_ON_SUCCESS = '...'
AXES_LOCKOUT_PARAMETERS = '...'```
### Pinata Credentials
Create an API key from your Pinata dashboard. API key and secrete can be gotten from https://app.pinata.cloud/. Ensure you use replace '...' with right details.
```
# pinata credentials
PINETA_JWT = '...'
PINETA_API_KEY = '...'
PINETA_API_SECRET = '...'```
## Running Project
### Install Dependencies
```
$ poetry install```
### Make Migrations
```
$ python manage.py makemigrations
$ python manage.py migrate```
### create Superuser
```
$ python manage.py createsuperuser```
### Run Server
```
$ python manage.py runserver```