cleanup config and old packages, add description how to run tests and clear the cache

This commit is contained in:
Moritz Münch 2022-01-09 23:05:33 +01:00
parent 4b3aeb00ef
commit dc5b622123
4 changed files with 16 additions and 51 deletions

View File

@ -5,13 +5,9 @@ verify_ssl = true
[dev-packages] [dev-packages]
pudb = "*" pudb = "*"
django-extensions = "*"
werkzeug = "*"
pydotplus = "*"
[packages] [packages]
django = "*" django = "*"
django-cacheops = "*"
[requires] [requires]
python_version = "3.8" python_version = "3.8"

View File

@ -79,3 +79,15 @@ Alias /static /path/to/coinmanager/static
``` ```
- Test if your config syntax ist OK `apachectl configtest` - Test if your config syntax ist OK `apachectl configtest`
- Finally restart apache2 `systemctl restart apache2` - Finally restart apache2 `systemctl restart apache2`
# clear django cache
When things arent changing this may help you:
```
python manage.py shell
>>> from django.core.cache import cache; cache.clear(); exit()
```
# run tests
```
python manage.py test
```

View File

@ -32,7 +32,6 @@ ALLOWED_HOSTS = ['willipink.eu']
INSTALLED_APPS = [ INSTALLED_APPS = [
'coinc.apps.CoincConfig', 'coinc.apps.CoincConfig',
# 'cacheops',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
@ -123,10 +122,6 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/ # https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
# Maintenance Mode # Maintenance Mode
MAINTENANCE_MODE_READ_ONLY = False MAINTENANCE_MODE_READ_ONLY = False
@ -134,28 +129,7 @@ MAINTENANCE_MODE_READ_ONLY = False
# do not redirect after login # do not redirect after login
LOGIN_REDIRECT_URL = './' LOGIN_REDIRECT_URL = './'
# caching STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
# CACHES = { SECURE_SSL_REDIRECT = True
# 'default': { SESSION_COOKIE_SECURE = True
# file-based CSRF_COOKIE_SECURE = True
# 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
# 'LOCATION': '/var/tmp/django-cache',
# 'TIMEOUT': None,
# memory-based
#'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
#'LOCATION': 'coinc',
#'TIMEOUT': None,
# }
# }
# caching
# CACHE_MIDDLEWARE_ALIAS = 'default'
# CACHE_MIDDLEWARE_SECONDS = 60*60*24*365
# CACHEOPS_REDIS = "unix://var/run/redis/redis-server.sock"
# CACHEOPS_DEFAULTS = { 'timeout': 60*60*24*365 }
# CACHEOPS = {
# # 'coinc.*': None,
# 'coinc.coin': { 'cache_on_save': True }
# }
# CACHEOPS_DEGRADE_ON_FAILURE = True

View File

@ -38,7 +38,6 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django_extensions',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -129,19 +128,3 @@ MAINTENANCE_MODE_READ_ONLY = False
# do not redirect after login # do not redirect after login
LOGIN_REDIRECT_URL = './' LOGIN_REDIRECT_URL = './'
# caching modes, i.e. file based, memcached, or other fancy stuff
# https://docs.djangoproject.com/en/3.1/topics/cache/#cache-arguments
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': '/var/tmp/django_cache',
'TIMEOUT': None,
}
}
# per-site cache
# updatecachemiddleware: adds 'Expires' and 'Cache-Control' headers to give the
# page a maximum age CACHE_MIDDLEWARE_SECONDS
# CACHE_MIDDLEWARE_ALIAS = 'default'
# CACHE_MIDDLEWARE_SECONDS = 600