SmartChart is a microcode development platform based on Echarts. It is suitable for any WEB project and is more convenient than drag-and-drop development. Simple, agile, efficient, universal, and highly customizable, your project will be instantly upgraded to a higher level. It fully connects the front and back ends, links graphics data, and makes screening and development stress-free. The building block development model is ready to use out of the box, is easy to install, has few dependencies, and is adaptable to various platforms.
1. Install the Python environment (refer to the environment preparation above)
2. Command line installation:
pip3 install smartchart
pip3 install smartchart -U (upgrade)
# Mac or Linux initialization method
3. Initialize DB, command line input
smartchart makemigrations
smartchart migrate
4. Create an administrator account. If you already have one, you can ignore it.
smartchart createsuperuser
5. Start from local command line:
smartchart
If you need remote access, start by:
smartchart runserver 0.0.0.0:8000 --insecure
6. Visit http://127.0.0.1:8000/echart/init_db/ to initialize data
# Window initialization method
3. To initialize DB, you need to find your python installation address. If you don’t remember, refer to the method below.
Such as C:UsersxxxAppDataLocalProgramsPythonPython39
Command line input
cd C:Users....Python39Scripts
python smartchart makemigrations
python smartchart migrate
4. Create an administrator account. If you already have one, you can ignore it.
python smartchart createsuperuser
5. Start from local command line:
python smartchart
If you need remote access
Start method:
python smartchart runserver 0.0.0.0:8000 --insecure
6. Visit http://127.0.0.1:8000/echart/init_db/ to initialize data
To configure it simply, you can refer to this demo
1. Add 'smart_chart.echart' to INSTALL_APPS in your setting.py
2. Comment out XFrameOptionsMiddleware in MIDDLEWARE
3. The Chinese time zone is set in setting.py to support the construction of Chinese basic platform!
LANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = False # This must be False
4. Add a reference to your url.py
from django.conf.urls import include
from django.views.generic import RedirectView
5. Add routing to urlpatterns in url.py
path('echart/', include('smart_chart.echart.urls')),
path('', RedirectView.as_view(url='echart/index/')), #Homepage, customizable routing
6. Initialize DB, enter command line:
python manage.py makemigrations
python manage.py migrate
7. Create an administrator account. If you already have one, you can ignore it.
python manage.py createsuperuser
8. Start the service
python manage.py runserver
9. Visit http://127.0.0.1:8000/echart/init_db/ to initialize data
Corresponding project directory description:
templates/echart -- editor interface
templates/index -- HomepagePortal
static/echart -- Extended front-end data processing functions (available in graphics editing)
static/editor -- editor interface js
static/index -- Portal corresponds to js, css
CharResource -- stores the smartchart converted by echarts
git clone project
pip install smartchart
Start method python manage.py runserver