This is a Python/Django app which displays how simple it is to export Excel and PDF files.
For creating Excel files we're using XlsxWriter module. The code contains information on how to add data to the Excel file, how to resize columns and rows, and also how to add charts. For more details read this article: How to export Excel files in a Python/Django application.
For creating PDF files we're using ReportLab library. The code contains information on how to create PDF documents, how to add paragraphs, tables or charts. For more details read this article: How to create PDF files in a Python/Django application using ReportLab
This application is developed by the awesome ASSIST Software team.
- Clone the code from git.
- Create an environment using virtualenv and activate it.
- Install the project dependencies with pip. Run this command:
pip install -r requirements.txt
while being in the folder with therequirements.txt
file. - Access mysql server using:
mysql -u root -p
and create the database:CREATE DATABASE db_name;
- Create a
local_settings.py
file in the same folder assettings.py
. Change the name and user if needed and add the password.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'weather',
'USER': 'root',
'PASSWORD': '',
'HOST': '',
'PORT': ''
}
}
DEBUG = True
- Run
python manage.py migrate
to create the tables. - Run
python manage.py runserver
to actually run the application and explore its features.