SmartGallery is a versatile image gallery project developed using the Django framework (Python). This project empowers you to:
- Create and manage albums
- Upload images and associate them with YouTube video links
- Modify albums and images (reorder, sort, adjust columns)
- Configure album visibility settings
- Choose between grid or masonry gallery views
- Process uploaded images (generate thumbnails and full-size images for lightbox galleries) by adjusting resolution and quality
- Customize the menu (reorder and rename items)
- Incorporate social media links with Font Awesome icons, allowing you to edit their order, labels, and icons
- Extract EXIF data from images and display it in the lightbox view
- Access GEO information and coordinates, viewable on Google Maps
- Edit site settings, including logo upload, meta data configuration, and font styling for captions and footer text
- Edit EXIF data directly
- Explore a timeline view (masonry layout) presenting all site images, organized and titled by the year they were taken
- Translate the admin section of the site; currently supports English and Russian languages, with the option to change this in the General Settings of the Site Settings section
- Benefit from a template editor equipped with syntax highlighting (HTML, CSS, JS) for the Main (index) and About Me pages, powered by CodeMirror
- Leverage Django's built-in and custom tags with filters within the Template Editor
To utilize Django, the project requires a SECRET_KEY for security. The following methods are employed to obtain this key:
- Retrieve it from the operating system's environment variables using the key: SECRET_KEY
- Obtain it from a
.env
file located near thesettings.py
file, using the formatsecret_prod = 'Your key'
- Fall back to the default value specified in
settings.py
To generate a secret key, you can use tools like djecrety.ir or miniwebtool.com.
You can initiate the use of this project through either docker-compose
or manual setup involving systemd
, Gunicorn, NGINX, and Certbot. For manual setup, follow these steps:
-
Clone the repository:
git clone https://github.com/endlessnights/photogallery.git
-
Navigate to the
photogallery
directory and create a virtual environment:python3 -m venv venv
-
Activate the virtual environment:
source venv/bin/activate
-
Update pip and install requirements:
pip install --upgrade pip
,pip install -r core/requirements.txt
-
Generate an SQLite database with tables:
python manage.py makemigrations smartgallery
, followed bypython manage.py migrate
-
If you're starting with Docker or manual setup, Django will automatically create a demo user. Remember to change the default username, password, and email:
- Login: root
- Password: RootPassword
-
NGINX Configuration:
Example of NGINX configuration
server {
server_name endlessnights.ru;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /var/www/smartgallery/core; # Path to the static directory
}
location /media/ {
root /var/www/smartgallery/core; # Path to the media directory
}
location / {
include proxy_params;
proxy_pass http://unix:/run/smartgallery.sock;
}
client_max_body_size 300M;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
}
Support the developer on Patreon.