I am using different Servers alongside Django Server. For Example MongoDB server and Celery[command]
I want to ask that how can I execute other CMD commands automatically whenever I start "**
python manage.py runserver
**"
I am using different Servers alongside Django Server. For Example MongoDB server and Celery[command]
I want to ask that how can I execute other CMD commands automatically whenever I start "**
python manage.py runserver
**"
Depends on what OS you use, on my Ubuntu for local development I do this:
Create .sh script. For example start_project.sh with this code:
cd /path/to/project
source /venv/bin/activate
python manage.py runserver & celery -A project worker --loglevel=debug
And then just run bash start_project.sh
Also you can add more commands to start separated by &
You should write a shell script which contains commands to start each service and then use it to get your projects running. For example here is a sample:
sudo service mongodb start
celery -A worker appname.celery
python manage.py runserver 0.0.0.0:80 > /dev/null 2>&1 &
Due to you use the term CMD I guess you use a Windows based OS. I would then say that you probably have the mongoDB service installation? (otherwise reinstall mongoDB as Service).
By defualt set to autostart (changable to non-autostart). If you changed the service for mongoDB to manual starting method, then you could start it in CMD as
net start mongoDB
I do not use/know what "Celery" is but quick google made it sound as some sort of message que. Which in my opinion should be or at least should have a service installation in which case you should use that and then use autostart/manual as described for mongoDB.