Merge branch 'release/v1.0.5'
This commit is contained in:
		
							
								
								
									
										5
									
								
								Pipfile
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Pipfile
									
									
									
									
									
								
							@@ -6,10 +6,11 @@ verify_ssl = true
 | 
				
			|||||||
[dev-packages]
 | 
					[dev-packages]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[packages]
 | 
					[packages]
 | 
				
			||||||
django = "==3.2.7"
 | 
					django = "==3.2.8"
 | 
				
			||||||
django-crispy-forms = "==1.13.0"
 | 
					django-crispy-forms = "==1.13.0"
 | 
				
			||||||
django-debug-toolbar = "==3.2.2"
 | 
					django-debug-toolbar = "==3.2.2"
 | 
				
			||||||
django-extensions = "==3.1.3"
 | 
					django-extensions = "==3.1.3"
 | 
				
			||||||
django-tables2 = "==2.4.0"
 | 
					django-tables2 = "==2.4.1"
 | 
				
			||||||
djangorestframework = "==3.12.4"
 | 
					djangorestframework = "==3.12.4"
 | 
				
			||||||
requests = "==2.26.0"
 | 
					requests = "==2.26.0"
 | 
				
			||||||
 | 
					django-simple-task = "==0.1.2"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					default_app_config = 'billard.apps.BillardConfig'
 | 
				
			||||||
