Learn coding with #freecodecamp 

Barki Mustapha IP Dev 💐🌹🌴🇲🇦

Finally we wrote a management command to handle the actual sending which called a function that looks something like this:
def save_the_date_random(request):
template_id = random.choice(SAVE_THE_DATE_CONTEXT_MAP.keys())
context = get_save_the_date_context(template_id)
context[’email_mode’] = False
return render(request, SAVE_THE_DATE_TEMPLATE, context=context)
Function to send the save the dates with some additional testing options.
After a lot of testing we were confident everything was good to go and it was time to push the big scary “send” button (or in this case run ./manage.py send_save_the_dates –send –mark-sent).
Almost immediately we started getting some fun responses from our friends talking about the save the dates and it was fun watching them get confused about describing different templates.
All in all, thanks to thorough testing and preparation it was a great success!
Though I should note that, probably not surprisingly, the whole thing took quite a bit longer than expected. And we were just getting started!
After a…

View original post 1,174 more words


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s