https://github.com/cedadev/mip-dr-app
Web application and tools for the MIP Data Request
https://github.com/cedadev/mip-dr-app
Last synced: 11 months ago
JSON representation
Web application and tools for the MIP Data Request
- Host: GitHub
- URL: https://github.com/cedadev/mip-dr-app
- Owner: cedadev
- License: bsd-2-clause
- Created: 2022-09-29T15:14:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-08T13:14:50.000Z (over 1 year ago)
- Last Synced: 2025-06-09T13:04:57.550Z (about 1 year ago)
- Language: Python
- Size: 3.49 MB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mip-dr-app
Prototype django MIP Data Request app and tools
## Setting up the app
Clone the repo:
```
git clone https://github.com/cedadev/mip-dr-app
cd mip-dr-app/
```
Install the requirements:
```
pip install -r requirements.txt
```
Set environment variable(s):
```
export PYTHONPATH=$PWD/.
export DJANGO_SETTINGS_MODULE=mip_dr_app.settings
```
## Populating the contents from the Data Request XML
```
cd scripts/
django-admin makemigrations mip_dr_app_api
django-admin migrate
python generate_import_data_script.py
python import_data.py
```
## Create an Admin User Account
```
python manage.py createsuperuser
```
Then follow the on screen prompts and enter the required details
## Running the server
```
django-admin runserver localhost:8888
# Or: 0.0.0.0:8888 (if running on a private network on a vagrant VM)
```
View at: http://localhost:8888
E.g.:
```
$ curl http://localhost:8888
```
## Importing Data
It is possible to update the data by importing a file:
- Go to the admin page, e.g. `http://localhost:8888/admin/` and login with your admin credentials
- Select the required table to upload data to
- Press the `IMPORT` button near the top right of the page
- Choose a file to import and press the `SUBMIT` button
- Check the data in the preview panel is correct
- Press the `CONFIRM IMPORT` button
The file to be uploaded must be in one of the following formats:
- csv
- xls
- xlsx
- tsv
- json
- ymal