Architecture of "self-replicating webpage" web site

Hi All,

I’m trying to build the following basic web site logic:

Main Page:
A giant “+” button. The button will allow users to select the location of a standard dataset. Once clicked, a entirely new webpage will be created with the dataset visualized. The main page will have a new permanent button that will lead to the visualized data once clicked. There is also a permanently new web page which is the dataset visualization.

I understand that this is super straight forward using the admin interface, however, I was wondering if anyone could help me understand how to do this without using the admin interface.

Specifically, how would I be able to save a entirely new html pages, update the database containing the details of the new datasets all without resetting the webpage or using the admin interface? In other words, how would I go about publishing new content without the user having to login to the admin interface?

Thanks so much in advance for those who are able to help!


I’m a bit confused here by what you’re trying to describe.

Are you trying to replicate the functionality of a different framework or platform? (If so, which one?)

When you’re referring to a “dataset”, are you using the term in the common “data science” sense? (If not, then what?)

When you say “select the location”, are you talking about a file being uploaded, or the URL of a resource? (If it’s a URL, are you pulling a file from there, or are you just accessing data from it?)

What is creating the visualization of the dataset?

In short, the general way that Django works is that you have data stored in a model. That “data” doesn’t necessarily need to be the data being displayed. (It can be, but that’s not a requirement) You then have a view that pulls data together and renders it (using a template) to form an HTML page displayed in the browser. (There are, of course, an effectively unlimited number of variations on this basic theme.)

In the common case, every model used as the basis for a view is identified by a key (usually the primary key of a model). The view then takes that key as a parameter in the url to select which model to retrieve in the view.

Publishing new content then usually consists of adding a row in the table. Django can take care of the rest.

Hey Ken,

Thanks for the response. I can close off this question now. I did abit more googling/youtubing on my exact requirements and it turns out that it’s actually super straight forward (as you pointed out for the common case).

Essentially I just needed to update the database not with the actual data but just the location of the data in a unix system and then do a POST request for the django backend to do its thing (Forms was the thing that I was looking for here). As for creating an entirely new html page based on the location of the data that the user puts in, I’m going to use DetailsView class. There’s some details I’ll still need to figure out via experimenting but I think I get the general idea now.

Anyhow, Thanks again for replying. I feel abit silly now asking the question now but I’m glad to find out that django was quite literally made to handle those logic flows.

1 Like