All Projects → jeffbr13 → django-ipfs-storage

jeffbr13 / django-ipfs-storage

Licence: MPL-2.0 license
IPFS storage backend for Django.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to django-ipfs-storage

go-ipfs-plugin-i2p-gateway
A plugin for presenting an IPFS gateway over i2p
Stars: ✭ 14 (-46.15%)
Mutual labels:  ipfs
ipfs-api-mount
Mount IPFS directory as local FS.
Stars: ✭ 16 (-38.46%)
Mutual labels:  ipfs
ipgit
Inter Planetary Git
Stars: ✭ 62 (+138.46%)
Mutual labels:  ipfs
photos
"Fx Fotos" is an opensource gallery app in react native with the same smoothness and features of Google Photos and Apple Photos. It is backend gnostic and connects to decentralized backends like "box", "Dfinity", "Filecoin" and "Crust".
Stars: ✭ 620 (+2284.62%)
Mutual labels:  ipfs
qd-messages-ts
No ads, no tracking. Just a lightning fast peer-to-peer cross-platform messenger that doesn’t sell you out.
Stars: ✭ 22 (-15.38%)
Mutual labels:  ipfs
go-ipns
Utilities for creating, parsing, and validating IPNS records
Stars: ✭ 35 (+34.62%)
Mutual labels:  ipfs
go-ipfs
Ungx-ed fork of go-ipfs
Stars: ✭ 31 (+19.23%)
Mutual labels:  ipfs
IPFS-Ethereum-Image
【IPFS + 区块链 系列】 入门篇 - IPFS + Ethereum (下篇)-ipfs + Ethereum 大图片存储
Stars: ✭ 57 (+119.23%)
Mutual labels:  ipfs
orbit-db-cli
CLI for orbit-db
Stars: ✭ 60 (+130.77%)
Mutual labels:  ipfs
go-ipld-eth-import
🌐 Bring Ethereum to IPFS 🌐
Stars: ✭ 24 (-7.69%)
Mutual labels:  ipfs
dynamic-data-and-capabilities
[ARCHIVED] Dynamic Data and Capabilities in IPFS Working Group
Stars: ✭ 57 (+119.23%)
Mutual labels:  ipfs
geesome-node
🦈 Your self-hosted decentralized Messenger, Social network, Media file storage on top of IPFS! Freely communicate in encrypted chat groups, share images, video, text or any data without a risk of censorship or blocking.
Stars: ✭ 90 (+246.15%)
Mutual labels:  ipfs
Aya
your globally distributed waifu storage
Stars: ✭ 32 (+23.08%)
Mutual labels:  ipfs
insta-share
Instant File Sharing powered by IPFS Networks. Build with Vue 3 and ViteJS
Stars: ✭ 53 (+103.85%)
Mutual labels:  ipfs
nft-market-service
NFT Market service to mint tokens on IPFS
Stars: ✭ 76 (+192.31%)
Mutual labels:  ipfs
piratcloud
an ipfs-based encrypted backup solution
Stars: ✭ 20 (-23.08%)
Mutual labels:  ipfs
prometheus-spec
Censorship-resistant trustless protocols for smart contract, generic & high-load computing & machine learning on top of Bitcoin
Stars: ✭ 24 (-7.69%)
Mutual labels:  ipfs
ipfs-pubsub-chatroom
Simple IPFS Pubsub chatroom built on React
Stars: ✭ 45 (+73.08%)
Mutual labels:  ipfs
sailplane-web
Collaborative p2p file sharing in the browser
Stars: ✭ 71 (+173.08%)
Mutual labels:  ipfs
pinion
📌Pin orbit-db stores and ipfs hashes
Stars: ✭ 29 (+11.54%)
Mutual labels:  ipfs

django-ipfs-storage

Store Django file-uploads on the Interplanetary File System.

Uploads are added and pinned to the configured IPFS node, which returns the IPFS Content ID (a hash of the contents). This hash is the name that is saved to your database. Duplicate content will also have the same address, saving disk space.

Because of this only file creation and reading is supported.

Other IPFS users access and reseed a piece of content through its unique content ID. Differently-distributed (i.e. normal HTTP) users can access the uploads through an HTTP→IPFS gateway.

Installation

pip install django-ipfs-storage

Configuration

By default ipfs_storage adds and pins content to an IPFS daemon running on localhost and returns URLs pointing to the public https://ipfs.io/ipfs/ HTTP Gateway

To customise this, set the following variables in your settings.py:

  • IPFS_STORAGE_API_URL: defaults to 'http://localhost:5001/api/v0/'.
  • IPFS_GATEWAY_API_URL: defaults to 'https://ipfs.io/ipfs/'.

Set IPFS_GATEWAY_API_URL to 'http://localhost:8080/ipfs/' to serve content through your local daemon's HTTP gateway.

Usage

There are two ways to use a Django storage backend.

As default backend

Use IPFS as Django's default file storage backend:

# settings.py

DEFAULT_FILE_STORAGE = 'ipfs_storage.InterPlanetaryFileSystemStorage'

IPFS_STORAGE_API_URL = 'http://localhost:5001/api/v0/'
IPFS_STORAGE_GATEWAY_URL = 'http://localhost:8080/ipfs/'

For a specific FileField

Alternatively, you may only want to use the IPFS storage backend for a single field:

from django.db import models

from ipfs_storage import InterPlanetaryFileSystemStorage 


class MyModel(models.Model):
    # …
    file_stored_on_ipfs = models.FileField(storage=InterPlanetaryFileSystemStorage()) 
    other_file = models.FileField()  # will still use DEFAULT_FILE_STORAGE

Don't forget the brackets to instantiate InterPlanetaryFileSystemStorage() with the default arguments!

FAQ

Why IPFS?

Not my department. See https://ipfs.io/#why.

How do I ensure my uploads are always available?

I don't know. Maybe look into using ipfs-cluster to spread it across a few nodes? Or perhaps you could integrate Eternum's hosted pinning service.

How do I backup my uploads?

See above.

How do I delete an upload?

Because of the distributed nature of IPFS, anyone who accesses a piece of content keeps a copy, and reseeds it for you automatically until it's evicted from their node's local cache. Yay bandwidth costs! Boo censorship!

Unfortunately, if you're trying to censor yourself (often quite necessary), this means the best we can do is unpin the piece of content from your own IPFS node(s) and hope nobody else has pinned it.

How do I securely expose my IPFS daemon's API to connect remotely?

Someone please tell me.

How do I securely expose my own IPFS←HTTP Gateway?

Again, see above.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].