semvec/pypi-packages huggingface dataset:
django-dynamic-image 1.4.0
A django ImageField whose upload_to value is generated from a model method
License: BSD 2-Clause License
Keywords: django,imagefield

# Django Dynamic Image

## Description

A django ImageField whose upload_to value is generated from a model method.

## Installation

```python
pip install django-dynamic-image
```

## Usage

```python
from django.db import models
from dynamic_image.fields import DynamicImageField

class ExampleModel(models.Model):
    name = models.CharField(max_length=56)
    image = DynamicImageField()

    def get_upload_to(self, field_name):
        class_name = self.__class__.__name__.lower()
        instance_name = self.name
        return "{}/{}".format(class_name, instance_name)
```
django-restricted-paths 1.4.0
Restricts access to specific urls to staff only by responding with a specific view or raising a 404
License: BSD 2-Clause License
Keywords: django,urls

# Django Restricted Paths

## Description

Restricts access to specific urls to staff only by responding with a specific view or raising a 404.

## Installation

```python
pip install django-restricted-paths
```

## Usage

in settings.py:

```python
RESTRICTED_PATHS = {
  "ENABLED": not DEBUG,
  "PATHS": ("/admin",),
  "VIEW": "path.to.view.class.ViewClass",
}

MIDDLEWARE = (
    ...
    "restricted_paths.middleware.RestrictedPathsMiddleware"
)
```