Database storage for Django files
Project description
# Database storage for Django
This package implements the Django Storage API to store any file in any database supported by Django. In many cases it is a bad idea to store files in database because performance can degrade rapidly.
## Requirements
* Python 2.7, 3+
* Django 1.7+
## Installation
1. Install using pip:
```bash
pip install django-dbase-storage
```
2. Add to INSTALLED_APPS:
```python
INSTALLED_APPS = (
...
'dbfile',
)
```
3. Run migrations to create table to store files
```
python manage.py migrate dbfile
```
Now you can set default storage for the whole project in settings:
```python
DEFAULT_FILE_STORAGE = 'dbfile.storage.DatabaseStorage'
```
or specify it for certain fields of your models:
```python
class UserFiles(models.Model):
file = FileField(storage=DatabaseStorage())
```
##Known issues
DatabaseStorage fails to store file if debug-toolbar is enabled. Debug-toolbar converts binary to UTF-8 somewhere
This package implements the Django Storage API to store any file in any database supported by Django. In many cases it is a bad idea to store files in database because performance can degrade rapidly.
## Requirements
* Python 2.7, 3+
* Django 1.7+
## Installation
1. Install using pip:
```bash
pip install django-dbase-storage
```
2. Add to INSTALLED_APPS:
```python
INSTALLED_APPS = (
...
'dbfile',
)
```
3. Run migrations to create table to store files
```
python manage.py migrate dbfile
```
Now you can set default storage for the whole project in settings:
```python
DEFAULT_FILE_STORAGE = 'dbfile.storage.DatabaseStorage'
```
or specify it for certain fields of your models:
```python
class UserFiles(models.Model):
file = FileField(storage=DatabaseStorage())
```
##Known issues
DatabaseStorage fails to store file if debug-toolbar is enabled. Debug-toolbar converts binary to UTF-8 somewhere
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-dbase-storage-0.1.1.tar.gz
.
File metadata
- Download URL: django-dbase-storage-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76bc5269d02386d9297f8685dda661d16446434c06b8182594871f7a8e376e4b |
|
MD5 | 0712fbccfa0cd51f8a607610542d7b97 |
|
BLAKE2b-256 | 03f475880c919cfd1903ac18688725bac98020dd9b24bd27b27bcbffed0557f0 |