Skip to content

Mathics3/Mathics3-django

Repository files navigation

Welcome to the Django front-end for Mathics3

CI status Pypi Installs Latest Version Supported Python Versions

Packaging status

This is the Django front-end to Mathics3.

  • Extensive online documentation
  • Integrated graphics, via three.js, and MathML mathematics output
  • Notebook-like sessions

See also Mathics3-live for a Webassembly-powered Python core backed by Pyodide, and this for other notebook front-ends.

mathicsserver: a Django-based Web interface

mathicssserver

This package needs a working Mathics3 core engine, installed as well as a recent version of Django. For Django, you will need mysql or mariadb installed, since that is where worksheets are stored.

See the Installing Mathics3 for instructions on installing Mathics3.

If you are a novice at installing Python packages, consider using either a pre-built OS package if available under "Packaging status" above, or the mathics docker image.

Ubuntu/Debian Specific OS dependent packages

On Ubuntu or Debian:

apt install default-libmysqlclient-dev.

Install from PyPI

Once Mathics3 is installed, run:

pip install Mathics3-Django

Install from the GitHub source

From the place root directory where GitHub was checked out:

make install

This is a Django project, so Django's manage.py script is used.

A simple way to start Mathics3 Django when GNU make is installed (which is the case on most POSIX systems):

make runserver

This runs the server in development mode. Here, when changes to the source code are made, the running server detects them and reloads the modified source.

To run Mathics3 Django in production mode and you have the Django ASGI server Daphne installed, run:

make runserver-production

In either case, this runs the Python program manage.py in mathics_django directory.

To get a list of the available commands, type:

python  mathics_django/manage.py help

To get help on a specific command, give that command at the end. For example, two useful commands are the runserver and testserver commands:

python mathics_django/manage.py help runserver

will show options for running the Django server.

Once the server is started, you will see a URL listed that looks like this:

Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Point your browser to the URL listed above. Here it is http://127.0.0.1:8000

Environment Variables

There are two special environment variables of note that control where the Mathics3 database is located. This database saves authentication and worksheet information.

By default, the database used is DATADIR + mathics.sqlite where DATADIR is under AppData/Python/Mathics3/ for MS-Windows and ~/.local/var/Mathics3/ for all others. If you want to specify your own database file, set the environment variable MATHICS3_DJANGO_DB_PATH.

If you just want to set the mathics3.sqlite portion, you can use the environment variable MATHICS3_DJANGO_DB.

Information for the online documentation comes from one of two places, DOC_USER_HTML_DATA_PATH if that exists and DOC_SYSTEM_HTML_DATA_PATH as a fallback if that doesn't exist. The latter is created when the package is built. The former allows the user or developer to update this information. In the future, it will take into account plugins that have been added.

We encourage you to contribute to Mathics3! Create your own fork, make the desired changes, commit, and make a pull request.

Mathics3-django is released under the GNU General Public License Version 3 (GPL3).

About

Django front-end to Mathics3

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Contributors