diff --git a/mathics_django/server.py b/mathics_django/server.py index 4f9b5c916..96c5b6ec3 100755 --- a/mathics_django/server.py +++ b/mathics_django/server.py @@ -1,21 +1,24 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -import sys +import argparse +import errno import os import os.path as osp -import argparse import socket -import errno import subprocess +import sys import mathics -from mathics_django import server_version_string, license_string -from mathics_django import settings as mathics_settings # Prevents UnboundLocalError -from mathics_django.version import __version__ as django_frontend_version from mathics.settings import DATA_DIR +from mathics_django import ( # Prevents UnboundLocalError + license_string, + server_version_string, + settings as mathics_settings, +) +from mathics_django.version import __version__ as django_frontend_version + def check_database(): # Check for the database @@ -107,7 +110,7 @@ def launch_app(args): addr = "127.0.0.1" try: - from django.core.servers.basehttp import run, get_internal_wsgi_application + from django.core.servers.basehttp import get_internal_wsgi_application, run handler = get_internal_wsgi_application() run(addr, port, handler) diff --git a/mathics_django/urls.py b/mathics_django/urls.py index b1734b978..822414f66 100644 --- a/mathics_django/urls.py +++ b/mathics_django/urls.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -from django.urls import re_path, include -from django.conf.urls.static import static from django.conf import settings +from django.conf.urls.static import static +from django.urls import include, re_path handler404 = "mathics_django.web.views.error_404_view" handler500 = "mathics_django.web.views.error_500_view" diff --git a/mathics_django/web/urls.py b/mathics_django/web/urls.py index f276173a4..46898b6ac 100644 --- a/mathics_django/web/urls.py +++ b/mathics_django/web/urls.py @@ -17,7 +17,6 @@ doc_subsection, ) - # These are the callback functions. from mathics_django.web.views import ( delete,