Skip to main content

psat-server-web

Python 3 web interface for the Pan-STARRS and ATLAS surveys.

To install:

pip install psat-server-web

Once installed, don't forget to add the "data" symlinks in the:

site-packages/psat_server_web/atlas/media/images site-packages/psat_server_web/ps1/media/images

directories which point to the location of the image stamps.


Local development version

A localised development instance can be run with docker compose. You will need a .env file in your repository root to define some environment variables, looking something like:

# Django settings
SECRET_KEY={YOUR_SECRET_KEY_HERE}
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]

# MySQL/MariaDB settings
MYSQL_ROOT_USER=root
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=atlas
MYSQL_USER=atlas
MYSQL_PASSWORD=atlas
MYSQL_PORT=3306
MYSQL_TEST_DATABASE=atlas_test
MYSQL_TEST_PORT=3306
MYSQL_TEST_USER=root
MYSQL_TEST_PASSWORD=root

DJANGO_MYSQL_DBUSER=atlas
DJANGO_LASAIR_TOKEN=

Several of the values are omitted but aren't necessary to run a development environment. Also ruch simple passwords should not be used in production, but this should get you something running locally. Hopefully it's then as simple as running the following:

docker compose up

Which will start 4 services, comprised of:

  • db - A MariaDB instance. By default served at localhost:3036
  • atlas-web - A mod-wsgi instance to serve the django front end. By default served at localhost:8086 and requires db to be running.
  • adminer - A web interface for interacting with the db. By default served at localhost:8080 and requires db to be running.
  • tests - A single-use run of the unit tests using django's manage.py test. Requires db to be running.

Each of these services can be run independently with

docker compose up {service_name}

So if, for example, you wanted to run the tests you could execute docker compose up tests and it would – after starting db if it is not already running – perform a single run of the unit tests.

A dummy database

There are a few things you will likely need to do to get a fully working version of the web-server so as to make your local version useful, namely:

  1. Get a dummy database dump .sql file from one of the developers and place it into data/init.sql
  2. [Optional] Get an image dump and place it into data/db_data/
  3. Fix a mild issue with the database model (see next section)

If you are having problems with any of this, contact one of the developers.

Issue with TcsGravityEventAnnotations.map_iteration

If you are getting an error along the lines of

atlas-web-1  | ERRORS:
atlas-web-1  | atlas.TcsGravityEventAnnotations.map_iteration: (fields.E311) 'TcsGravityAlerts.map_iteration' must be unique because it is referenced by a foreign key.
atlas-web-1  | 	HINT: Add unique=True to this field or add a UniqueConstraint (without condition) in the model Meta.constraints.

Then you may need to make an adjustment to the models, specifically by uncommenting the line declaring TcsGravityAlerts.map_iteration which adds a unique kwarg, and commenting the line without the unique kwarg, should solve the problem. Specifically, the lines should look like

# map_iteration = models.CharField(max_length=100, blank=True, null=True)
map_iteration = models.CharField(max_length=100, blank=True, null=True, unique=True)

This is within the TcsGravityAlerts(models.Model) class. Again, please speak to one of the developers if this is unclear.

Download files

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

Source Distribution

psat_server_web-0.9.2.tar.gz (12.1 MB view details)

Uploaded Source

File details

Details for the file psat_server_web-0.9.2.tar.gz.

File metadata

  • Download URL: psat_server_web-0.9.2.tar.gz
  • Upload date:
  • Size: 12.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for psat_server_web-0.9.2.tar.gz
Algorithm Hash digest
SHA256 751fa893d2c6ea9ee4240cf7261c435367335ec180f04e30e6b830c2f1b283bc
MD5 276204cf2b8a8e649e68f01d5c31e7e3
BLAKE2b-256 d4fbe5a18366b77e9f13dd637579f81bc292afdb3738115dca6ffb03925e6e13

See more details on using hashes here.

Release history Release notifications | RSS feed

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