2

I have been asked to provide a web interface to access some scientific data which is being saved in a laboratory. The data are stored in folders, each containing some number of FITS files, and the application collecting the data is already written and functional.

The web interface I am supposed to implement should have the following features:

  1. View all the data taken so far;
  2. Allow the user to make queries;
  3. File downloading;
  4. Only read-only operations are allowed.

I know Django quite well and would like to use it. However, this kind of application is quite different from what I am used to. Usually a Django application implements models which are linked to a database, and this database is completely managed by Django itself. In this case, the database would be the plain tree of folders, which is being modified by an external application while Django is running.

Can Django be adapted to this task, or should I turn to other more low-level solutions? (e.g., microframeworks like Flask)

1 Answer 1

2

You have two options:

1) Write a Django backend that supports querying your custom data storage using the standard ORM syntax

2) Get the data relevant for a view by some other means, i.e. custom code to fetch the relevant data and deserialize it into meaningful Python objects.

I would probably go with 2) here. When creating Django views and rendering templates, you don't have to use the ORM to retrieve the data necessary for your view. You can use Django just fine without ever touching the ORM. Just note that Django doesn't work well without having a database at all, so you'll have to have a dummy database somewhere.

Sign up to request clarification or add additional context in comments.

2 Comments

Jeez, I would go with option 2, not 1. Edited my answer
Ah, ok, I see. I will try to go your route, the tip about creating a dummy database sounds good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.