Skip to content

Tatsh/minchoc

Repository files navigation

minchoc

QA Tests Coverage Status Documentation Status PyPI - Version GitHub tag (with filter) GitHub GitHub commits since latest release (by SemVer including pre-releases)

Minimal Chocolatey-compatible NuGet server in a Django app.

Installation

pip install minchoc

In settings.py, add 'minchoc' to INSTALLED_APPS. Set ALLOW_PACKAGE_DELETION to True if you want to enable this API.

INSTALLED_APPS = ['minchoc']
ALLOW_PACKAGE_DELETION = True

A DELETE call to /api/v2/package/<id>/<version> will be denied even with authentication unless ALLOW_PACKAGE_DELETION is set to True.

Add path('', include('minchoc.urls')) to your root urls.py. Example:

from django.urls import include, path
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('minchoc.urls')),
]

Run ./manage.py migrate or similar to install the database schema.

Notes

When a user is created, a NugetUser is also made. This will contain the API key for pushing. It can be viewed in admin.

Add your source to Chocolatey

As administrator:

choco source add -s 'https://your-host/url-prefix'
choco apikey add -s 'https://your-host/url-prefix' -k 'your-key'

On non-Windows platforms, you can use my pychoco package, which also supports the above commands.

Supported commands

  • choco install
  • choco push
  • choco search