No project description provided
Project description
=====
mailchimp_sender_package
=====
Requirements:
Quick start
-----------
0. Launch setup.py::
python3 setup.py dist
0.1. Go into folder 'dist' and install 'mailchimp_sender_package-[version].tar.gz' with packages manager (pip, for example).
1. Add "mailchimp_sender_package" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'mailchimp_sender_package',
]
Also add the MAILCHIMP_API_KEY::
MAILCHIMP_API_KEY = 'YOUR API KEY'
2. Include the mailchimp_sender_package URLconf in your project urls.py like this::
url(r'^mailchimp/', include('mailchimp_sender_package.urls')),
3. Run 'python manage.py makemigrations' and 'python manage.py migrate' for your project to create the models.
4. Create into folder with settings.py, wsgi.py and etc. file 'celery.py' with this content::
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "[proj_name].settings")
app = Celery('[proj_name]')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.conf.broker_url = 'redis://localhost:6379/0'
app.conf.beat_schedule = {
'mailchimp_sender_package.tasks.send_new_emails': {
'task': 'mailchimp_sender_package.tasks.send_new_emails',
'schedule': crontab(minute=0),
'args': ([YOUR_LIST_ID], [YOUR_CATEGORY_ID], [YOUR_INTEREST_ID])
},
}
app.autodiscover_tasks()
5. Write your views for creating objects of model Subscriber and bind them with forms. Example::
from django.shortcuts import render
from mailchimp_sender_package.models import *
def new_subscriber(request):
data_email = request.POST.get('EMAIL')
unique_check = Subscriber.objects.filter(email=data_email)
if not len(unique_check):
Subscriber.objects.create(email=data_email)
return render(request, '[path_to_"thanks"_template].html', {})
mailchimp_sender_package
=====
Requirements:
Quick start
-----------
0. Launch setup.py::
python3 setup.py dist
0.1. Go into folder 'dist' and install 'mailchimp_sender_package-[version].tar.gz' with packages manager (pip, for example).
1. Add "mailchimp_sender_package" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'mailchimp_sender_package',
]
Also add the MAILCHIMP_API_KEY::
MAILCHIMP_API_KEY = 'YOUR API KEY'
2. Include the mailchimp_sender_package URLconf in your project urls.py like this::
url(r'^mailchimp/', include('mailchimp_sender_package.urls')),
3. Run 'python manage.py makemigrations' and 'python manage.py migrate' for your project to create the models.
4. Create into folder with settings.py, wsgi.py and etc. file 'celery.py' with this content::
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "[proj_name].settings")
app = Celery('[proj_name]')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.conf.broker_url = 'redis://localhost:6379/0'
app.conf.beat_schedule = {
'mailchimp_sender_package.tasks.send_new_emails': {
'task': 'mailchimp_sender_package.tasks.send_new_emails',
'schedule': crontab(minute=0),
'args': ([YOUR_LIST_ID], [YOUR_CATEGORY_ID], [YOUR_INTEREST_ID])
},
}
app.autodiscover_tasks()
5. Write your views for creating objects of model Subscriber and bind them with forms. Example::
from django.shortcuts import render
from mailchimp_sender_package.models import *
def new_subscriber(request):
data_email = request.POST.get('EMAIL')
unique_check = Subscriber.objects.filter(email=data_email)
if not len(unique_check):
Subscriber.objects.create(email=data_email)
return render(request, '[path_to_"thanks"_template].html', {})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mailchimpworker-0.1.tar.gz
(3.8 kB
view hashes)