New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

django-ocs-observation-portal

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-ocs-observation-portal

The Observatory Control System (OCS) Observation Portal django apps

  • 4.13.4
  • PyPI
  • Socket score

Maintainers
1

Observation Portal

Build Coverage Status Codacy Badge

An API for Astronomical Observation Management

Within an observatory control system, the observation portal provides modules for:

  • Proposal management: Calls for proposals, proposal creation, and time allocation
  • Request management: Observation request validation, submission, and cancellation, as well as views providing ancillary information about them
  • Observation management: Store and provide the telescope schedule, update observations, and update observation requests on observation update
  • User identity management: Oauth2 authenticated user management that can be used in other applications

Prerequisites

Optional prerequisites can be skipped for reduced functionality.

Environment Variables

VariableDescriptionDefault
GeneralDEBUGWhether the application should run using Django's debug modeFalse
SECRET_KEYThe secret key used for sessionsrandom characters
ALLOWED_HOSTSOverride for Django's ALLOWED_HOSTS setting*
CSRF_TRUSTED_ORIGINSComma separated list of trusted origins allowed for CSRFNone
MAX_FAILURES_PER_REQUESTMaximum number of times an Observation can fail per Request before the Request is marked as FAILURE_LIMIT_REACHED. 0 means there is no max.0
MAX_IPP_VALUEThe maximum value to be used for ipp scaling. Should be greater than 1 (1 would be no scaling)2.0
MIN_IPP_VALUEThe minimum value to be used for ipp scaling. Should be less than 1 but greater than 00.5
PROPOSAL_TIME_OVERUSE_ALLOWANCEThe amount of leeway in a proposals timeallocation before rejecting that request for scheduling. For example, a value of 1.1 results in allows over-scheduling by up to 10% of the total time_allocation. It is useful to allow some over-scheduling since it is likely some in progress observations will use less time then allocated, due to conservative overheads, failing, or cancelling.1.1
DatabaseDB_NAMEThe name of the databaseobservation_portal
DB_USERThe database userpostgres
DB_PASSWORDThe database passwordEmpty string
DB_HOSTThe database host127.0.0.1
DB_PORTThe database port5432
CacheCACHE_BACKENDThe remote Django cache backenddjango.core.cache.backends.locmem.LocMemCache
CACHE_LOCATIONThe cache location or connection stringunique-snowflake
LOCAL_CACHE_BACKENDThe local Django cache backend to usedjango.core.cache.backends.locmem.LocMemCache
Static and Media FilesAWS_BUCKET_NAMEThe name of the AWS bucket in which to store static and media filesobservation-portal-test-bucket
AWS_REGIONThe AWS regionus-west-2
AWS_ACCESS_KEY_IDThe AWS user access key with read/write priveleges on the s3 bucketNone
AWS_SECRET_ACCESS_KEYThe AWS user secret key to use with the access keyNone
MEDIA_STORAGEThe Django media files storage backenddjango.core.files.storage.FileSystemStorage
MEDIAFILES_DIRThe directory in which to store media filesmedia
STATIC_STORAGEThe Django static files storage backenddjango.contrib.staticfiles.storage.StaticFilesStorage
EmailEMAIL_BACKENDThe Django SMTP backend to usedjango.core.mail.backends.console.EmailBackend
EMAIL_HOSTThe SMTP hostlocalhost
EMAIL_HOST_USERThe SMTP userEmpty string
EMAIL_HOST_PASSWORDThe SMTP passwordEmpty string
EMAIL_PORTThe SMTP port587
ORGANIZATION_EMAILThe reply-to email for outgoing messagesEmpty string
ORGANIZATION_DDT_EMAILEmail to receive ddt science application submission messagesEmpty string
ORGANIZATION_ADMIN_EMAILThe Django Admin email to receive http 500 reports.Empty string
ORGANIZATION_SUPPORT_EMAILEmail to receive account removal requestsEmpty string
ORGANIZATION_NAMEThe name of your organization, used within email templatesEmpty string
OBSERVATORY_DIRECTOR_NAMEFull name of the observatory director, used within email templatesFoo Bar
OBSERVATION_PORTAL_BASE_URLThe base url of your deployed Observation Portal code, used within email templates to provide links to pageshttp://localhost
REQUESTGROUP_DATA_DOWNLOAD_URLThe url where a user can download requestgroup data. Optionally include {requestgroup_id} in the string which will be filled in with the ID of the specific requestgroup.Empty string
REQUEST_DETAIL_URLThe url to frontend detail page for a Request. Optionally include {request_id} in the string which will be filled in with the ID of the specific request.Empty string
SCIENCE_APPLICATION_DETAIL_URLThe url to frontend science application detail page. Optionally include {sciapp_id} in the string which will be filled in with the ID of the specific science application.Empty string
External ServicesCONFIGDB_URLThe url to the configuration databasehttp://localhost
DOWNTIMEDB_URLThe url to the downtime databasehttp://localhost
OPENSEARCH_URLThe url to the OpenSearch clusterhttp://localhost
AuthenticationOAUTH_SERVER_KEYThe secret key for client applications to verify against for authentication callsEmpty string
OAUTH_CLIENT_APPS_BASE_URLSComma delimited set of base urls for client applications. This server will update those clients on any change in user accounts or api tokens.Empty string
Task SchedulingDRAMATIQ_BROKER_URLThe url to the dramatiq broker (if set takes precedence over DRAMATIQ_BROKER_HOST & DRAMATIQ_BROKER_PORTredis://redis:6379/0
DRAMATIQ_BROKER_HOSTThe broker host for dramatiq (deprecated)redis
DRAMATIQ_BROKER_PORTThe broker port for dramatiq (deprecated)6379
Throttle OverridesREQUESTGROUPS_CANCEL_DEFAULT_THROTTLEDefault django rest framework throttle rate string for the RequestGroups cancel endpoint2000/day
REQUESTGROUPS_CREATE_DEFAULT_THROTTLEDefault django rest framework throttle rate string for the RequestGroups create endpoint5000/day
REQUESTGROUPS_VALIDATE_DEFAULT_THROTTLEDefault django rest framework throttle rate string for the RequestGroups validate endpoint20000/day
Realtime OverridesREAL_TIME_AVAILABILITY_DAYS_OUTFor the /api/realtime/availability/ endpoint - controls how many minutes after the current time a realtime session should be available as a lower bound60
REAL_TIME_AVAILABILITY_MINUTES_INFor the /api/realtime/availability/ endpoint - controls how many days after the current time a realtime session should be available as an upper bound7
Serializer OverridesOBSERVATIONS_SUMMARY_SERIALIZERClass dotpath for Observation's Summary serializer overrideobservation_portal.observations.serializers.SummarySerializer
OBSERVATIONS_CONFIGURATIONSTATUS_SERIALIZERClass dotpath for Observation's ConfigurationStatus serializer overrideobservation_portal.observations.serializers.ConfigurationStatusSerializer
OBSERVATIONS_TARGET_SERIALIZERClass dotpath for Observation's Target serializer overrideobservation_portal.observations.serializers.ObservationTargetSerializer
OBSERVATIONS_CONFIGURATION_SERIALIZERClass dotpath for Observation's Configuration serializer overrideobservation_portal.observations.serializers.ObservationConfigurationSerializer
OBSERVATIONS_REQUEST_SERIALIZERClass dotpath for Observation's Request serializer overrideobservation_portal.observations.serializers.ObserveRequestSerializer
OBSERVATIONS_REQUESTGROUP_SERIALIZERClass dotpath for Observation's RequestGroup serializer overrideobservation_portal.observations.serializers.ObserveRequestGroupSerializer
OBSERVATIONS_SCHEDULE_SERIALIZERClass dotpath for Observation's Schedule serializer overrideobservation_portal.observations.serializers.ScheduleSerializer
OBSERVATIONS_OBSERVATION_SERIALIZERClass dotpath for Observation's Observation serializer overrideobservation_portal.observations.serializers.ObservationSerializer
OBSERVATIONS_CANCEL_SERIALIZERClass dotpath for Observation's Cancel Observation serializer overrideobservation_portal.observations.serializers.CancelObservationsSerializer
REQUESTGROUPS_CADENCE_SERIALIZERClass dotpath for RequestGroups's Cadence serializer overrideobservation_portal.requestgroups.serializers.CadenceSerializer
REQUESTGROUPS_CADENCEREQUEST_SERIALIZERClass dotpath for RequestGroups's Cadence Request serializer overrideobservation_portal.requestgroups.serializers.CadenceRequestSerializer
REQUESTGROUPS_CONSTRAINTS_SERIALIZERClass dotpath for RequestGroups's Constraints serializer overrideobservation_portal.requestgroups.serializers.ConstraintsSerializer
REQUESTGROUPS_REGIONOFINTEREST_SERIALIZERClass dotpath for RequestGroups's Instrument Config ROI serializer overrideobservation_portal.requestgroups.serializers.RegionOfInterestSerializer
REQUESTGROUPS_INSTRUMENTCONFIG_SERIALIZERClass dotpath for RequestGroups's Instrument Config serializer overrideobservation_portal.requestgroups.serializers.InstrumentConfigSerializer
REQUESTGROUPS_ACQUISITIONCONFIG_SERIALIZERClass dotpath for RequestGroups's Acquisition Config serializer overrideobservation_portal.requestgroups.serializers.AcquisitionConfigSerializer
REQUESTGROUPS_GUIDINGCONFIG_SERIALIZERClass dotpath for RequestGroups's Guiding Config serializer overrideobservation_portal.requestgroups.serializers.GuidingConfigSerializer
REQUESTGROUPS_TARGET_SERIALIZERClass dotpath for RequestGroups's Target serializer overrideobservation_portal.requestgroups.serializers.TargetSerializer
REQUESTGROUPS_CONFIGURATION_SERIALIZERClass dotpath for RequestGroups's Configuration serializer overrideobservation_portal.requestgroups.serializers.ConfigurationSerializer
REQUESTGROUPS_LOCATION_SERIALIZERClass dotpath for RequestGroups's Location serializer overrideobservation_portal.requestgroups.serializers.LocationSerializer
REQUESTGROUPS_WINDOW_SERIALIZERClass dotpath for RequestGroups's Window serializer overrideobservation_portal.requestgroups.serializers.WindowSerializer
REQUESTGROUPS_REQUEST_SERIALIZERClass dotpath for RequestGroups's Request serializer overrideobservation_portal.requestgroups.serializers.RequestSerializer
REQUESTGROUPS_REQUESTGROUP_SERIALIZERClass dotpath for RequestGroups's RequestGroup serializer overrideobservation_portal.requestgroups.serializers.RequestGroupSerializer
REQUESTGROUPS_DRAFTREQUESTGROUP_SERIALIZERClass dotpath for RequestGroups's Draft RequestGroup serializer overrideobservation_portal.requestgroups.serializers.DraftRequestGroupSerializer
PROPOSALS_PROPOSAL_SERIALIZERClass dotpath for Proposal's Proposal serializer overrideobservation_portal.proposals.serializers.ProposalSerializer
PROPOSALS_PROPOSALINVITE_SERIALIZERClass dotpath for Proposal's ProposalInvite serializer overrideobservation_portal.proposals.serializers.ProposalInviteSerializer
PROPOSALS_SEMESTER_SERIALIZERClass dotpath for Proposal's Semester serializer overrideobservation_portal.proposals.serializers.SemesterSerialzer
PROPOSALS_MEMBERSHIP_SERIALIZERClass dotpath for Proposal's Membership serializer overrideobservation_portal.proposals.serializers.MembershipSerializer
PROPOSALS_PROPOSALNOTIFICATION_SERIALIZERClass dotpath for Proposal's ProposalNotification serializer overrideobservation_portal.proposals.serializers.ProposalNotificationSerializer
PROPOSALS_TIMELIMIT_SERIALIZERClass dotpath for Proposal's Proposal serializer overrideobservation_portal.proposals.serializers.TimeLimitSerializer
ACCOUNTS_PROFILE_SERIALIZERClass dotpath for Accounts's Profile serializer overrideobservation_portal.accounts.serializers.ProfileSerializer
ACCOUNTS_USER_SERIALIZERClass dotpath for Accounts's User serializer overrideobservation_portal.accounts.serializers.UserSerializer
ACCOUNTS_ACCOUNTREMOVAL_SERIALIZERClass dotpath for Accounts's Account Removal serializer overrideobservation_portal.accounts.serializers.AccountRemovalSerializer
SCIAPPLICATIONS_CALL_SERIALIZERClass dotpath for SciApplications's Call serializer overrideobservation_portal.sciapplications.serializers.CallSerializer
SCIAPPLICATIONS_SCIENCEAPPLICATION_SERIALIZERClass dotpath for SciApplications's Science Application serializer overrideobservation_portal.sciapplications.serializers.ScienceApplicationSerializer
as_dict OverridesOBSERVATIONS_SUMMARY_AS_DICTClass dotpath for Observation's Summary as_dict overrideobservation_portal.observations.models.summary_as_dict
OBSERVATIONS_CONFIGURATIONSTATUS_AS_DICTClass dotpath for Observation's ConfigurationStatus as_dict overrideobservation_portal.observations.models.configurationstatus_as_dict
OBSERVATIONS_OBSERVATION_AS_DICTClass dotpath for Observation's Observation as_dict overrideobservation_portal.observations.models.observation_as_dict
REQUESTGROUPS_CONSTRAINTS_AS_DICTClass dotpath for RequestGroups's Constraints as_dict overrideobservation_portal.requestgroups.models.constraints_as_dict
REQUESTGROUPS_REGIONOFINTEREST_AS_DICTClass dotpath for RequestGroups's Instrument Config ROI as_dict overrideobservation_portal.requestgroups.models.regionofinterest_as_dict
REQUESTGROUPS_INSTRUMENTCONFIG_AS_DICTClass dotpath for RequestGroups's Instrument Config as_dict overrideobservation_portal.requestgroups.models.instrumentconfig_as_dict
REQUESTGROUPS_ACQUISITIONCONFIG_AS_DICTClass dotpath for RequestGroups's Acquisition Config as_dict overrideobservation_portal.requestgroups.models.acquisitionconfig_as_dict
REQUESTGROUPS_GUIDINGCONFIG_AS_DICTClass dotpath for RequestGroups's Guiding Config as_dict overrideobservation_portal.requestgroups.models.guidingconfig_as_dict
REQUESTGROUPS_TARGET_AS_DICTClass dotpath for RequestGroups's Target as_dict overrideobservation_portal.requestgroups.models.target_as_dict
REQUESTGROUPS_CONFIGURATION_AS_DICTClass dotpath for RequestGroups's Configuration as_dict overrideobservation_portal.requestgroups.models.configuration_as_dict
REQUESTGROUPS_LOCATION_AS_DICTClass dotpath for RequestGroups's Location as_dict overrideobservation_portal.requestgroups.models.location_as_dict
REQUESTGROUPS_WINDOW_AS_DICTClass dotpath for RequestGroups's Window as_dict overrideobservation_portal.requestgroups.models.window_as_dict
REQUESTGROUPS_REQUEST_AS_DICTClass dotpath for RequestGroups's Request as_dict overrideobservation_portal.requestgroups.models.request_as_dict
REQUESTGROUPS_REQUESTGROUP_AS_DICTClass dotpath for RequestGroups's RequestGroup as_dict overrideobservation_portal.requestgroups.models.requestgroup_as_dict
PROPOSALS_PROPOSAL_AS_DICTClass dotpath for Proposal's Proposal as_dict overrideobservation_portal.proposals.models.proposal_as_dict
PROPOSALS_TIMEALLOCATION_AS_DICTClass dotpath for Proposal's TimeAllocation as_dict overrideobservation_portal.proposals.models.timeallocation_as_dict
PROPOSALS_MEMBERSHIP_AS_DICTClass dotpath for Proposal's Membership as_dict overrideobservation_portal.proposals.models.membership_as_dict
duration OverridesINSTRUMENT_CONFIGURATION_PER_EXPOSURE_DURATIONClass dotpath for duration_per_exposure method overrideobservation_portal.requestgroups.duration_utils.get_instrument_configuration_duration_per_exposure

Local Development

Set up external services

Please refer to the Configuration Database and Downtime Database projects for instructions on how to get those running, as well as the Elasticsearch documentation for options on how to run Elasticsearch.

Poetry

We use Poetry for package management. If you already have Poetry installed, you can skip this section.

You can install Poetry using one of the many options listed at https://python-poetry.org/docs/#installation. One simple option is using Pipx:

python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry

Install

Install the project and its Python dependencies:

poetry install

This will install the project in a Poetry managed virtual environment. To run commands in that environment either use poetry run ... or start a shell in that environment with poetry shell

Set up the database

This example uses the PostgreSQL Docker image to create a database. Make sure that the options that you use to set up your database correspond with your configured database settings.

docker run --name observation-portal-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=observation_portal -v/var/lib/postgresql/data -p5432:5432 -d postgres:11.1

After creating the database, migrations must be applied to set up the tables in the database.

poetry run python manage.py migrate

Run the tests

poetry run python manage.py test --settings=observation_portal.test_settings

Run the portal

poetry run python manage.py runserver

The observation portal should now be accessible from http://127.0.0.1:8000!

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc