Skip to content

Instantly share code, notes, and snippets.

Ahmad Al-Sajid ahmadalsajid

Block or report user

Report or block ahmadalsajid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View celerybeat.service
[Unit]
Description=Celery Service
After=network.target
[Service]
Type=simple
User=sajid
Group=sajid
EnvironmentFile=/etc/default/celeryd
WorkingDirectory=/home/sajid/Projects/simple-celery
View celeryd.service
[Unit]
Description=Celery Service
After=network.target
[Service]
Type=forking
User=sajid
Group=sajid
EnvironmentFile=/etc/default/celeryd
WorkingDirectory=/home/sajid/Projects/simple-celery
View celeryd
# The names of the workers. This example create one worker
CELERYD_NODES="worker1"
# The name of the Celery App, should be the same as the python file
# where the Celery tasks are defined
CELERY_APP="db_update"
# Log and PID directories
CELERYD_LOG_FILE="/var/log/celery/%n%I.log"
CELERYD_PID_FILE="/var/run/celery/%n.pid"
View db_update.py
from celery import Celery
from celery.schedules import crontab
import MySQLdb
app = Celery('db_update', broker="pyamqp://guest@localhost//")
# disable UTC to use local time
app.conf.enable_utc = False
@ahmadalsajid
ahmadalsajid / httpd_vhosts.conf
Last active Jun 22, 2019
mod_wsgi-express module-config
View httpd_vhosts.conf
# virtual my_project
<VirtualHost *:80>
ServerName localhost
WSGIPassAuthorization On
ErrorLog "C:/Users/Administrator/Desktop/my_project/my_project.error.log"
CustomLog "C:/Users/Administrator/Desktop/my_project/my_project.access.log" combined
WSGIScriptAlias / "C:/Users/Administrator/Desktop/my_project/my_project/wsgi_windows.py"
<Directory "C:/Users/Administrator/Desktop/my_project/my_project">
<Files wsgi_windows.py>
Require all granted
@ahmadalsajid
ahmadalsajid / module-config.txt
Last active May 21, 2019
mod_wsgi-express module-config
View module-config.txt
LoadFile "c:/Program Files/python/python36/python36.dll"
LoadModule wsgi_module "c:/Program Files/python36/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd"
WSGIPythonHome "c:/Program Files/python/python36"
@ahmadalsajid
ahmadalsajid / wsgi_windows.py
Last active May 30, 2019
mod_wsgi with apache to serve Django application on windows server
View wsgi_windows.py
import os
import sys
import site
from django.core.wsgi import get_wsgi_application
# add python site packages, you can use virtualenvs also
site.addsitedir("C:/Program files/python36/Lib/site-packages")
# Add the app's directory to the PYTHONPATH
sys.path.append('C:/Users/Administrator/Desktop/my_project')
You can’t perform that action at this time.