@@ -2,4 +2,8 @@ from django.apps import AppConfig
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BillardConfig(AppConfig):
 | 
					class BillardConfig(AppConfig):
 | 
				
			||||||
 | 
					    default_auto_field = 'django.db.models.BigAutoField'
 | 
				
			||||||
    name = 'billard'
 | 
					    name = 'billard'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def ready(self):
 | 
				
			||||||
 | 
					        import billard.signals #noqa
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										43
									
								
								billard/migrations/0028_auto_20211024_1106.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								billard/migrations/0028_auto_20211024_1106.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					# Generated by Django 3.2.8 on 2021-10-24 11:06
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.db import migrations, models
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Migration(migrations.Migration):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    dependencies = [
 | 
				
			||||||
 | 
					        ('billard', '0027_clientdata'),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    operations = [
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='accounting',
 | 
				
			||||||
 | 
					            name='id',
 | 
				
			||||||
 | 
					            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='client',
 | 
				
			||||||
 | 
					            name='id',
 | 
				
			||||||
 | 
					            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='clientdata',
 | 
				
			||||||
 | 
					            name='id',
 | 
				
			||||||
 | 
					            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='desk',
 | 
				
			||||||
 | 
					            name='id',
 | 
				
			||||||
 | 
					            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='location',
 | 
				
			||||||
 | 
					            name='id',
 | 
				
			||||||
 | 
					            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='locationdata',
 | 
				
			||||||
 | 
					            name='id',
 | 
				
			||||||
 | 
					            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
							
								
								
									
										11
									
								
								billard/signals.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								billard/signals.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					from django.db.models.signals import post_save
 | 
				
			||||||
 | 
					from django.dispatch import receiver
 | 
				
			||||||
 | 
					from django_simple_task import defer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from billard.models import LocationData
 | 
				
			||||||
 | 
					from billard.tasks import process_location_data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@receiver(post_save, sender=LocationData)
 | 
				
			||||||
 | 
					def update_location_data(sender, instance, **kwargs):
 | 
				
			||||||
 | 
					    defer(process_location_data(sender=sender, kwargs=kwargs))
 | 
				
			||||||
							
								
								
									
										18
									
								
								caromserver/asgi.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								caromserver/asgi.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					"""
 | 
				
			||||||
 | 
					ASGI config for caromserver project.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					It exposes the ASGI callable as a module-level variable named ``application``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For more information on this file, see
 | 
				
			||||||
 | 
					https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.core.asgi import get_asgi_application
 | 
				
			||||||
 | 
					from django_simple_task import django_simple_task_middlware
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'caromserver.settings')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					application = get_asgi_application()
 | 
				
			||||||
 | 
					application = django_simple_task_middlware(application)
 | 
				
			||||||
@@ -38,6 +38,7 @@ INSTALLED_APPS = [
 | 
				
			|||||||
    # third party apps
 | 
					    # third party apps
 | 
				
			||||||
    'crispy_forms',
 | 
					    'crispy_forms',
 | 
				
			||||||
    'debug_toolbar',
 | 
					    'debug_toolbar',
 | 
				
			||||||
 | 
					    'django_simple_task',
 | 
				
			||||||
    'django_tables2',
 | 
					    'django_tables2',
 | 
				
			||||||
    'rest_framework',
 | 
					    'rest_framework',
 | 
				
			||||||
    'rest_framework.authtoken',
 | 
					    'rest_framework.authtoken',
 | 
				
			||||||
@@ -163,7 +164,7 @@ EMAIL_PORT = 25
 | 
				
			|||||||
URL_LOCATION_PROCESSOR = 'http://127.0.0.1:8000/billard/process_locationdata'
 | 
					URL_LOCATION_PROCESSOR = 'http://127.0.0.1:8000/billard/process_locationdata'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PRODUCT_INFO = 'CAROM'
 | 
					PRODUCT_INFO = 'CAROM'
 | 
				
			||||||
PRODUCT_VERSION = 'v 1.0.4'
 | 
					PRODUCT_VERSION = 'v 1.0.5'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
INTERNAL_IPS = ['127.0.0.1']
 | 
					INTERNAL_IPS = ['127.0.0.1']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,13 +4,13 @@ WSGI config for caromserver project.
 | 
				
			|||||||
It exposes the WSGI callable as a module-level variable named ``application``.
 | 
					It exposes the WSGI callable as a module-level variable named ``application``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For more information on this file, see
 | 
					For more information on this file, see
 | 
				
			||||||
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
 | 
					https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.core.wsgi import get_wsgi_application
 | 
					from django.core.wsgi import get_wsgi_application
 | 
				
			||||||
 | 
					
 | 
				
			||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "caromserver.settings")
 | 
					os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'caromserver.settings')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
application = get_wsgi_application()
 | 
					application = get_wsgi_application()
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										32
									
								
								manage.py
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								manage.py
									
									
									
									
									
								
							@@ -1,22 +1,22 @@
 | 
				
			|||||||
#!/usr/bin/env python3
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					"""Django's command-line utility for administrative tasks."""
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					
 | 
				
			||||||
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "caromserver.settings")
 | 
					def main():
 | 
				
			||||||
 | 
					    """Run administrative tasks."""
 | 
				
			||||||
 | 
					    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'caromserver.settings')
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        from django.core.management import execute_from_command_line
 | 
					        from django.core.management import execute_from_command_line
 | 
				
			||||||
    except ImportError:
 | 
					    except ImportError as exc:
 | 
				
			||||||
        # The above import may fail for some other reason. Ensure that the
 | 
					        raise ImportError(
 | 
				
			||||||
        # issue is really that Django is missing to avoid masking other
 | 
					            "Couldn't import Django. Are you sure it's installed and "
 | 
				
			||||||
        # exceptions on Python 2.
 | 
					            "available on your PYTHONPATH environment variable? Did you "
 | 
				
			||||||
        try:
 | 
					            "forget to activate a virtual environment?"
 | 
				
			||||||
            import django
 | 
					        ) from exc
 | 
				
			||||||
        except ImportError:
 | 
					 | 
				
			||||||
            raise ImportError(
 | 
					 | 
				
			||||||
                "Couldn't import Django. Are you sure it's installed and "
 | 
					 | 
				
			||||||
                "available on your PYTHONPATH environment variable? Did you "
 | 
					 | 
				
			||||||
                "forget to activate a virtual environment?"
 | 
					 | 
				
			||||||
            )
 | 
					 | 
				
			||||||
        raise
 | 
					 | 
				
			||||||
    execute_from_command_line(sys.argv)
 | 
					    execute_from_command_line(sys.argv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == '__main__':
 | 
				
			||||||
 | 
					    main()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user