When we announced our partnership with Nitrous, we showed how to send email with Rails. The platform-as-a-service and web-based IDE also currently supports Python, Node.js, Go, and PHP. In this tutorial, I’ll show how to use a Python development box on Nitrous to send email using SendGrid.

Get Started with Nitrous.IO / Python

We’ll use this sample app to show how easy it is to send email. You’ll want to create a Nitrous account and follow these steps:

  1. From the Nitrous New Boxes Page, create a new box using Python/Django
  2. Launch the IDE and go to the workspace folder in the Nitrous.IO terminal console.
  3. Clone the SendGrid sample application:
    git clone https://github.com/sendgrid/sendgrid-python-django-sample-app.git
  4. Install the SendGrid Python library:
    pip install --user sendgrid==0.3.1The Python package manager will already be installed because Nitrous.IO pre-configures the boxes with software needed for each environment.
  5. In the Nitrous.IO file browser, open SGapp/settings.py and change the username/password data to be your SendGrid credentials.
  6. In the console go to “sendgrid-python-django-sample-app” folder and run the following command: ‘python manage.py runserver 0.0.0.0:8080’ to start the python server
  7. Go to ‘Preview’ menu and select ‘Port 8080’ and the sample application will be opened in your browser.
  8. Send your first email through SendGrid/Nitrous.IO by filling out the form. Now go check your email.

Your message will be there, waiting for you. This is obviously a simple example application. When you use SendGrid in your production Python apps, you’ll likely be sending social notifications, password resets and other transactional email. Use this project as a starting point or reference for sending email with SendGrid in Python on Nitrous.IO.

Getting started is simple. Sign up with a free SendGrid account and claim your free cloud dev environment in 60 seconds with a Nitrous.IO account.



SendGrid Team
Expert advice and insight about all things email including best practices tips, examples, and advice for marketers, developers, and everyone in between.