You can install with pip from PyPi via:
pip install django-galleryfield
Or for the latest dev version, via:
pip install git+https://github.com/dzhuang/django-galleryfield.git
Gallery-widget is compatible with Python 3 (3.6 or later were tested).
Bootstrap 3.4.1 (included)
jQuery 3.6 (included)
jQuery UI (included)
cropper by Chen Fengyuan (included)
The static dependencies were already included in the package.
settings.py, add 3 lines in you
INSTALLED_APPS = ( ..., 'sorl.thumbnail', 'galleryfield', ..., ) DJANGO_GALLERY_CONFIG = ...
urls.py, add the following lines:
from django.urls import include, path urlpatterns += [path(r"images-handler/", include("galleryfield.urls"))] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Sync the database:
python manage.py migrate galleryfield
Run the demo
The best way to have a glance of how django-galleryfield works is to run the demo:
git clone https://github.com/dzhuang/django-galleryfield.git cd django-galleryfield cd demo pip install -r requirements.txt cd .. python manage.py migrate python manage.py createsuperuser # Create a superuser account so that you can upload images python manage.py runserver
You might need to install JSON1 extension for SQLite for this the demo to run properly. See Enabling JSON1 extension on SQLite.