mirror of
https://github.com/aykhans/series-robot-web.git
synced 2025-04-21 22:28:57 +00:00
Added crontab to celery schedule
This commit is contained in:
parent
4f795b628f
commit
9294a769be
@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
from celery import Celery
|
from celery import Celery
|
||||||
|
from celery.schedules import crontab
|
||||||
|
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development")
|
||||||
@ -10,6 +11,6 @@ app.autodiscover_tasks()
|
|||||||
app.conf.beat_schedule = {
|
app.conf.beat_schedule = {
|
||||||
'send-emails': {
|
'send-emails': {
|
||||||
'task': 'send_emails',
|
'task': 'send_emails',
|
||||||
'schedule': 86400,
|
'schedule': crontab(hour=23, minute=58),
|
||||||
},
|
},
|
||||||
}
|
}
|
@ -93,5 +93,3 @@ EMAIL_HOST_USER = 'series.notification@gmail.com'
|
|||||||
EMAIL_PORT = 465
|
EMAIL_PORT = 465
|
||||||
EMAIL_USE_SSL = True
|
EMAIL_USE_SSL = True
|
||||||
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
||||||
|
|
||||||
CELERY_BROKER_URL = "amqp://guest:guest@rabbitmq:5672/"
|
|
@ -5,7 +5,7 @@ DEBUG = True
|
|||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
CSRF_TRUSTED_ORIGINS=['http://127.0.0.1:1337']
|
CSRF_TRUSTED_ORIGINS=['http://127.0.0.1:8000']
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
|
@ -23,3 +23,5 @@ STATIC_ROOT = os.path.join(os.path.dirname(os.path.dirname(BASE_DIR)), 'django_s
|
|||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [
|
||||||
BASE_DIR / 'static'
|
BASE_DIR / 'static'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
CELERY_BROKER_URL = "amqp://guest:guest@rabbitmq:5672/"
|
@ -6,6 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% include 'components/message.html' %}
|
{% include 'components/message.html' %}
|
||||||
|
<link rel="stylesheet" href="{% static 'css/homepage.css' %}">
|
||||||
|
|
||||||
<table class="table" style="margin-bottom: 1.5rem;">
|
<table class="table" style="margin-bottom: 1.5rem;">
|
||||||
<thead>
|
<thead>
|
||||||
@ -24,10 +25,10 @@
|
|||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<a class="btn mr-1 update-btn" style="padding: 0;" href="{% url 'update-series' s.slug %}">
|
<a class="btn mr-1 update-btn" style="padding: 0;" href="{% url 'update-series' s.slug %}">
|
||||||
<img src="{% static 'icons/edit.png' %}" width="21px" height="21px">
|
<img class="edit-icon" src="{% static 'icons/edit.png' %}" width="21px" height="21px">
|
||||||
</a>
|
</a>
|
||||||
<a class="btn delete-btn" href="{% url 'delete-series' s.slug %}">
|
<a class="btn delete-btn" href="{% url 'delete-series' s.slug %}">
|
||||||
<img src="{% static 'icons/trash.png' %}" width="24px" height="24px">
|
<img class="trash-icon" src="{% static 'icons/trash.png' %}" width="24px" height="24px">
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
{% block title %} New Episodes of The Series {% endblock title %}
|
{% block title %} New Episodes of The Series {% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<link rel="stylesheet" href="{% static 'css/new_episodes.css' %}">
|
||||||
|
|
||||||
<table class="table" style="margin-bottom: 1.5rem;">
|
<table class="table" style="margin-bottom: 1.5rem;">
|
||||||
<thead>
|
<thead>
|
||||||
|
15
src/static/css/homepage.css
Normal file
15
src/static/css/homepage.css
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
@media only screen and (max-width: 510px) {
|
||||||
|
table {
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-icon {
|
||||||
|
width: 19px;
|
||||||
|
height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trash-icon {
|
||||||
|
width: 21px;
|
||||||
|
height: 21px;
|
||||||
|
}
|
||||||
|
}
|
15
src/static/css/new_episodes.css
Normal file
15
src/static/css/new_episodes.css
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
@media only screen and (max-width: 510px) {
|
||||||
|
table {
|
||||||
|
font-size: 85%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-icon {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trash-icon {
|
||||||
|
width: 17px;
|
||||||
|
height: 17px;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user