Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start background sync at the right place (don't disturb collectstatic… #17

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions joplin_vieweb/apps.py
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 5 additions & 1 deletion joplin_vieweb/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path

from .utils import start_synchronize_joplin
from . import views

app_name = 'joplin'
Expand All @@ -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()
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = django-joplin_vieweb
version = 1.5
version = 1.6
author = gri38
author_email = [email protected]
description = A Django app to view your Joplin notes online.
Expand Down