A comprehensive Django web application that provides detailed information about native wine grapes from around the world. The site displays grape profiles, country statistics, family relationships, and photos sourced from the Vitis International Variety Catalogue (VIVC).
This website serves as a searchable database of native wine grapes, featuring:
- Grape Profiles: Detailed information about individual grape varieties including species, berry color, breeding information, and family relationships
- Country Profiles: Statistics and listings of native grapes by country of origin
- Family Trees: Visual representation of parent-child relationships between grape varieties
- Photo Gallery: Grape cluster photos from field and laboratory settings
- Search Functionality: Autocomplete search to quickly find grapes by name
All grape data is sourced from the Vitis International Variety Catalogue (VIVC) at www.vivc.de, a comprehensive database maintained by the Julius Kühn-Institut (JKI) in Germany. The data includes:
- Grape names and VIVC identification numbers
- Berry colors (Red, Black, Pink, White, Unknown)
- Species information (e.g., Vitis Vinifera)
- Country of origin
- Breeding information (year of crossing, breeder name)
- Parent-child relationships (ancestry and descendants)
- Grape cluster photos with attribution
The data is scraped and imported into a SQLite database using Django management commands, which can be updated periodically to reflect new information from VIVC.
Each grape has a detailed profile page showing:
-
Basic Information:
- Grape name
- Berry color
- Country of origin (with link to country page)
- Species (if available)
- Year of crossing (if available)
- Breeder name (if available)
- Link to VIVC page
-
Visual Content:
- Grape cluster photo (prioritizes "cluster in the field" over "cluster in the laboratory")
- Photo credit information
- Responsive photo positioning that adapts to screen size
-
Family Relationships:
- Parents: Direct ancestor grapes (both parents if known)
- Children: Direct descendant grapes in a table format showing:
- Child grape name
- Other parent (the grape crossed with the current grape)
- Country of origin is shown for parents/children only when different from the current grape's country
Country pages display:
- Country name (properly capitalized)
- Total number of native grapes
- Grapes by Color: A table showing the count of grapes for each berry color:
- Colors sorted by count (descending)
- "Unknown" always appears last
- Complete list of all native grapes for that country
- Link to VIVC search page for that country
-
Autocomplete Search:
- Real-time search as you type
- Dropdown list of matching grapes (up to 20 results)
- Keyboard navigation (arrow keys, Enter, Escape)
- Click or press Enter to navigate directly to grape page
- Works on both local Django site and static GitHub Pages deployment
-
Search Results Page:
- Displays all grapes matching the search query
- Shows grape name, berry color, and country of origin
- Links to individual grape profiles
- Mobile-friendly layout
- Photo positioning adapts to screen size
- Tables and content reflow for smaller screens
- Search functionality works across all devices
- Backend: Django (Python web framework)
- Database: SQLite
- Frontend: HTML, CSS, JavaScript
- Data Scraping: BeautifulSoup, requests
The application uses three main models:
- Country: Stores country information (name, ISO code, VIVC search URL)
- Grape: Stores grape data (name, VIVC ID, berry color, species, breeder, year of crossing, country of origin, relationships)
- GrapePhoto: Stores photo URLs and metadata (grape reference, photo type, source attribution)
The application includes several Django management commands for data import and maintenance:
-
import_grapes: Import grape data from VIVC for specified countries- Supports selective field import (
--fieldsargument) - Can resume from a specific country (
--start-fromargument) - Skips countries that already have grapes (unless updating)
- Supports selective field import (
-
import_relationships: Import parent-child relationships for grapes in a specific country- Only processes grapes from the specified country
- Skips grapes that already have relationships
-
import_all_relationships: Import missing relationships for all grapes- Skips grapes that have already been processed
- Marks grapes with
date_last_crawledtimestamp
-
import_grape_photos: Import grape cluster photos from VIVC- Prioritizes "cluster in the field" photos
- Imports both field and laboratory photos
- Skips duplicate photos
-
check_relationships_status: Check how many grapes in a country lack relationship data -
normalize_data: Normalize existing data (colors, names) in the database -
build_static: Generate a static HTML version of the site for GitHub Pages deployment
The site can be converted to a static HTML website for deployment on platforms like GitHub Pages. The build_static command:
- Generates all HTML pages from Django templates
- Creates a
grapes.jsonfile for search autocomplete - Maintains the same URL structure and functionality
- Produces a fully functional static site without requiring a server
See STATIC_SITE_GUIDE.md for detailed instructions on building and deploying the static site.
- Home Page: Lists all countries with their native grape counts, sorted by number of grapes
- Country Pages: Click on any country to see its native grapes and color statistics
- Grape Pages: Click on any grape name to view its detailed profile
- Search: Use the search bar in the navigation to quickly find grapes by name
- Type a grape name (or partial name) in the search box
- Select a grape from the autocomplete dropdown, or
- Press Enter to see all matching results
- Click on any result to view the grape's profile
- Parents: The two grapes that were crossed to create this grape
- Children: Grapes that were created by crossing this grape with another grape
- Other Parent: When viewing children, this shows the grape that was crossed with the current grape to create the child
Country information is only shown for parents/children when it differs from the current grape's country of origin, to avoid redundant information.
- Install dependencies:
pip install -r requirements.txt - Run migrations:
python manage.py migrate - Import data:
python manage.py import_grapes - Run development server:
python manage.py runserver
- Import countries:
python manage.py add_missing_countries(if needed) - Import grapes:
python manage.py import_grapes - Import relationships:
python manage.py import_relationships <country_name> - Import photos:
python manage.py import_grape_photos
grapes/: Main Django appmodels.py: Database modelsviews.py: View functionstemplates/: HTML templatesmanagement/commands/: Django management commandstemplatetags/: Custom template filters
native_grapes.py: Original scraping script (not modified by this project)wine_grapes/: Django project settings
See LICENSE file for details.
- VIVC (Vitis International Variety Catalogue): Primary data source
- Julius Kühn-Institut (JKI): Maintainers of the VIVC database
- Photo credits are attributed to VIVC and individual photographers as provided by the source
- Switzerland: Swiss Grapes
- Italy: Native Wine Grapes of Italy
- Georgia:
- Armenia: Vitis.am