Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Classy Django REST Framework Release
Release of Classy Django REST Framework -
10 Django apps you're not using but should be
Description of 10 essential apps every Django developer should be using in their projects -
Uploading files from the frontend to Amazon S3
How to upload files from the frontend straight to S3 without sending to the server using django -
3 Django apps for sending great e-mails
3 Django apps for debugging and sending HTML styled e-mails -
Controlling access: a Django permission apps comparison
There are many ways to handle permissions in a project. This post highlights the main differences and approaches taken by some popular Django third party apps to handle permissions. -
Database concurrency in Django the right way
When developing applications which have real-time requirements or other specific needs for running asynchronous tasks outside the web application, it is common to adopt a task queue such as Celery. This allows, for example, for the server to handle a request, start an asynchronous task responsible of doing some heavyweight processing, and return an answer while the task is still running. Here, we are considering a similar scenario: a request is made, and the server has to do some processing on the request. Ideally, we want to separate the high time-demanding parts from the view processing flow, so we run those parts in a separate task. Now, let's suppose we have to do some database operations both in the view and the task when the request happens. If not done carefully, those operations can be a source for issues that can be hard to track. -
Metaprogramming and Django - Using Decorators
While programming is about, in some way, doing code to transform data, metaprogramming can be seen as the task of doing code to change code. This category is often used to help programmers to enhance the readability and maintainability of the code, help with separation of concerns and respect one of the most important principles of software develop -
Django and React Boilerplate as an Asset in Software Development
Here at Vinta we believe that programmers, not processes, nor code, are the most important assets on software engineering. Due to that, we believe in using every tool available in order to facilitate our programmers' lives. One of our favorites is our boilerplate. If you are unfamiliar with the concept, a boilerplate is "any code block that is reus -
How I test my DRF serializers
How I test my DRF serializers In this blog post, I will show the whats and whys on testing Django REST Framework serializers. First, some context. Here is the model setup we are going to use for this example: from django.db import models class Bike(models.Model): COLOR_OPTIONS = (('yellow', 'Yellow'), ('red', 'Red&# -
Don't forget the stamps: testing email content in Django
When developing a web app how often do you check the emails you send are all working properly? Not as often as your web pages, right? That's ok, don't feel guilty, emails are hard to test and they are often someone's else responsibility to write and take care. This doesn't mean we should give up on them. There are some things we can do to prevent e -
Contributing to Django Framework is easier than you think
For those who are starting to code and wish to make open source, sometimes it is hard to start. The idea of contributing with that fancy and wonderful lib that you love can sound a little bit scary. Lucky for us many of those libs have room for whoever is willing to start. They also give us the support that we need. Pretty sweet, right? Do you know -
Advanced Django querying: sorting events by date
Imagine the situation where our application has events (scheduled tasks, appointments, python conferences across the world) happening in different moments of time. Almost anything with a date attached to it. We want to display them in a simple list to the user. Given we are in February 2017 (the date this post was written), what would be the best w -
DjangoCon Europe 2017 was awesome!
DjangoCon Europe happened in one of the most historical cities in Italy! Florence was the most exciting place to be around in Europe, if you are a Django enthusiast, from April 3rd to April 7th. The event had the presence of some important names on it, like Andrew Godwin and Marc Tamlyn, both core developers at Django, and Tom Christie, author of t -
[pt-BR] Organizando o Django Girls Recife
No Brasil, as mulheres são maioria nas escolas e universidades e representam 60% das pessoas que concluíram cursos superiores. Apesar disso, em cursos de exatas, representam apenas 20% do quantitativo. Esse cenário se repete não só no Brasil, mas em todo o mundo. Nas áreas tecnológicas não é diferente. TI é, ainda, um mundo majoritariamente masculino. Foi com o intuito de diversificar esse contexto que o Django Girls foi criado. -
Organizing Django Girls Recife
In Brazil, women are the majority in schools and universities and represent 60% of the people who have a university degree. Despite this, in STEM, they represent only 20% of the quantitative. This scenario is present not only in Brazil but all over the world. In technological areas, it’s no different. IT is still a mostly male world. It was with the intention of diversifying this context that the Django Girls was created. -
Going to Technical Events is Awesome: A DjangoCon Experience
We just got back from DjangoCon US! It was quite a marathon for us because Filipe Ximenes and I have been to PyBay and DjangoCon AU too, right before DjangoCon US. Besides having a great time presenting our talks, it was awesome to meet new people and reunite with old friends. From our blog, you’d guess that we really enjoy conferences. We do incentivize collaborators to attend them since we believe it's very important to keep in touch with the community. -
Multitenancy: juggling customer data in Django
Suppose you want to build a new SaaS (Software as a Service) application. Suppose your application will store sensitive data from your customers. What is the best way to guarantee the isolation of the data and make sure information from one client does not leak to the other? The answer to that is: it depends. It depends on the number of customers y -
Django REST Framework Read & Write Serializers
Django REST Framework (DRF) is a terrific tool for creating very flexible REST APIs. It has a lot of built-in features like pagination, search, filters, throttling, and many other things developers usually don't like to worry about. And it also lets you easily customize everything so you can make your API work the way you want. There are many gene -
Taming Irreversibility with Feature Flags (in Python)
Feature Flags are a very simple technique to make features of your application quickly toggleable. The way it works is, everytime we change some behavior in our software, a logical branch is created and this new behavior is only accessible if some specific configuration variable is set or, in certain cases, if the application context respects some -
Reactify Django
# Reactify Django is coming. ... -
Django development with Docker — Testing, Continuous Integration and Docker Hub
At the end of my last post about Django development with Docker, we saw how to improve our development environment by implementing these features:Accessing our database from outside the containerInstalling different requirements for each environmentUsing different settings for each environmentEnabling server reloading on code changesBut we did not execute or write any test, even more we are not using any kind of Continuous Integration. Let’s see how to implement these features.IntroductionDuring this post, we will address the following points:How can we configure and run our tests inside a Docker container?How can we integrate our application with a Continuous Integration (C.I.) server and implement Continuous Delivery?Is it possible to Upload our images to Docker Hub from our C.I. server?While we configure travis ci as our Continuous Integration server, we will run our tests and upload a new image to Docker Hub.Note: This post will not go deep in travis and docker hub explications, the main focus is in using them for our intentions.Writing & Running testsFirst, enumerate what we need to accomplish in this section:Install a test framework and configure it.Configure an in-memory database for themWrite some tests for our applicationRun our tests in a containerWe’re going to use pytest, a … -
Ansible provision/deploy setup
I never got around to write down the ansible setup I figured out (together with others, of course, at my previous job) for deploying/provisioning django websites. The whole setup (as a cookiecutter template) can be found in https://github.com/reinout/cookiecutter-djangosite-template . The relevant code is in the ansible/ directory. Note: this is a "cookiecutter template" from which you can generate a project so you'll see some {{ }} and {% %}: when you create the actual project these items will be filled in. My goal was to keep the setup simple and safe. With "safe", I mean that you normally cannot accidentally do something wrong. And it was intended for getting one website project onto the server(s). It is not a huge ansible setup to set up the whole infra in one fell swoop. First the inventory files: Yes, multiple: there are two of them. production_inventory and staging_inventory. The safe aspect is that we used to have a single inventory file with [production] and [staging] headings in it. If you wanted to update staging, you had to add --limit staging on the command line. If you forgot that... With two separate files, you never have this problem. Accidents are much less likely … -
GeoDjango and PostgreSQL
I recently had to set up GeoDjango on a site that used PostgreSQL as a database. As the online instructions for doing this were less than totally clear, I decided to write down how I did it. -
Best React Books 2018
List of current React/JavaScript books. -
Django Local 404 Page
Learn how to display and customize a 404 page locally.