tidy obsolete troggle/code/reset_db

This commit is contained in:
Philip Sargent 2021-04-10 01:14:23 +01:00
parent 6dc54adec8
commit 876868506f
5 changed files with 53 additions and 32 deletions

View File

@ -0,0 +1,30 @@
import os
from optparse import make_option
from django.db import connection
from django.core import management
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
import settings
"""this is now replaced by databaseRest.py
I don't know why this still exists. Needs testing to see if
removing it makes django misbehave.
"""
class Command(BaseCommand):
def add_arguments(self, parser):
# Positional arguments
parser.add_argument('posargs', nargs='+', type=int)
# Named (optional) arguments
parser.add_argument(
'--delete',
action='store_true',
help='Removed as redundant - use databaseReset.py',
)
def handle(self, *args, **options):
print(args)
print(options)

View File

@ -1,32 +0,0 @@
import os
from optparse import make_option
from django.db import connection
from django.core import management
from django.core.urlresolvers import reverse
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from troggle.core.models import Cave, Entrance
import settings
"""Pretty much all of this is now replaced by databaseRest.py
I don't know why this still exists. Needs testing to see if
removing it makes django misbehave.
"""
class Command(BaseCommand):
help = 'Removed as redundant - use databaseReset.py'
option_list = BaseCommand.option_list + (
make_option('--reset',
action='store_true',
dest='reset',
default=False,
help='Removed as redundant'),
)
def handle(self, *args, **options):
print(args)
print(options)

7
debian/sitecustomize.py vendored Normal file
View File

@ -0,0 +1,7 @@
# install the apport exception handler if available
try:
import apport_python_hook
except ImportError:
pass
else:
apport_python_hook.install()

View File

@ -82,3 +82,14 @@ I've tweaked the apache and mysql settings to make them a bit more suitable for
https://www.narga.net/optimizing-apachephpmysql-low-memory-server/
(just discovered 'ab' for running apache performance tests - handy).
Do the edit to site-packages/django/db/backends/base.py
to comment out the requirement for mysqlclient >1.3.13
as we run perfectly happily with Django 2.2.19 & mysqlite 1.3.10
:
version = Database.version_info
#test nobbled by Wookey 2021-04-08 as 1.3.13 is not available on stable
#if version < (1, 3, 13):
# raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)

View File

@ -0,0 +1,5 @@
#!/usr/bin/env python3
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()