Skip to content

Instantly share code, notes, and snippets.

View rehbarkhan's full-sized avatar

Mohammad Rehbar rehbarkhan

View GitHub Profile
@rehbarkhan
rehbarkhan / django_celery_email
Last active May 24, 2023 03:25
Django Celery Task for Sendin Email
#1 define the cery on project foler.
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings') # can be copied from the wsgi file
app = Celery('proj')
app.auto_discovertask()
#2 define the actual method(mostly written in django)
def send_email(self):
@rehbarkhan
rehbarkhan / django_logging.txt
Last active May 16, 2023 17:59
Django Loggin Enable
LOGGING = {
'version':1,
'disable_existing_loggers':False,
'formatters':{
'main_formatter':{
'format':"{asctime} {levelname} {pathname} {module} {lineno} {message}",
"style":"{"
}
},
'handlers':{