This is a backend implementing a chart storage with Python and PostgreSQL. You can run this storage on your server to process users' saved data such as chart layouts, drawing templates, and indicator templates. For more information, refer to the Saving and loading charts section of the Advanced Charts documentation.
Python 3x, pip, Django, PostgreSQL
pip install -r requirements.txt
. For Unix users: you should have the python-dev package to install psycopg2
.charting_library_charts/settings.py
(see DATABASES
at line 16).python manage.py migrate
to create the database schema without any data.python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
.export SECRET_KEY='...'
.python manage.py runserver
. Note that for production environments, you should avoid using runserver
and instead use a suitable WSGI (Web Server Gateway Interface) server like Gunicorn.charts_storage_url
in the Widget Constructor to the URL of your chart storage. Additionally, ensure to set client_id
and user_id
.