удаление админки, косметические исправления
This commit is contained in:
parent
5dde84ce0a
commit
16320e58c4
@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
@ -1,4 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
from .models import MbTankRecord
|
|
||||||
|
|
||||||
admin.site.register(MbTankRecord)
|
|
@ -163,7 +163,7 @@ class MbPumpService(MbService):
|
|||||||
|
|
||||||
self._curr_state = {
|
self._curr_state = {
|
||||||
'alarms': values[35 - off],
|
'alarms': values[35 - off],
|
||||||
'flow_meter': values[16 - off] / 100,
|
'flow_meter': values[16 - off] / 10,
|
||||||
'last_update': int(datetime.now().timestamp()),
|
'last_update': int(datetime.now().timestamp()),
|
||||||
'pump_stage': values[28 - off],
|
'pump_stage': values[28 - off],
|
||||||
'vfd_curr': values[26 - off] / 100,
|
'vfd_curr': values[26 - off] / 100,
|
||||||
|
@ -28,21 +28,20 @@ PROJECT_ROOT = os.path.dirname(__file__)
|
|||||||
|
|
||||||
SECRET_KEY = os.getenv('DJANGO_SECRET')
|
SECRET_KEY = os.getenv('DJANGO_SECRET')
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['10.8.0.2', '10.8.0.6', 'ospaz.wawaa.ru', 'dev.ospaz.wawaa.ru']
|
ALLOWED_HOSTS = ['10.8.0.2', 'ospaz.wawaa.ru']
|
||||||
CSRF_TRUSTED_ORIGINS = ['http://10.8.0.2', 'http://10.8.0.6', 'https://ospaz.wawaa.ru', 'https://dev.ospaz.wawaa.ru']
|
CSRF_TRUSTED_ORIGINS = ['http://10.8.0.2', 'https://ospaz.wawaa.ru']
|
||||||
|
|
||||||
|
|
||||||
|
DEBUG = int(os.getenv('PROJECT_DEBUG', '0')) != 0
|
||||||
|
|
||||||
# HTTPS settings https://docs.djangoproject.com/en/5.0/topics/security/
|
# HTTPS settings https://docs.djangoproject.com/en/5.0/topics/security/
|
||||||
#CSRF_COOKIE_SECURE = True
|
if not DEBUG:
|
||||||
#SESSION_COOKIE_SECURE = True
|
CSRF_COOKIE_SECURE = True
|
||||||
#DEBUG = False
|
SESSION_COOKIE_SECURE = True
|
||||||
|
|
||||||
# HTTP settings
|
|
||||||
DEBUG = int(os.getenv('PROJECT_DEBUG', '0')) != 0
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'django.contrib.admin',
|
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
@ -52,7 +51,7 @@ INSTALLED_APPS = [
|
|||||||
# custom apps
|
# custom apps
|
||||||
'users.apps.UsersConfig',
|
'users.apps.UsersConfig',
|
||||||
'index.apps.IndexConfig',
|
'index.apps.IndexConfig',
|
||||||
'logs_service'
|
'logs_service.apps.LogsServiceConfig'
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
@ -14,14 +14,11 @@ Including another URLconf
|
|||||||
1. Import the include() function: from django.urls import include, path
|
1. Import the include() function: from django.urls import include, path
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
|
||||||
from django.urls import path, include
|
from django.urls import path, include
|
||||||
from django.contrib.staticfiles.views import serve
|
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', include('index.urls')),
|
path('', include('index.urls')),
|
||||||
path('account/', include('users.urls')),
|
path('account/', include('users.urls')),
|
||||||
path('fetch/', include('logs_service.urls')),
|
path('fetch/', include('logs_service.urls'))
|
||||||
path('admin/', admin.site.urls),
|
|
||||||
]
|
]
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<p>Последнее обновление: <span id="pump-last-update"></span></p>
|
<p>Последнее обновление: <span id="pump-last-update"></span></p>
|
||||||
<p>Регистр аварий: <span id="pump-alarms"></span></p>
|
<p>Регистр аварий: <span id="pump-alarms"></span></p>
|
||||||
<p>Состояние КА: <span id="pump-stage"></span></p>
|
<p>Состояние КА: <span id="pump-stage"></span></p>
|
||||||
<p>Текущий расход: <span id="pump-flow-meter"></span>м³</p>
|
<p>Текущий расход: <span id="pump-flow-meter"></span>м³/ч</p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
from .models import User
|
|
||||||
from django.contrib.auth.models import Group
|
|
||||||
|
|
||||||
|
|
||||||
admin.site.unregister(Group)
|
|
||||||
|
|
||||||
|
|
||||||
@admin.register(User)
|
|
||||||
class UserAdmin(admin.ModelAdmin):
|
|
||||||
# fields = ['id', 'login', 'is_superuser', 'registered', 'last_password_change', 'last_login']
|
|
||||||
list_display = ['id', 'login', 'is_superuser', 'registered', 'last_password_change', 'last_login']
|
|
||||||
readonly_fields = ['id', 'registered', 'last_login', 'last_password_change']
|
|
Loading…
x
Reference in New Issue
Block a user