Welcome to Graphitude, a dynamic website that helps you to visualise your data! Simply upload your dataset and choose the column you wish to visualise and the type of visualisation. You can also select custom columns to generate a model and use it to predict values.
python -m venv venv_graphitude
source ./venv_graphitude/bin/activate
venv_graphitude\Scripts\activate.bat
venv_graphitude\Scripts\Activate.ps1
Create a new directory for your project. If you have git repository then may avoid creating directory
mkdir graphitude cd graphitude
pip install django
clone from
django-admin startproject graphitude .
python manage.py runserver
Assuming you already have the graphitude project set up, navigate to its directory in your terminal:
bash
Code:
cd path/to/your/graphitude
-
Create a Django app named
graphapp: Inside your project directory (graphitude), run: bash Code:python manage.py startapp graphappThis will create a directory named
graphapp. -
Register the app in Django settings: Open
graphitude/settings.pyand add'graphapp',to theINSTALLED_APPSlist:python Code:
INSTALLED_APPS = [ ... 'graphapp', ... ]
If your app graphapp needs models, define them in graphapp/models.py. For example:
Python Code:
from django.db import models class Graph(models.Model): name = models.CharField(max_length=100) description = models.TextField() def __str__(self): return self.name
After defining models, you'll need to create and apply migrations:
bash Code:
python manage.py makemigrations graphapp python manage.py migrate
Define views in graphapp/views.py. Here's an example view:
python
Code:
from django.shortcuts import render from .models import Graph def graph_list(request): graphs = Graph.objects.all() return render(request, 'graphapp/graph_list.html', {'graphs': graphs})
-
Create templates directory: Inside the
graphappdirectory, create a new directory namedtemplates. -
Create HTML template: Inside
graphapp/templates, creategraph_list.html(or any other needed templates):html
Code:
<!DOCTYPE html> <html> <head> <title>Graph List</title> </head> <body> <h1>Graph List</h1> <ul> {% for graph in graphs %} <li>{{ graph.name }}</li> {% endfor %} </ul> </body> </html>
-
Create
urls.pyingraphapp: Create a new fileurls.pyinside thegraphappdirectory and define your URLs:python
Code:
from django.urls import path from . import views urlpatterns = [ path('graphs/', views.graph_list, name='graph_list'), # Add more URLs as needed ] -
Include
graphappURLs in project URLs: Opengraphitude/urls.pyand include thegraphappURLs:python
Code:
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('graphapp/', include('graphapp.urls')), # Add other URL patterns as needed ]
-
Run the server:
bash
Code:
python manage.py runserver -
Access your app: Go to
http://127.0.0.1:8000/graphapp/graphs/(or the URL defined in yoururls.py).
Now that your graphapp app is integrated into your existing graphitude project, you can continue to develop additional features, templates, views, and models as per your project requirements.