项目作者: kkosiba

项目描述 :
Responsive gallery
高级语言: Python
项目地址: git://github.com/kkosiba/django-gallery.git
创建时间: 2018-08-07T16:58:50Z
项目社区:https://github.com/kkosiba/django-gallery

开源协议:

下载


gallery-django

Responsive Bootstrap gallery with the Django backend

blog

For more pictures, see pics directory.

Features

  1. Authorisation.
  2. Facebook comments
  3. Tags
  4. Search, sort pictures by album or tags.

Main requirements

  1. python 3.5, 3.6, 3.7
  2. Django 2.1.8
  3. PostreSQL 11.1

This project also uses a few external packages (see requirements.txt for details). Processing images is done via Pillow and tags via django-taggit.

How to set up

Setup using Docker

The easiest way to get this project up and running is via Docker. See docs to get started. Once set up run the following command:

docker-compose up

It may take a while for the process to complete, as Docker needs to pull required dependencies. Once it is done, the application should be accessible at 0.0.0.0:8000.

Manual setup

Firstly, create a new directory and change to it:

mkdir gallery-django && cd gallery-django

Then, clone this repository to the current directory:

git clone https://github.com/kkosiba/gallery-django.git .

For the backend to work, one needs to setup database like SQLite or PostgreSQL on a local machine. This project uses PostgreSQL by default (see Django documentation for different setup). This process may vary from one OS to another, eg. on Arch Linux one can follow a straightforward guide here.

The database settings are specified in website/settings/local.py. In particular the default database name is GalleryDjango, which can be created from the PostgreSQL shell by running createdb GalleryDjango.

Next, set up a virtual environment and activate it:

python3 -m venv env && source env/bin/activate

Install required packages:

pip3 install -r requirements.txt

Next, perform migration:

python3 manage.py migrate --settings=website.settings.local

The setup is complete. Run a local server with

python3 manage.py runserver --settings=website.settings.local

The gallery should be available at localhost:8000.

Credits

Sample data for the gallery by courtesy of Unsplash