diff --git a/joplin_vieweb/apps.py b/joplin_vieweb/apps.py index d01a9f5..f9a3f54 100644 --- a/joplin_vieweb/apps.py +++ b/joplin_vieweb/apps.py @@ -1,21 +1,6 @@ from django.apps import AppConfig -import time -from django.conf import settings -from .utils import start_synchronize_joplin class JoplinviewebConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'joplin_vieweb' - - def __init__(self, app_name, app_module): - AppConfig.__init__(self, app_name, app_module) - self.sync_task_launched = False - - # def ready(self): - # if not self.sync_task_launched: - # self.sync_task_launched = True - # start_synchronize_joplin() - # # if you're running your app, using the python manage.py runserver command on Django, your application will run twice: One time to validate your models, and the other one to run your app. - # # You can change this passing the option --noreload to the runserver command - # # => to test synchro, run with --noreload to avoid 2 // synchro. diff --git a/joplin_vieweb/urls.py b/joplin_vieweb/urls.py index b3d818a..a4d81d3 100644 --- a/joplin_vieweb/urls.py +++ b/joplin_vieweb/urls.py @@ -1,5 +1,5 @@ from django.urls import path - +from .utils import start_synchronize_joplin from . import views app_name = 'joplin' @@ -21,3 +21,7 @@ path('sync/', views.sync_data, name='get synch data'), path('sync/do', views.do_sync, name='joplin synchro'), ] + + +# One time launched code +start_synchronize_joplin() \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 5140daf..0f9cd6e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-joplin_vieweb -version = 1.5 +version = 1.6 author = gri38 author_email = onzeweb@zaclys.net description = A Django app to view your Joplin notes online.