Added tasks app

This commit is contained in:
Marc Aymerich 2015-05-03 21:45:46 +00:00
parent df72a2f66d
commit 096ec56b7c
4 changed files with 9 additions and 7 deletions

View file

@ -378,3 +378,5 @@ Collecting lxml==3.3.5 (from -r re (line 22))
counter.apply_async(10, '/tmp/kakas') counter.apply_async(10, '/tmp/kakas')
# standard django deployment pracices (run checks) # standard django deployment pracices (run checks)
# setup main systemuser on post_migrate SystemUser
# Provide some fixtures with mocked data

View file

@ -126,15 +126,14 @@ DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'USER': 'orchestra', # Not used with sqlite3. 'USER': '', # Not used with sqlite3.
'PASSWORD': 'orchestra', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3.
'CONN_MAX_AGE': 60*10 # Enable persistent connections
} }
} }
# Enable persistent connections
CONN_MAX_AGE = 60*10
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/ # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/

View file

@ -57,6 +57,7 @@ def apply_async(fn, name=None, method='thread'):
# Celery API compat # Celery API compat
thread.request = AttrDict(id=task_id) thread.request = AttrDict(id=task_id)
return thread return thread
if name is None: if name is None:
name = get_name(fn) name = get_name(fn)
if method == 'thread': if method == 'thread':
@ -64,7 +65,7 @@ def apply_async(fn, name=None, method='thread'):
elif method == 'process': elif method == 'process':
method = Process method = Process
else: else:
raise NotImplementedError("Support for %s concurrency method is not supported." % method) raise NotImplementedError("%s concurrency method is not supported." % method)
fn.apply_async = partial(inner, close_connection(keep_state(fn)), name, method) fn.apply_async = partial(inner, close_connection(keep_state(fn)), name, method)
fn.delay = fn.apply_async fn.delay = fn.apply_async
return fn return fn

View file

@ -46,7 +46,7 @@
{% endif %} {% endif %}
<ul id="navigation-menu"> <ul id="navigation-menu">
<div style="max-width: 1170px; margin:auto;"> <div style="max-width: 1170px; margin:auto;">
<div id="branding"><a href="/admin/"></a><h1 id="site-name"><a href="/admin/">{{ ORCHESTRA_SITE_VERBOSE_NAME }}<span class="version">0.0.1a1</span></a></h1></div> <div id="branding"><a href="/admin/"></a><h1 id="site-name"><a href="/admin/">{{ SITE_VERBOSE_NAME }}<span class="version">0.0.1a1</span></a></h1></div>
{% for item in menu.children %}{% admin_tools_render_menu_item item forloop.counter %}{% endfor %} {% for item in menu.children %}{% admin_tools_render_menu_item item forloop.counter %}{% endfor %}
<span style="float:right;color:grey;padding:10px;font-size:11px;">{% trans 'Welcome' %}, <span style="float:right;color:grey;padding:10px;font-size:11px;">{% trans 'Welcome' %},
{% url 'admin:accounts_account_change' user.pk as user_change_url %} {% url 'admin:accounts_account_change' user.pk as user_change_url %}