Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
What are RESTful API and how to use it?
What is an API? An API is a common terminology we've all come across in the internet world. But what is it and why is it used? In layman terms, An API(Application Programming Interface) acts as translator for two machines communicating over a web ... -
Docker & Flask - Nick Janetakis
Nick Janetakis's personal siteBuild a SAAS app with Flask courseDive into Docker courseExample Flask + Docker appExample Django + Docker appRunning in Production podcastdjango-unicorn OpenResty -
Delegate Outcomes, Not Methods
To make delegation most effective, tell people the results you want, but let them decide on how to achieve those results. -
Django-Tailwind v2.2 is out
Today I'm officially announcing the release of Django-Tailwind v2.2. It was soft-launched last week, and since I haven't got any complaints, I think I'm good to let you all know about the release. The current update adds improved support for the latest 2.2 version of the Tailwind CSS framework. … Read now -
Make Failure A (Safe) Option
Your gut instinct is probably to wait to delegate some work until you’re fully confident that the person can handle it. This is often a mistake. Instead of withholding a delegation opportunity from someone because they might fail, you should instead create a situation where failure will be safe. -
Deploy Django with Postgres, Nginx, and Gunicorn on Ubuntu 20.04
Introduction What is Django? Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so we can focus on writin... -
“Give Away Your Toys”
My foundational principle of delegation: “give away your toys”. Look to delegate the work you love, not the stuff you dislike or dread. -
Going Live
Full show notes are available at https://www.mattlayman.com/django-riffs/14. -
my workflow with django
my dev set up: os: ide : pycharm browser: googlechrome django: 3.2.. python: 3.9.. -
Episode 14 - Going Live
On this episode, we will look at what it takes to go live and how to prepare your Django project for the internet. Listen at djangoriffs.com or with the player below. Last Episode On the last episode, we discussed how you can verify that your site works and continues to work. We dug into automated testing and how to write tests for your Django apps. Pick A Python Application Server When you begin to learn Django, the documentation will instruct you to use . -
What's delegation?
Most managers know that delegation is part of their job, but the vast majority of management texts are incredibly non-specific about what delegation means. So today I’m beginning a series on delegation to try to fill this gap. I’ll cover the principles and theories that guide how I think about delegation, ending with a concrete example: how to delegate meeting attendance. To kick things off: what does delegation mean? -
Maps with Django (part 2): GeoDjango, PostGIS and Leaflet
A quickstart guide to create a web map with the Python-based web framework Django using its module GeoDjango, the PostgreSQL database with its spatial extension PostGIS and Leaflet, a JavaScript library for interactive maps. -
Know Your ORM | Where do objects come from?
Note: This is the first installment of our new series Know Your ORM. Stay tuned for more. So, you have been learning Django since a few days or weeks. You have worked with Django ORM and Django QuerySet API. And, you are totally familiar with this li... -
Managing concurrency in Django using select_for_update
A tutorial on how one can use select_for_update to lock a Django queryset until the transaction it is in is committed in order to handle concurrency. -
Django JSON Response safe=False
Hi👋 everyone, I'm happy to see my self writing blogs to you once again after a while due to some reasons. So, today; I would be sharing with you shortly, why safe=False is important in rendering {JSON} data in Django. Firstly, what is JSON? JSON si... -
My Zuri x i4G experience
Photo by Karolina Grabowska from Pexels Picture being the sub-team lead of your team and having no idea about how to go about the project. Lol!! Earlier this year, I applied for a free software developer program for absolute beginners organized by... -
Django News - New CPython Developer-in-Residence - Jul 16th 2021
News Wagtail 2.12.6 and 2.13.4 released Wagtail 2.12.6 and 2.13.4 bug fixes were released. See their changelog for more details. github.com Python Software Foundation News: Łukasz Langa is the inaugural CPython Developer-in-Residence! The PSF and the Python Steering Council are pleased to announce that the inaugural Developer-in-Residence role will be held by core develope... blogspot.com htmx 1.5.0 has been released! htmx is a popular way to add Javascript functionality to your Django site without writing any JavaScript yourself. htmx.org Events Meetup with talks | Meetup Thu, Aug 26, 2021, 5:00 PM: Do you want to share something? Then this is a great chance! Come prepared or unprepared with your Django/Python talk, short, medium and long. Got an idea? Please tell us: meetup.com Articles Python Type Hints - How to Avoid “The Boolean Trap” by Adam Johnson “The Boolean Trap” is a programming anti-pattern where a boolean argument switches behaviour, leading to confusion. In this post we’ll look at the trap in more detail, and several ways to avoid it in Python, with added safety from type hints. adamj.eu Control Runaway Postgres Queries With Statement Timeout A well tuned production Postgres database is capable of easily running thousands or up to … -
Django vs. Laravel - Ultimate Head to Head Comparison
Despite mobile development's popularity and the demand for it rising, web development has been getting a great deal of attention, and the technologies are evolving at an accelerated pace. Especially with the rise of new development concepts such as P... -
My Journey in Programming So Far ; 16months of Programming
"Computer programming is the process of writing code that instructs how a computer, application or software program performs or behave. At its most basic, computer programming is a set of instructions to facilitate specific actions. If you're wonder... -
How to use HtmlWebpackPlugin to load Webpack bundle in Django
I will show you how use HtmlWebpackPlugin to load Webpack bundle in Django without ANY Django 3-party package -
Making Sense Of Settings
In the last Understand Django article, we looked at a storage concept in Django called sessions. Sessions help us answer questions like “How does Django know when a user is logged in?” or “Where can the framework store data for a visitor on your app?” With this article, you’ll learn about Django settings and how to manage the configuration of your application. We’ll also look at tools to help you to be extra effective with settings. -
Django Implied Relationship
A little while ago, Alec McGavin put up a post on the Kogan blog about [Custom Relationships in Django](https://devblog.kogan.com/blog/custom-relationships-in-django). This is a really cool way to get a relationship in Django that exists in the database, but cannot be modelled correctly in Django. For instance, this could be data in the database that does not have a Foreign Key, either because it's legacy data, or because it's possible either side of the relationship might be added to the database before the other, rather than the normal order in a database where the target table of the FK is always added to first. However, I have another slighly different situation where an implied relationship exists, but should not be stored directly. Consider the following data structures: {% highlight python %} class Employee(models.Model): name = models.TextField() class EmploymentPeriod(models.Model): employee = models.ForeignKey( Employee, related_name='employment_periods', on_delete=models.CASCADE, ) valid_period = DateRangeField() class Meta: constraints = [ ExclusionConstraint( name='employment_overlap', expressions=[ ('employee', RangeOperators.EQUAL), ('valid_period', RangeOperators.OVERLAPS), ] ) ] class Shift(models.Model): employee = models.ForeignKey( Employee, related_name='shifts', on_delete=models.CASCADE, ) date = models.DateField() start_time = models.TimeField() duration = models.DurationField() employment_period = Relationship( EmploymentPeriod, from_fields=['employee', 'date'], to_fields=['employee', 'valid_period'], ) @property def start(self): return datetime.datetime.combine(self.date, self.start_time) @property def finish(self): return self.start + … -
Django File Uploads: How to Upload Images and Files
Today I'm going to cover how to add user document and image file uploads to your Django project as a simple HTML form and Django ModelForm. I'm using Bootstrap 5 for some basic styling. Django Media Files First configure your media upload settings before creating and uploading the form. Add Media URL to Django settings mysite > mysite > settings.py MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') Head over to the settings.py file and specify the MEDIA_URL and MEDIA_ROOT. They are not specified by default. Install Pillow Windows Command Prompt (env) C:\Users\Owner\Desktop\Code\env\mysite> pip install Pillow Also install Pillow for media upload support. Add Media URL to Django URLs mysite > mysite > urls.py from django.contrib import admin from django.urls import path, include from django.conf import settings #add this from django.conf.urls.static import static #add this urlpatterns = [ path('admin/', admin.site.urls), path('', include ('main.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) Next, go to the mysite > urls.py and add the helper function above. Keep in mind it only works when DEBUG is set to True and the URL specified in the settings is local (i.e. /media/ not https://media.site.com/). Now, when an image is uploaded in development, it is added to a … -
Developing REST API Using Django REST Framework (DRF)
Introduction This is a sample project for exploring the development of REST APIs using Django REST Framework (DRF). Setting Up Django 1. Create new Django Project To create your Django project from scratch (make sure to have Django installed): $ djan... -
Django Regx
I will write more