Commit ac35be18 authored by Shivanthi Fernando's avatar Shivanthi Fernando

Create customer data interface and load customer data

parent 768cbb6f
......@@ -15,5 +15,6 @@ urlpatterns = [
path('PurchaseHistory/', responseapp_views.PurchaseHistory),
path('Forecasting/', responseapp_views.Forecasting),
path('Result/', responseapp_views.Forecasting),
path('Customer_Data/', responseapp_views.Customer_Data),
path('', admin.site.urls),
]
\ No newline at end of file
......@@ -214,6 +214,15 @@ def AdminLogin(request):
def AdminHome(request):
return render(request,'Admin/AdminHome.html')
def Customer_Data(request):
data = pd.read_csv('Data/CustomerDataset.csv')
finalpt = data.head(500)
json_records = finalpt.reset_index().to_json(orient='records')
arr = []
arr = json.loads(json_records)
context = {'d': arr}
return render(request, 'Admin/Customer_Data.html', context);
No preview for this file type
......@@ -185,6 +185,7 @@ body{
</li>
<li><a style="text-decoration:none;" href="/Admin/Forecasting/"><i class="fas fa-bullseye "></i> Demand Forecasting </a>
<li><a style="text-decoration:none;" href="/Admin/PurchaseHistory/"><i class="fas fa-cubes"></i> Purchase History </a>
<li><a style="text-decoration:none;" href="/Admin/Customer_Data/"><i class="fas fa-user "></i> Customer Data </a>
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment