Please offer guidance in setting up a Wagtail site from an existing, fairly large database.
At its core, the site will be very conventional, consisting of two basic page types: an 'index' page type that lists multiple items in the database, and a 'details' page type that displays information about an individual item.
Let's say that I'm working from a database of living things. In this scenario, each record in the main database table corresponds to a particular species.
In the planned Wagtail site, a given index page would present a list of species (likely filtered by categories such as 'plant,' 'extinct,' or 'imaginary'). The user would be able to click on any listed species to display the detail page for that species, which would give a full description and a photo of the insect, fern, or dinosaur. The detail page would also show other information such as the species' full taxonomic classification, its geographic range, and so on.
My existing database is incomplete but already contains hundreds of thousands of 'species,' so I need to import that data into Wagtail (creating a Wagtail page from scratch for each existing database record would not be at all practical, of course).
What would be the best way to import the database and access the data in Wagtail? I could:
instantiate programmatically (per the technique given here) a Wagtail page for each species in the current database, so that each species has its own 'permanent' page;
— or —
import the data into the site's Wagtail database, independent of the page structure. I would then have to create snippet models to access the data, and add code to render a page dynamically for any chosen species, based on data provided by an appropriate query run on those snippets.
I'm a complete novice at all of this, but method 1 may have two advantages: the predefined pages created during the import will already have slugs that I can easily convert to clickable links on the index pages; and the predefined pages will be discoverable by search engines.
Method 2 seems cleaner to me—keeping the core, "data data" separate from the "page data" (such as the title and slug) is logical and would simplify import/export procedures. But am I correct that it would reduce visibility of the individual pages to search engines? Aside from the programming required to render the pages dynamically, would it have other advantages or disadvantages compared to method 1?
(Regarding method 2: In Wagtail, how can pages be rendered dynamically from snippet-based query results? I know about RoutablePageMixin, but the examples I've found use it to access already-defined Wagtail pages. I would instead want to put data from snippet queries into a template, with a slug created during the page rendering process. A recipe or example would be appreciated.)