Skip to main content

Posts

Celery-beat and celery asynchronous running in daemon mode in Open-edX.

1. EDX production celery_beat configuration:                 cd /edx/app/supervisor/conf. available.d sudo nano  celery_beat_worker.conf Its content: ____________________________ [ program:celery_beat_worker ] directory=/edx/app/edxapp/edx- platform environment=DJANGO_SETTINGS_ MODULE=lms.envs.aws,SERVICE_ VARIANT="lms",PATH="/edx/app/       edxapp/venvs/edxapp/bin:/edx/ app/edxapp/edx-platform/bin:/ edx/app/edxapp/edx-platform/ node_modules/.bin:/usr/local/ sbin:/usr/local/bin:/usr/sbin: /usr/bin:/sbin:/bin" user=www-data stdout_logfile=/edx/var/log/ supervisor/%(program_name)s- stdout.log stderr_logfile=/edx/var/log/ supervisor/%(program_name)s- stderr.log autostart=true autorestart=true command=/edx/app/celery_beat_ script/celery_beat.sh ______________________________ ___________ sudo chown www-data:www-data  celery_beat_worker.conf sudo ln -s /edx/app/supervisor/conf. available.d/celery_beat_ worker.

Top 15 Python Questions and Answers

Q-1. What Is The Function To Randomize The Items Of A List In-Place? Ans.  Python has a built-in module called as <random>. It exports a public method <shuffle(<list>)> which can randomize any input sequence. import random list = [ 2 , 18 , 8 , 4 ] print "Prior Shuffling - 0" , list random . shuffle ( list ) print "After Shuffling - 1" , list random . shuffle ( list ) print "After Shuffling - 2" , list Q-2. What Is The Best Way To Split A String In Python? Ans.  We can use Python <split()> function to break a string into substrings based on the defined separator. It returns the list of all words present in the input string. test = "I am learning Python." print test . split ( " " ) Program Output. Python 2.7 . 10 ( default , Jul 14 2015 , 19 : 46 : 27 ) [ GCC 4.8 . 2 ] on linux [ 'I' , 'am' , 'learning' , 'Python.' ] Q-3. What Is The R