Skip to main content

A Flask-based astrophotography web application

Project description

AstroSpace

AstroSpace is a Flask application for hosting and organizing astrophotography posts on your own infrastructure. It combines image publishing, equipment tracking, plate-solving overlays, and guiding-log visualization in one self-hosted site.

You can see a public instance here: astro.space-js.de

Features

  • User registration with a configurable user limit
  • Rich post creation for astrophotography images and acquisition details
  • Equipment inventory management for telescopes, cameras, filters, and accessories
  • FITS/XISF-assisted plate solving and generated overlays
  • PHD2 guiding log parsing and Plotly-based visualizations
  • Public collection pages and per-image detail views
  • Docker-friendly deployment
  • Optional opt-in debug logging for local development and container runs

Requirements

  • Python 3.11+
  • PostgreSQL
  • Optional: Node.js if you want to rebuild Tailwind CSS assets
  • Optional: Docker for containerized deployment

Quick Start

Local install

python -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -e .[dev]

Configuration

AstroSpace reads configuration from:

  1. environment variables
  2. the file pointed to by ASTROSPACE_SETTINGS
  3. instance/config.py

Required settings:

  • SECRET_KEY
  • DB_NAME
  • DB_USER
  • DB_PASSWORD
  • DB_HOST
  • DB_PORT
  • UPLOAD_PATH

Common optional settings:

  • TITLE
  • MAX_USERS
  • SESSION_COOKIE_SECURE

Example config file:

SECRET_KEY = "change-me"
DB_NAME = "astrospace"
DB_USER = "astrospace"
DB_PASSWORD = "change-me"
DB_HOST = "localhost"
DB_PORT = 5432
UPLOAD_PATH = r"C:\astrospace\uploads"
TITLE = "My AstroSpace"
MAX_USERS = 2

Run locally

set ASTROSPACE_SETTINGS=path\to\config.py
flask --app AstroSpace run

The app starts on http://127.0.0.1:5000 by default.

Debug Logging

AstroSpace includes opt-in runtime logging around the places most likely to block or fail: app startup, database bootstrapping, post creation, inventory updates, plate solving, and guide-log parsing.

Enable it in either of these ways:

flask --app AstroSpace run --debug
set ASTROSPACE_DEBUG=1
flask --app AstroSpace run

For the Docker image, append --debug to the container command or set ASTROSPACE_DEBUG=1.

Docker

Build the image locally:

docker build -t astrospace .

Run it:

docker run ^
  --name astrospace ^
  -p 9000:9000 ^
  -e SECRET_KEY=change-me ^
  -e DB_NAME=astrospace ^
  -e DB_USER=astrospace ^
  -e DB_PASSWORD=change-me ^
  -e DB_HOST=host.docker.internal ^
  -e DB_PORT=5432 ^
  -e TITLE=AstroSpace ^
  -e MAX_USERS=2 ^
  -e UPLOAD_PATH=/uploads ^
  -v C:\astrospace\uploads:/uploads ^
  astrospace

Run the same container in debug mode:

docker run ^
  --name astrospace-debug ^
  -p 9000:9000 ^
  -e SECRET_KEY=change-me ^
  -e DB_NAME=astrospace ^
  -e DB_USER=astrospace ^
  -e DB_PASSWORD=change-me ^
  -e DB_HOST=host.docker.internal ^
  -e DB_PORT=5432 ^
  -e TITLE=AstroSpace ^
  -e MAX_USERS=2 ^
  -e UPLOAD_PATH=/uploads ^
  -e ASTROSPACE_DEBUG=1 ^
  -v C:\astrospace\uploads:/uploads ^
  astrospace --debug

The image starts Gunicorn on 0.0.0.0:9000.

Development

Run the test suite:

python -m pytest -q

If you update Tailwind sources:

cd AstroSpace
npm install
npx tailwindcss -i ./static/input.css -o ./static/styles.css

Useful first-run steps:

  1. Register the first user. The first account becomes admin.
  2. Open My Profile and configure the site title and welcome message.
  3. Create a new post with a preview image and optional FITS/XISF metadata.
  4. Add or normalize inventory entries from the profile page if needed.

Release Workflow

Build and publish a wheel with Hatch:

python -m pip install hatch
python -m hatch build -t wheel
python -m hatch publish

Project Layout

  • AstroSpace/: application package
  • docs/: project documentation
  • tests/: automated tests
  • nginx/: example reverse-proxy and compose assets

License

This project is licensed under the GNU GPL-3.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astrospace-1.2.7-py3-none-any.whl (6.2 MB view details)

Uploaded Python 3

File details

Details for the file astrospace-1.2.7-py3-none-any.whl.

File metadata

  • Download URL: astrospace-1.2.7-py3-none-any.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for astrospace-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 373cd2718f891e54db64740e983603fba973672f3863fcc68838ff96a9cf9e28
MD5 8056cf8926de27beb159789f40fd43f7
BLAKE2b-256 5229040fb470dc6b1ece6259c8965c4fd3adcc3bcb77ca21e0bbbd6e01463842

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page