REST https://www.tag1consulting.com/term/rest en Building An API With Django 2.0: Part II https://www.tag1consulting.com/blog/building-api-django-20-part-ii <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">This is the second-part of a series. In the previous entry we used Django 2.0 to build a simple REST API for registering users and managing their logins. To satisfy requirements we managed authentication with client-side sessions, using JSON Web Tokens. In this blog we’re going to build upon what we started previously by adding two-factor authentication. We’ll learn more about what that means and how it works. We’ll leverage the Django OTP library to fully support TOTP devices, also offering emergency codes for when users lose their phones. And during this process we’ll learn much more about how JSON Web Tokens work, building a custom payload to support a second level of authentication. You can follow along and write out the code yourself, or view it online at the following URL .<div class="more-link"><a href="/blog/building-api-django-20-part-ii" class="more-link" hreflang="en">Read more</a></div></div> <span><span lang="" about="/user/jeremy-andrews" typeof="schema:Person" property="schema:name" datatype="">Jeremy</span></span> <span>Mon, 01/29/2018 - 02:59</span> Mon, 29 Jan 2018 10:59:06 +0000 Jeremy 89 at https://www.tag1consulting.com Building An API With Django 2.0: Part I https://www.tag1consulting.com/blog/building-api-django-20-part-i <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">We’ve helped build many interesting websites at Tag1. Historically, we started as a Drupal shop in 2007, heavily involved in the ongoing development of that popular PHP-based CMS . We also design and maintain the infrastructures on which many of these websites run. That said, we’ve long enjoyed applying our knowledge and skills for building sustainable and high-performing systems to different technologies as well. In this blog series, we’re going to build a backend API server for managing users on a high-traffic website using the Python-based Django framework. We’re going to assume you’re generally comfortable with Python, but new to Django. In this first blog of the series, we’ll build a simple registration and login system which can be used by a single page app, or a mobile app. Coming from a Drupal CMS background, it can initially be surprising to learn that such a simple task requires additional libraries and custom code. This is because Django is a framework, not a CMS. As you read through this first blog, you’ll gain a general understanding of how Django works, and how to add and use libraries. We’ll create a stateless REST API, using JSON Web Tokens for authentication. And we’ll tie it all together with consistent paths. You can follow along and write out the code yourself, or view it online on GitHub . Future blogs in this series will add support for two-factor authentication and unit testing, allowing us to automatically verify that all our functionality is working as designed.<div class="more-link"><a href="/blog/building-api-django-20-part-i" class="more-link" hreflang="en">Read more</a></div></div> <span><span lang="" about="/user/jeremy-andrews" typeof="schema:Person" property="schema:name" datatype="">Jeremy</span></span> <span>Mon, 01/15/2018 - 01:18</span> Mon, 15 Jan 2018 09:18:00 +0000 Jeremy 88 at https://www.tag1consulting.com