Metadata-Version: 2.4
Name: djangocms-cznic-auctions
Version: 1.2.0
Summary: DjangoCMS CZ.NIC Auctions
Author-email: Zdeněk Böhm <zdenek.bohm@nic.cz>
License: BSD License
Project-URL: Homepage, https://gitlab.nic.cz/djangocms-apps/djangocms-cznic-auctions
Project-URL: Repository, https://gitlab.nic.cz/djangocms-apps/djangocms-cznic-auctions.git
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: Django CMS
Classifier: Framework :: Django CMS :: 3.4
Classifier: Framework :: Django CMS :: 4.1
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: django-cms
Requires-Dist: django-constance
Requires-Dist: requests
Provides-Extra: test
Requires-Dist: freezegun; extra == "test"
Requires-Dist: responses; extra == "test"
Requires-Dist: django-stubs[compatible-mypy]; extra == "test"
Requires-Dist: types-requests; extra == "test"

# DjangoCMS CZ.NIC Auctions

A group of [Django CMS](https://www.django-cms.org/) plugins for displaying a table with a list of domains in an auction.
The data source is set in the website administration in the [Constance config](https://django-constance.readthedocs.io/en/latest/) section.
The default value is https://auctions-master.nic.cz/v1/public/auctions/.

### Install

`pip install djangocms-cznic-auctions`


Add into settings.py:

```python
INSTALLED_APPS = [
    "constance",
    "cznic_auctions",
    ...
]

AUCTIONS_CONFIG = (
    ("AUCTIONS_LIST_URL", ("https://auctions-master.nic.cz/v1/public/auctions/", "Auctions list URL.", str)),
    ("AUCTIONS_NOT_VERIFY_CERTIFICATE", (False, "Do not verify certificate.", bool)),
)

CONSTANCE_CONFIG = OrderedDict(
    AUCTIONS_CONFIG,
)
CONSTANCE_CONFIG_FIELDSETS = {
    "CZ.NIC Auctions": dict(AUCTIONS_CONFIG).keys(),
}
```

Add into urls.py:

```python
urlpatterns = i18n_patterns(
    ...
    path("auctions/", include(("cznic_auctions.urls", "auctions"), namespace="auctions")),
)
```

### Custom templates

You can define your own template for the domain list.

Add into settings.py:

```python
from cznic_auctions.constants import LIST_TEMPLATES

CZNIC_AUCTIONS_TEMPLATES = LIST_TEMPLATES + [
    ("my-awesome-template/list.html", "My awesome template"),
]
```

## Site example

Along with the program, an example is stored in the repository that you can run in the docker.

Download the example:

```
curl https://gitlab.nic.cz/djangocms-apps/djangocms-cznic-auctions/-/archive/main/djangocms-cznic-auctions-main.zip?path=example --output example.zip
```

Extract the archive and go to the folder:

```
unzip example.zip
cd djangocms-cznic-auctions-main-example/example/
```

Build the image:

```
docker build -t auctions .
```

Run the site:

```
docker run --rm -d -p 8000:8000 --name auctions_example auctions
```

Open the site in your browser: http://localhost:8000/. You'll see what's in the screenshots.

Login to the administration: http://localhost:8000/admin with username `admin` and password `admin`.

Stop the site:

```
docker stop auctions_example
```

![Auctions example](https://gitlab.nic.cz/djangocms-apps/djangocms-cznic-auctions/-/raw/main/screenshots/cznic-auctions.png "Auctions example")

### License

BSD License
