- setup virtual environment
virtualenv --python "C:\Program Files\Python\Python36\python.exe" venv
- Activate virtual environment
venv\Script\activate
- Install dependencies
pip install -r requirements.txt
- Run project using django server
python manage.py runserver
- Add mailgun credentials
- Replace
Domain
andAPI_KEY
values inservices/mailgun.py
- Replace
Start terminal with virtualenv activate and execute below command to create superadmin user to access django-admin dashboard panel.
python manage.py createsuperuser
- Start celery worker to run tasks
celery -A django_emailer worker -l info
- Start celery beat for cronjob work
celery -A django_emailer beat -l info
Follow below steps to run django-emailer project using docker
- Install redir-server
sudo apt-get install redis-server
- Go to Project roor direcotry and execute below commands:
docker build .
docker-compose up
(With this command celery and django server will start, django server will start on port 8000)
- To create super user, open new terminal window and execute below commands:
docker container list
- This will return list of containers, find container image name withdjangoemailer_web
and get container ID of it and apply below command to create super user.docker exec -it <container ID> python manage.py createsuperuser
- Open url
localhost:8000/admin
in browser, you will get admin screen and login with super user credentials.