semvec/pypi-packages huggingface dataset:
django-file-organization 0.1.1
Django packet for easy file organization.
License: MIT
Requires Python: >=3.9,<4.0
Keywords: Django,Django Rest Framework

Django file organization 
========================
`django_file_organization` is a Django library it is an easy way to save files to folders by name and date.

Installation
------------

django-file-organization is hosted on [PyPI](https://pypi.org/project/django-file-organization/) and can be installed as such:

pip install django-file-organization  

Alternatively, you can also get the latest source code from Github and install it manually.

Usage
-----

To use the library, just `from django_file_organization import upload_filename` and set `upload_to=` as the value.
But before that set `STORAGE_UPLOAD_PATH =` in `settings.py`
A simple way of using the library will be shown below.

```python
settings.py

STORAGE_UPLOAD_PATH = "media/"
```

```python
models.py

from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields.files import ImageField

from django_file_organization import upload_filename


class Upload(models.Model):
    user = models.ForeignKey(
        User,
        on_delete=models.CASCADE,
        blank="True",
        null=True,
    )
    image = ImageField(
        upload_to=upload_filename,
    )

    class Meta:
        verbose_name = "Upload"

    def __str__(self):
        return f"{self.user}"
```
In this example, the folder name will contain the user's name.

Changelog
---------

### Version 0.1.0

* Initial release