{"id":5982,"date":"2024-11-01T08:04:33","date_gmt":"2024-11-01T08:04:33","guid":{"rendered":"https:\/\/eodhd.com\/financial-academy\/?p=5982"},"modified":"2025-02-05T14:39:37","modified_gmt":"2025-02-05T14:39:37","slug":"enhancing-the-financial-trading-dashboard-with-python-django","status":"publish","type":"post","link":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django","title":{"rendered":"Enhancing the Financial Trading Dashboard with Python Django"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"994\" src=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-1024x994.png\" alt=\"\" class=\"wp-image-6001\" srcset=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-1024x994.png 1024w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-300x291.png 300w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-768x745.png 768w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-1536x1491.png 1536w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-2048x1988.png 2048w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-60x58.png 60w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-27-at-19.56.06-150x146.png 150w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"bordered_paragraph\" style=\"font-size:16px\">Please note, API data availability depends on your subscription plan. Some data isn&#8217;t included in the free plan. Visit our <a href=\"https:\/\/eodhd.com\/pricing\" target=\"_blank\" rel=\"noreferrer noopener\">pricing page<\/a> to find the plan that fits your needs.<\/p>\n\n\n\n<p>This article builds upon the previous one, <em>\u201c<a href=\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/build-a-financial-trading-dashboard-with-python-django\" target=\"_blank\" rel=\"noreferrer noopener\">Build a Financial Trading Dashboard with Python Django<\/a>\u201d,<\/em> where I introduced the Python Django framework, and we created our first project and application. That tutorial guided you through the process of creating a treemap of market indices, with the ability to drill down into the market indices to view their constituents.<\/p>\n\n\n\n<p>In this article, we will enhance the application by addressing some minor improvements, such as decoupling the hardcoded API keys from the code. Additionally, we will implement functionality to allow viewing of historical market data, and a market search.<\/p>\n\n\n\n<p>As this new functionality is closely related to what was done in the previous article, we will use the same \u201cspglobal\u201d application instead of creating a new application within the Django project.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Register &amp; Get Data<\/span><\/a><\/p>\n\n\n\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-decoupling-the-api-keys\">Decoupling the API keys<\/h2>\n\n\n\n<p>There are several ways to achieve this, but I\u2019m going to demonstrate \u201cthe Django way\u201d.<\/p>\n\n\n\n<p>The first step is to create a <code>.env<\/code> file in the root of our project, which should look like this&#8230;<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-ac8c4e67e6ee1141ce4c5b98d5eca129\"><code lang=\"python\" class=\"language-python\">EODHD_API_TOKEN=your_api_key<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>We will use a library called <em>python-decouple<\/em>, which loads the <code>.env<\/code> file, allowing us to access its contents within our application.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-60e3d010d5996b6790d0531c6c464752\"><code lang=\"python\" class=\"language-python\">python3 -m pip install python-decouple -U<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>Edit the file, \u201ceodhd_apis\/eodhd_apis\/settings.py\u201d and make the following adjustments.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-781a594b4621e328b84d79fbd1b52c3a\"><code lang=\"python\" class=\"language-python\">from pathlib import Path\nfrom decouple import config\n\n\n# Load the API token from the .env file\nEODHD_API_TOKEN = config('EODHD_API_TOKEN')<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>Edit the \u201ceodhd_apis\/spglobal\/views.py\u201d file and make it look as below. <\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-da45035339e2cd4b868f6abc91d6c05f\"><code lang=\"python\" class=\"language-python\"><strong>from django.conf import settings<\/strong>\nimport requests\nfrom django.shortcuts import render, get_object_or_404, redirect\nfrom .models import SPGlobalIndex, IndexConstituent\n\n\ndef fetch_data(request):\n    <strong>api_token = settings.EODHD_API_TOKEN<\/strong>\n    url = <strong>f<\/strong>\"https:\/\/eodhd.com\/api\/mp\/unicornbay\/spglobal\/list?api_token=<strong>{api_token}<\/strong>\"\n    response = requests.get(url)\n    data = response.json()\n\n    for item in data:\n        SPGlobalIndex.objects.update_or_create(\n            index_id=item.get(\"ID\"),\n            defaults={\n                \"code\": item.get(\"Code\"),\n                \"name\": item.get(\"Name\"),\n                \"constituents\": item.get(\"Constituents\"),\n                \"value\": item.get(\"Value\"),\n                \"market_cap\": item.get(\"MarketCap\"),\n                \"divisor\": item.get(\"Divisor\"),\n                \"daily_return\": item.get(\"DailyReturn\"),\n                \"dividend\": item.get(\"Dividend\"),\n                \"adjusted_market_cap\": item.get(\"AdjustedMarketCap\"),\n                \"adjusted_divisor\": item.get(\"AdjustedDivisor\"),\n                \"adjusted_constituents\": item.get(\"AdjustedConstituents\"),\n                \"currency_code\": item.get(\"CurrencyCode\"),\n                \"currency_name\": item.get(\"CurrencyName\"),\n                \"currency_symbol\": item.get(\"CurrencySymbol\"),\n                \"last_update\": item.get(\"LastUpdate\"),\n            },\n        )\n\n    indices = SPGlobalIndex.objects.all()\n    return render(request, \"spglobal\/index.html\", {\"indices\": indices})\n\n\ndef fetch_index_constituents(request, index_code):\n    <strong>api_token = settings.EODHD_API_TOKEN<\/strong>\n    url = <strong>f<\/strong>'https:\/\/eodhd.com\/api\/mp\/unicornbay\/spglobal\/comp\/{index_code}?fmt=json&amp;api_token=<strong>{api_token}<\/strong>'\n    response = requests.get(url)\n    data = response.json()\n\n    # Extract constituents and general information\n    constituents = data['Components'].values()\n    general_info = data['General']\n\n    return render(request, 'spglobal\/constituents.html', {\n        'constituents': constituents,\n        'general_info': general_info\n    })\n<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>When you run your application again, you&#8217;ll notice it runs smoothly as before. The key difference is that your private API key is now securely separated in the <code>.env<\/code> file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-market-search-api\">Market Search API<\/h2>\n\n\n\n<p>EODHD APIs has a search API which I want to implement in this app. You can find the <a href=\"https:\/\/eodhd.com\/financial-apis\/search-api-for-stocks-etfs-mutual-funds\" target=\"_blank\" rel=\"noreferrer noopener\">official documentation here.<\/a><\/p>\n\n\n\n<p>I will need to create a data model for this. This will be different to the previous models because I don&#8217;t want to store the data in the database. I just want a structure for the API response to be stored.<\/p>\n\n\n\n<p>We will need to create a model for our new historical data feature. Update the <strong>eodhd_apis\/spglobal\/models.py<\/strong> and include this in the file.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-24d64d5e0e72c8e707d1af62e2be1fc1\"><code lang=\"python\" class=\"language-python\"># ADD THIS AT THE TOP\n\nfrom dataclasses import dataclass\n\n\n# ADD THIS AT THE END\n\n@dataclass\nclass SearchData:\n    Code: str\n    Exchange: str\n    Name: str\n    Type: str\n    Country: str\n    Currency: str\n    ISIN: str\n    previousClose: float\n    previousCloseDate: str<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>As per the same process as before we&#8217;ll need to update the <strong>urls.py<\/strong>, <strong>views.py<\/strong>, and create a new template called <strong>search_results.html<\/strong>.<\/p>\n\n\n\n<p><strong>eodhd_apis\/spglobal\/urls.py<\/strong><\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-8fcaae1e73f04f60c22df4059077d320\"><code lang=\"python\" class=\"language-python\">from django.urls import path\nfrom . import views\n\nurlpatterns = [\n    path(\"\", views.fetch_data, name=\"fetch_data\"),\n    path(\n        \"constituents\/&lt;str:index_code&gt;\/\",\n        views.fetch_index_constituents,\n        name=\"fetch_index_constituents\",\n    ),\n    <strong>path(\"search\/\", views.search_market_data, name=\"search_market_data\"),<\/strong>\n]<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><strong>eodhd_apis\/spglobal\/views.py<\/strong><\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-c9533c576f37ff2575a4cb219d0504dc\"><code lang=\"python\" class=\"language-python\">import time\nfrom django.conf import settings\nfrom datetime import datetime, timedelta\nimport requests\nfrom django.shortcuts import render, get_object_or_404, redirect\nfrom .models import SPGlobalIndex, IndexConstituent, SearchData\n\n\ndef fetch_data(request):\n    api_token = settings.EODHD_API_TOKEN\n    url = f\"https:\/\/eodhd.com\/api\/mp\/unicornbay\/spglobal\/list?api_token={api_token}\"\n    response = requests.get(url)\n    data = response.json()\n\n    for item in data:\n        SPGlobalIndex.objects.update_or_create(\n            index_id=item.get(\"ID\"),\n            defaults={\n                \"code\": item.get(\"Code\"),\n                \"name\": item.get(\"Name\"),\n                \"constituents\": item.get(\"Constituents\"),\n                \"value\": item.get(\"Value\"),\n                \"market_cap\": item.get(\"MarketCap\"),\n                \"divisor\": item.get(\"Divisor\"),\n                \"daily_return\": item.get(\"DailyReturn\"),\n                \"dividend\": item.get(\"Dividend\"),\n                \"adjusted_market_cap\": item.get(\"AdjustedMarketCap\"),\n                \"adjusted_divisor\": item.get(\"AdjustedDivisor\"),\n                \"adjusted_constituents\": item.get(\"AdjustedConstituents\"),\n                \"currency_code\": item.get(\"CurrencyCode\"),\n                \"currency_name\": item.get(\"CurrencyName\"),\n                \"currency_symbol\": item.get(\"CurrencySymbol\"),\n                \"last_update\": item.get(\"LastUpdate\"),\n            },\n        )\n\n    indices = SPGlobalIndex.objects.all()\n    return render(request, \"spglobal\/index.html\", {\"indices\": indices})\n\n\ndef fetch_index_constituents(request, index_code):\n    api_token = settings.EODHD_API_TOKEN\n    url = f\"https:\/\/eodhd.com\/api\/mp\/unicornbay\/spglobal\/comp\/{index_code}?fmt=json&amp;api_token={api_token}\"\n    response = requests.get(url)\n    data = response.json()\n\n    constituents = data[\"Components\"].values()\n    general_info = data[\"General\"]\n\n    return render(\n        request,\n        \"spglobal\/constituents.html\",\n        {\"constituents\": constituents, \"general_info\": general_info},\n    )\n\n\ndef search_market_data(request):\n    query = request.GET.get(\"query\", \"\")\n    api_token = settings.EODHD_API_TOKEN\n    url = f\"https:\/\/eodhd.com\/api\/search\/{query}?api_token={api_token}&amp;fmt=json\"\n\n    response = requests.get(url)\n    data = response.json() if response.status_code == 200 else []\n\n    results = [SearchData(**item) for item in data]\n\n    return render(\n        request, \"spglobal\/search_results.html\", {\"results\": results, \"query\": query}\n    )\n<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><strong>eodhd_apis\/spglobal\/templates\/spglobal\/search_results.html<\/strong><\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-8aa92be77d7b36425ba37827dfe50b33\"><code lang=\"python\" class=\"language-python\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"&gt;\n    &lt;title&gt;Search Results&lt;\/title&gt;\n\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.5.2\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.datatables.net\/1.10.21\/css\/dataTables.bootstrap4.min.css\"&gt;\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.datatables.net\/buttons\/1.7.1\/css\/buttons.bootstrap4.min.css\"&gt;\n\n    &lt;style&gt;\n        body {\n            background-color: #343a40;\n            color: #ffffff;\n        }\n\n        .table {\n            background-color: #212529;\n        }\n\n        .table a {\n            text-decoration: underline !important;\n        }\n\n        .table th,\n        .table td {\n            color: #ffffff;\n        }\n\n        .btn-dark {\n            background-color: #6c757d;\n            border-color: #6c757d;\n        }\n\n        a {\n            color: #ffffff !important;\n            text-decoration: none;\n            background-color: transparent;\n        }\n\n        a:hover {\n            color: #adb5bd !important;\n        }\n\n        .page-item.active .page-link {\n            color: #ffffff !important;\n            background-color: #495057 !important;\n            border-color: #495057 !important;\n        }\n\n        .page-link {\n            color: #ffffff !important;\n            background-color: #6c757d !important;\n            border-color: #343a40 !important;\n        }\n\n        .page-link:hover {\n            color: #adb5bd !important;\n            background-color: #5a6268 !important;\n            border-color: #343a40 !important;\n        }\n\n        .dataTables_wrapper .dataTables_paginate .paginate_button {\n            color: #ffffff !important;\n            background-color: #6c757d !important;\n            border: 1px solid #343a40 !important;\n        }\n\n        .dataTables_wrapper .dataTables_paginate .paginate_button:hover {\n            background-color: #5a6268 !important;\n            border: 1px solid #343a40 !important;\n        }\n\n        .dataTables_wrapper .dataTables_paginate .paginate_button.current {\n            color: #ffffff !important;\n            background-color: #495057 !important;\n            border: 1px solid #343a40 !important;\n        }\n\n        .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,\n        .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {\n            background-color: #6c757d !important;\n            color: #ffffff !important;\n        }\n    &lt;\/style&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n    &lt;div class=\"container mt-5\"&gt;\n        &lt;h1 class=\"mb-4 text-light\"&gt;Search Results&lt;\/h1&gt;\n\n        &lt;div class=\"table-responsive\"&gt;\n            &lt;table id=\"resultsTable\" class=\"table table-dark table-striped table-bordered\"&gt;\n                &lt;thead class=\"thead-dark\"&gt;\n                    &lt;tr&gt;\n                        &lt;th&gt;Code&lt;\/th&gt;\n                        &lt;th&gt;Exchange&lt;\/th&gt;\n                        &lt;th&gt;Name&lt;\/th&gt;\n                        &lt;th&gt;Type&lt;\/th&gt;\n                        &lt;th&gt;Country&lt;\/th&gt;\n                        &lt;th&gt;Currency&lt;\/th&gt;\n                        &lt;th&gt;ISIN&lt;\/th&gt;\n                        &lt;th&gt;Previous Close&lt;\/th&gt;\n                        &lt;th&gt;Previous Close Date&lt;\/th&gt;\n                    &lt;\/tr&gt;\n                &lt;\/thead&gt;\n                &lt;tbody&gt;\n                    {% for item in results %}\n                    &lt;tr&gt;\n                        &lt;td&gt;\n                            &lt;a href=\"\/historical\/{{ item.Code }}.{{ item.Exchange }}\/d\/\" class=\"text-white\"&gt;\n                                {{ item.Code }}\n                            &lt;\/a&gt;\n                        &lt;\/td&gt;\n                        &lt;td&gt;{{ item.Exchange }}&lt;\/td&gt;\n                        &lt;td&gt;{{ item.Name }}&lt;\/td&gt;\n                        &lt;td&gt;{{ item.Type }}&lt;\/td&gt;\n                        &lt;td&gt;{{ item.Country }}&lt;\/td&gt;\n                        &lt;td&gt;{{ item.Currency }}&lt;\/td&gt;\n                        &lt;td&gt;{{ item.ISIN }}&lt;\/td&gt;\n                        &lt;td&gt;{{ item.previousClose }}&lt;\/td&gt;\n                        &lt;td&gt;{{ item.previousCloseDate }}&lt;\/td&gt;\n                    &lt;\/tr&gt;\n                    {% endfor %}\n                &lt;\/tbody&gt;\n            &lt;\/table&gt;\n        &lt;\/div&gt;\n\n        &lt;a href=\"{% url 'fetch_data' %}\" class=\"btn btn-dark mt-4\"&gt;Back to Index&lt;\/a&gt;\n    &lt;\/div&gt;\n\n    <a href=\"https:\/\/code.jquery.com\/jquery-3.5.1.min.js\">https:\/\/code.jquery.com\/jquery-3.5.1.min.js<\/a>\n&lt;\/body&gt;\n\n&lt;\/html&gt;<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>This will have the same look and feel of the previous constituents table from the previous article.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"971\" src=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-1024x971.png\" alt=\"\" class=\"wp-image-5996\" srcset=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-1024x971.png 1024w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-300x284.png 300w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-768x728.png 768w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-1536x1456.png 1536w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-2048x1942.png 2048w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-60x57.png 60w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-23-at-20.51.39-150x142.png 150w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>I will update the constituents page to allow you to reach this new page. What is quite exciting about this is it works with all markets on EODHD. If you know the EODHD APIs code for any market with historical data you can view it. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-updating-the-constituents-results\">Updating the Constituents results<\/h2>\n\n\n\n<p>What would be nice now is to be able to access either the market constituents OR the historical data from the treemap. I&#8217;ve made the updates to make this possible in the \u201ceodhd_apis\/spglobal\/templates\/spglobal\/constituents.html\u201d file.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-4f22fa649cb0de6823097919fa1381b7\"><code lang=\"python\" class=\"language-python\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"&gt;\n    &lt;title&gt;{{ general_info.Name }} Constituents&lt;\/title&gt;\n    \n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.5.2\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.datatables.net\/1.10.21\/css\/dataTables.bootstrap4.min.css\"&gt;\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.datatables.net\/buttons\/1.7.1\/css\/buttons.bootstrap4.min.css\"&gt;\n\n    &lt;style&gt;\n        body {\n            background-color: #343a40;\n            color: #ffffff;\n        }\n        .table {\n            background-color: #212529;\n        }\n        .table th, .table td {\n            color: #ffffff;\n        }\n        .btn-dark {\n            background-color: #6c757d;\n            border-color: #6c757d;\n        }\n        a {\n            color: #ffffff !important;\n            text-decoration: none;\n            background-color: transparent;\n        }\n        a:hover {\n            color: #adb5bd !important;\n        }\n        .page-item.active .page-link {\n            z-index: 3;\n            color: #ffffff !important;\n            background-color: #495057 !important;\n            border-color: #495057 !important;\n        }\n        .page-link {\n            color: #ffffff !important;\n            background-color: #6c757d !important;\n            border-color: #343a40 !important;\n        }\n        .page-link:hover {\n            color: #adb5bd !important;\n            background-color: #5a6268 !important;\n            border-color: #343a40 !important;\n        }\n        .dataTables_wrapper .dataTables_paginate .paginate_button {\n            color: #ffffff !important;\n            background-color: #6c757d !important;\n            border: 1px solid #343a40 !important;\n        }\n        .dataTables_wrapper .dataTables_paginate .paginate_button:hover {\n            background-color: #5a6268 !important;\n            border: 1px solid #343a40 !important;\n        }\n        .dataTables_wrapper .dataTables_paginate .paginate_button.current {\n            color: #ffffff !important;\n            background-color: #495057 !important;\n            border: 1px solid #343a40 !important;\n        }\n        .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,\n        .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {\n            background-color: #6c757d !important;\n            color: #ffffff !important;\n        }\n        .code-link {\n        color: #ffffff;\n        text-decoration: underline !important;\n        }\n        .code-link:hover {\n            color: #adb5bd;\n            text-decoration: none !important;\n        }\n    &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;div class=\"container mt-5\"&gt;\n        &lt;h1 class=\"mb-4 text-light\"&gt;{{ general_info.Name }} ({{ general_info.Code }}) Constituents&lt;\/h1&gt;\n\n        &lt;table id=\"constituentsTable\" class=\"table table-dark table-striped table-bordered\"&gt;\n            &lt;thead class=\"thead-dark\"&gt;\n                &lt;tr&gt;\n                    &lt;th&gt;Code&lt;\/th&gt;\n                    &lt;th&gt;Name&lt;\/th&gt;\n                    &lt;th&gt;Sector&lt;\/th&gt;\n                    &lt;th&gt;Industry&lt;\/th&gt;\n                    &lt;th&gt;Weight&lt;\/th&gt;\n                &lt;\/tr&gt;\n            &lt;\/thead&gt;\n            &lt;tbody&gt;\n                {% for constituent in constituents %}\n                &lt;tr&gt;\n                    &lt;td&gt;\n                        &lt;a href=\"\/historical\/{{ constituent.Code }}.US\/d\/\" class=\"code-link\"&gt;\n                            {{ constituent.Code }}\n                        &lt;\/a&gt;\n                    &lt;\/td&gt;\n                    &lt;td&gt;{{ constituent.Name }}&lt;\/td&gt;\n                    &lt;td&gt;{{ constituent.Sector }}&lt;\/td&gt;\n                    &lt;td&gt;{{ constituent.Industry }}&lt;\/td&gt;\n                    &lt;td&gt;{{ constituent.Weight }}&lt;\/td&gt;\n                &lt;\/tr&gt;\n                {% endfor %}\n            &lt;\/tbody&gt;\n        &lt;\/table&gt;\n\n        &lt;a href=\"{% url 'fetch_data' %}\" class=\"btn btn-dark mt-4\"&gt;Back to Index List&lt;\/a&gt;\n    &lt;\/div&gt;\n\n    <a href=\"https:\/\/code.jquery.com\/jquery-3.5.1.min.js\">https:\/\/code.jquery.com\/jquery-3.5.1.min.js<\/a>\n    <a href=\"https:\/\/cdn.jsdelivr.net\/npm\/@popperjs\/core@2.9.1\/dist\/umd\/popper.min.js\">https:\/\/cdn.jsdelivr.net\/npm\/@popperjs\/core@2.9.1\/dist\/umd\/popper.min.js<\/a>\n    <a href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.5.2\/js\/bootstrap.min.js\">https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.5.2\/js\/bootstrap.min.js<\/a>\n    <a href=\"https:\/\/cdn.datatables.net\/1.10.21\/js\/jquery.dataTables.min.js\">https:\/\/cdn.datatables.net\/1.10.21\/js\/jquery.dataTables.min.js<\/a>\n    <a href=\"https:\/\/cdn.datatables.net\/1.10.21\/js\/dataTables.bootstrap4.min.js\">https:\/\/cdn.datatables.net\/1.10.21\/js\/dataTables.bootstrap4.min.js<\/a>\n    <a href=\"https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/dataTables.buttons.min.js\">https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/dataTables.buttons.min.js<\/a>\n    <a href=\"https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/buttons.bootstrap4.min.js\">https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/buttons.bootstrap4.min.js<\/a>\n    <a href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jszip\/3.1.3\/jszip.min.js\">https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jszip\/3.1.3\/jszip.min.js<\/a>\n    <a href=\"https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/buttons.html5.min.js\">https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/buttons.html5.min.js<\/a>\n    <a href=\"https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/buttons.print.min.js\">https:\/\/cdn.datatables.net\/buttons\/1.7.1\/js\/buttons.print.min.js<\/a>\n\n    &lt;script&gt;\n        $(document).ready(function() {\n            $('#constituentsTable').DataTable({\n                paging: true,\n                searching: true,\n                ordering: true,\n                info: true,\n                lengthMenu: [10, 25, 50, 100],\n                order: [[4, \"desc\"]],\n                dom: 'Bfrtip',\n                buttons: [\n                    {\n                        extend: 'excel',\n                        text: 'Export to Excel'\n                    }\n                ]\n            });\n        });\n    &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<h2 class=\"wp-block-heading\" id=\"h-gotcha\">\u201cGotcha\u201d<\/h2>\n\n\n\n<p>You will notice that the constituents page returns a Code like AAPL. The historical data requires you to include the exchange like .US. This information is not available in the constituents list. The way I got this working was to append .US to the code. This should work in almost call cases. The problem may happen if for example an index had any cryptocurrency included as I know that uses .CC as a prefix. I&#8217;ve done a lot of testing and I&#8217;ve yet to find one that doesn&#8217;t work with a .US prefix but I just wanted you to be aware of the limitation. If EODHD APIs decide to add this additional information to the constituents results, then this would be an easy fix.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-next-steps\">Next Steps<\/h2>\n\n\n\n<p>The next article will explore treemap alternatives that can be used instead of D3.js.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Please note, API data availability depends on your subscription plan. Some data isn&#8217;t included in the free plan. Visit our pricing page to find the plan that fits your needs. This article builds upon the previous one, \u201cBuild a Financial Trading Dashboard with Python Django\u201d, where I introduced the Python Django framework, and we created [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":6110,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[64],"tags":[],"coding-language":[53,30],"ready-to-go-solution":[],"qualification":[31],"financial-apis-category":[36],"financial-apis-manuals":[39,38],"class_list":["post-5982","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-building-stocks-apps-examples","coding-language-javascript","coding-language-python","qualification-experienced","financial-apis-category-stock-market-prices","financial-apis-manuals-end-of-day","financial-apis-manuals-intraday","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.9 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Enhancing the Financial Trading Dashboard with Python Django | EODHD APIs Academy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Enhancing the Financial Trading Dashboard with Python Django\" \/>\n<meta property=\"og:description\" content=\"Please note, API data availability depends on your subscription plan. Some data isn&#8217;t included in the free plan. Visit our pricing page to find the plan that fits your needs. This article builds upon the previous one, \u201cBuild a Financial Trading Dashboard with Python Django\u201d, where I introduced the Python Django framework, and we created [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django\" \/>\n<meta property=\"og:site_name\" content=\"Financial Academy\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eodhistoricaldata\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T08:04:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-05T14:39:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2065\" \/>\n\t<meta property=\"og:image:height\" content=\"871\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Michael Whittle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:site\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Whittle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#article\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django\"},\"author\":{\"name\":\"Michael Whittle\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad\"},\"headline\":\"Enhancing the Financial Trading Dashboard with Python Django\",\"datePublished\":\"2024-11-01T08:04:33+00:00\",\"dateModified\":\"2025-02-05T14:39:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django\"},\"wordCount\":679,\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png\",\"articleSection\":[\"Building Stocks Apps Examples\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django\",\"name\":\"Enhancing the Financial Trading Dashboard with Python Django | EODHD APIs Academy\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png\",\"datePublished\":\"2024-11-01T08:04:33+00:00\",\"dateModified\":\"2025-02-05T14:39:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png\",\"width\":2065,\"height\":871},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/eodhd.com\/financial-academy\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Enhancing the Financial Trading Dashboard with Python Django\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#website\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/\",\"name\":\"Financial APIs Academy | EODHD\",\"description\":\"Financial Stock Market Academy\",\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/eodhd.com\/financial-academy\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\",\"name\":\"EODHD (EOD Historical Data)\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"width\":159,\"height\":82,\"caption\":\"EODHD (EOD Historical Data)\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/eodhistoricaldata\",\"https:\/\/x.com\/EOD_data\",\"https:\/\/www.reddit.com\/r\/EODHistoricalData\/\",\"https:\/\/eod-historical-data.medium.com\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad\",\"name\":\"Michael Whittle\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g\",\"caption\":\"Michael Whittle\"},\"description\":\"Solution architect, developer, and analyst with over 20+ years experience (TOP author on Medium).\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/author\/michaelwhittle\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Enhancing the Financial Trading Dashboard with Python Django | EODHD APIs Academy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django","og_locale":"en_US","og_type":"article","og_title":"Enhancing the Financial Trading Dashboard with Python Django","og_description":"Please note, API data availability depends on your subscription plan. Some data isn&#8217;t included in the free plan. Visit our pricing page to find the plan that fits your needs. This article builds upon the previous one, \u201cBuild a Financial Trading Dashboard with Python Django\u201d, where I introduced the Python Django framework, and we created [&hellip;]","og_url":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django","og_site_name":"Financial Academy","article_publisher":"https:\/\/www.facebook.com\/eodhistoricaldata","article_published_time":"2024-11-01T08:04:33+00:00","article_modified_time":"2025-02-05T14:39:37+00:00","og_image":[{"width":2065,"height":871,"url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png","type":"image\/png"}],"author":"Michael Whittle","twitter_card":"summary_large_image","twitter_creator":"@EOD_data","twitter_site":"@EOD_data","twitter_misc":{"Written by":"Michael Whittle","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#article","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django"},"author":{"name":"Michael Whittle","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad"},"headline":"Enhancing the Financial Trading Dashboard with Python Django","datePublished":"2024-11-01T08:04:33+00:00","dateModified":"2025-02-05T14:39:37+00:00","mainEntityOfPage":{"@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django"},"wordCount":679,"publisher":{"@id":"https:\/\/eodhd.com\/financial-academy\/#organization"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png","articleSection":["Building Stocks Apps Examples"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django","url":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django","name":"Enhancing the Financial Trading Dashboard with Python Django | EODHD APIs Academy","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-academy\/#website"},"primaryImageOfPage":{"@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png","datePublished":"2024-11-01T08:04:33+00:00","dateModified":"2025-02-05T14:39:37+00:00","breadcrumb":{"@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#primaryimage","url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png","contentUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png","width":2065,"height":871},{"@type":"BreadcrumbList","@id":"https:\/\/eodhd.com\/financial-academy\/building-stocks-apps-examples\/enhancing-the-financial-trading-dashboard-with-python-django#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eodhd.com\/financial-academy\/"},{"@type":"ListItem","position":2,"name":"Enhancing the Financial Trading Dashboard with Python Django"}]},{"@type":"WebSite","@id":"https:\/\/eodhd.com\/financial-academy\/#website","url":"https:\/\/eodhd.com\/financial-academy\/","name":"Financial APIs Academy | EODHD","description":"Financial Stock Market Academy","publisher":{"@id":"https:\/\/eodhd.com\/financial-academy\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/eodhd.com\/financial-academy\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/eodhd.com\/financial-academy\/#organization","name":"EODHD (EOD Historical Data)","url":"https:\/\/eodhd.com\/financial-academy\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/","url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","contentUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","width":159,"height":82,"caption":"EODHD (EOD Historical Data)"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/eodhistoricaldata","https:\/\/x.com\/EOD_data","https:\/\/www.reddit.com\/r\/EODHistoricalData\/","https:\/\/eod-historical-data.medium.com\/"]},{"@type":"Person","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad","name":"Michael Whittle","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g","caption":"Michael Whittle"},"description":"Solution architect, developer, and analyst with over 20+ years experience (TOP author on Medium).","url":"https:\/\/eodhd.com\/financial-academy\/author\/michaelwhittle"}]}},"jetpack_featured_media_url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/11\/Enhancing-article-2.png","jetpack_shortlink":"https:\/\/wp.me\/pdOdVT-1yu","jetpack_sharing_enabled":true,"acf":[],"_links":{"self":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/5982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/comments?post=5982"}],"version-history":[{"count":23,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/5982\/revisions"}],"predecessor-version":[{"id":6327,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/5982\/revisions\/6327"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/media\/6110"}],"wp:attachment":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/media?parent=5982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/categories?post=5982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/tags?post=5982"},{"taxonomy":"coding-language","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/coding-language?post=5982"},{"taxonomy":"ready-to-go-solution","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/ready-to-go-solution?post=5982"},{"taxonomy":"qualification","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/qualification?post=5982"},{"taxonomy":"financial-apis-category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/financial-apis-category?post=5982"},{"taxonomy":"financial-apis-manuals","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/financial-apis-manuals?post=5982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}