Djangoplicity Newsletters is a dependency of the Djangoplicity CMS created by the European Southern Observatory (ESO) for managing Newsletters, Mailing Lists, Subscribers and so much more.
If you are using Docker, you can look for an example in Dockerfile and docker-compose.yml files located in the root of the repository.
Djangoplicity Newsletters currently supports Python 2.7 and Python 3+.
You must install Djangoplicity Newsletters using the Github repository, so add the following packages to your requirements depending on the Python version you are using.
# Asynchronous Task Queue
celery==4.3.0
# For Python 3+
# Djangoplicity actions
git+https://@github.com/djangoplicity/djangoplicity-actions@release/python3
# Djangoplicity newsletters
git+https://@github.com/djangoplicity/djangoplicity-newsletters.git@release/python3
# Djangoplicity
git+https://@github.com/djangoplicity/djangoplicity.git@release/python3
# For Python 2.7
# Djangoplicity actions
git+https://@github.com/djangoplicity/djangoplicity-actions@develop
# Djangoplicity newsletters
git+https://@github.com/djangoplicity/djangoplicity-newsletters.git@develop
# Djangoplicity
git+https://@github.com/djangoplicity/djangoplicity.git@develop
Celery is also required for some asynchronous tasks to work.
Now include the package in your INSTALLED_APPS
Djangoplicity requires some additional settings in order to work, so add this configuration to your settings.py file (you don't have to include those files in your assets)
You also have to add tinymce settings
Now, add the following imports to your CELERY_IMPORTS variable. You can create it if you don't have one, just be sure that you have properly configured Celery for the project.
Next, you have to register the models in your admin.py file.
Next, make the migrations for the django_mailman
package:
python manage.py makemigrations django_mailman
And run the migrations:
python manage.py migrate
This repository includes an example project for local development located in the test_project folder. You can find there the basic configuration to get a project working.
In your terminal run the command:
git clone https://github.com/djangoplicity/djangoplicity-newsletters.git
In the folder test_project you have a file named .env.example, this file serve to declare the environment variables API Key and List ID of Mailchimp.
Remove the extension .example of this file and configure your NEWSLETTERS_MAILCHIMP_API_KEY
and NEWSLETTERS_MAILCHIMP_LIST_ID
variables of Mailchimp.
All the configuration to start the project is present in the docker-compose.yml, Dockerfile and .env previously configured, then at this point a single command is required to download all the dependencies and run the project:
docker-compose --env-file ./test_project/.env up
The previous command reads the config from docker-compose.yml and .env file.
When the process finishes, the server will be available at localhost:8002
To stop containers press CTRL + C
or run docker-compose stop
.
If the dependencies change, you should recreate the docker images and start the containers again with this command:
docker-compose --env-file ./test_project/.env up --build
Inside the Makefile
there are multiple command shortcuts, they can be run in UNIX systems like this:
make <command-name>
E.g.
make migrate
In Windows you can just copy and paste the related command
This repository is released under the GPL-2.0 License