Pan-STARRS and ATLAS web interface.
Project description
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 atlocalhost:3036atlas-web- A mod-wsgi instance to serve the django front end. By default served atlocalhost:8086and requiresdbto be running.adminer- A web interface for interacting with the db. By default served atlocalhost:8080and requiresdbto be running.tests- A single-use run of the unit tests using django'smanage.py test. Requiresdbto 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:
- Get a dummy database dump .sql file from one of the developers and place it into
data/init.sql - [Optional] Get an image dump and place it into
data/db_data/ - 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file psat_server_web-0.8.2.tar.gz.
File metadata
- Download URL: psat_server_web-0.8.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7063af56f16ae4289e773c673ea7bde5dbbe23f3b43b2b37e07180acd0e8a4a
|
|
| MD5 |
53f1b04d3d29795d35741dfd908158a1
|
|
| BLAKE2b-256 |
ad43028f231a5e922bd962f3bd4b06e7af6789881be421f36fcc29bf10de47bf
|