Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Deploying Vault and Consul
This tutorial shows how to deploy Vault and Consul with Docker Swarm. -
Preventing SQL Injection in Django
I wrote this article for r2c, a security startup I’ve been consulting for. They’ve been building Bento, a program analysis toolkit that can find bug through static anaylsys of Python code. It uses semgrep, a code search tool that understands Python syntax. I’ve been helping them figure out which kinds of checks matter to Django developers. SQL injection is one of the places we decided to start, and I wrote this article to explain the problem, solutions, and how Bento/semgrep can help. -
Django News - New framework/language edition! - May 15th 2020
News Django 3.1 alpha 1 released Django 3.1's release is two months away, but you can start testing against it today. djangoproject.com Wagtail 2.9 Wagtail 2.9 brings some key improvements to the developer experience, fixing long-standing bugbears. wagtail.io Python 3.8.3 is now available blogspot.com Django Google Summer of Code Students 2020 Django is again participating in Google's Summer of Code. djangoproject.com Articles A Guide to ASGI in Django 3.0 and its Performance A thorough overview of ASGI in Django. arunrocks.com Thoughts on where tools fit into a workflow Brett Cannon on tooling. snarky.ca Using FastAPI with Django An overview of combining Django and FastAPI. stavros.io Preventing SQL injection: a Django author's perspective Django co-creator Jacob Kaplan-Moss on the risks of SQL injection. r2c.dev How to Check the Running Django Command It’s occasionally useful to be able to tell which Django manage.py command is being run, in a code path that otherwise has no way of telling. adamj.eu Sponsored Link Two Scoops of Django 3.x: Best Practices for the Django Web Framework The long-awaited update covers various tips, tricks, patterns, code snippets, and techniques of Django best practices. feldroy.com Videos PyCon 2020 Talk: Static Typing in Python by Dustin Ingram The … -
How To Fix A Bug - Building SaaS #56
In this episode, we picked an issue from GitHub and worked on it. I explained the flow of using test driven development to show how the bug existed in an automated test. We wrote the test, then fixed the code. After that, we did some test refactoring to clean things up. We looked at what the issue was and how it is related to the handling of the Course model in a weekly view in the app. -
How to Check the Running Django Command
It’s occasionally useful to be able to tell which Django manage.py command is being run, in a code path that otherwise has no way of telling. For example, in Speed Up Your Django Tests, I describe how to modify manage.py to default use a test settings file when the test command is run. The way to do this is to copy some of the parsing logic from inside Django, in ManagementUtility.execute(). This looks like: import sys try: command = sys.argv[1] except IndexError: command = "help" if command == "test": # Something specific to running "test" ... Whilst sometimes useful to change a default or add some instrumentation, I’d use this pattern with caution. Such changes will be hard to debug since they’re “at a distance.” It’s normally possible to instead override another part of the given command. In particular, you can write a custom management command that imports and wraps the built-in one, as I showed in Make Django Tests Always Rebuild the Database if It Exists. Warning: Incorrect sys.argv Checks I’ve seen several a few community resources suggesting a similar pattern. However, rather than checking sys.argv[1] they check it with the in operator: import sys if "test" in sys.argv: … -
Debugging a Containerized Django App in PyCharm
In this quick tutorial, we'll show you how to configure PyCharm for debugging a Django app running inside of Docker. -
Roll Your Own Tech Job - Erin Mullaney
Weekly Django Chat NewsletterErin Rachel ConsultingDjangoCon US 2019 - Roll Your Own Tech JobResources for Roll Your Own Tech JobA Quick Guide to Generating Fake Data with PandasMore of Erin's writing for the Caktus Group blogDjango ForumChooseFI podcast episode with Alan DoneganAll Up in Ya Business YouTube episode on how to operate your business (LLC, DBA, etc)SHAMELESS PLUGSLearnDjango - Free tutorials and premium books -
How I manage multiple development environments in my Django workflow using Docker compose
Hi everyone! Last week I was searching how to manage multiple development environments with the same docker-compose configuration for my Django workflow. I needed to manage a development and a production environment, so this is what I did. Some descriptions on my data: I had around 20 env vars, but some of them where shared among environments. I wanted to do it with as little impact as possible. First, docker-compose help command The first thing I did was run a simple docker-compose --help, and it returned this: Define and run multi-container applications with Docker. Usage: docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...] docker-compose -h|--help Options: -f, --file FILE Specify an alternate compose file (default: docker-compose.yml) # more not necessary stuff --env-file PATH Specify an alternate environment file I went with the -f flag, because I also wanted to run some docker images for development. By using the -f flag I could create a base compose file with the shared env vars (docker-compose.yml) and another one for each of the environments (prod.yml and dev.yml) So I went to town. I kept the shared variables inside docker-compose.yml and added the specific variables and configuration to prod.yml and dev.yml docker-compose.yml: version: "3" services: app: … -
Two Scoops of Django 3.x Released
We just released the early release (alpha) of the fifth edition of our book, titled Two Scoops of Django 3.x. The 3.x means we are supporting Django 3.0, 3.1, and 3.2 Long Term Support (LTS) releases, ensuring the content will be valid until April of 2024. So long as it is May 11, 2020, anywhere on planet Earth, the e-book version sells for just US$42.95! On May 12th, 2020, the price goes up to $49.95. Hurry up and get your book! For now, the e-book is just in PDF format and will be expanded to epub and mobi formats in the days to come. Readers of this alpha version get all the updates and have the opportunity to help us shape the direction of the book through their feedback, and to be credited as contributors. If you bought the 1.11 e-book in 2020 you'll receive an email on May 11th with a discount code covering the cost of the new edition. The book will also be printed, but for several reasons that won't happen until hopefully August of this year. When we get closer to that date we'll take pre-orders and send everyone who ordered an e-book a big discount … -
Two Scoops of Django 3.x Released
We just released the early release (alpha) of the fifth edition of our book, titled Two Scoops of Django 3.x. The 3.x means we are supporting Django 3.0, 3.1, and 3.2 Long Term Support (LTS) releases, ensuring the content will be valid until April of 2024. So long as it is May 11, 2020, anywhere on planet Earth, the e-book version sells for just US$42.95! On May 12th, 2020, the price goes up to $49.95. Hurry up and get your book! For now, the e-book is just in PDF format and will be expanded to epub and mobi formats in the days to come. Readers of this alpha version get all the updates and have the opportunity to help us shape the direction of the book through their feedback, and to be credited as contributors. If you bought the 1.11 e-book in 2020 you'll receive an email on May 11th with a discount code covering the cost of the new edition. The book will also be printed, but for several reasons that won't happen until hopefully August of this year. When we get closer to that date we'll take pre-orders and send everyone who ordered an e-book a big discount … -
How To Use Forms
Full show notes are available at https://www.mattlayman.com/django-riffs/5. -
Two Scoops of Django3.x Released!
We just released the early release (alpha) of the fifth edition of our book, titled Two Scoops of Django 3.x. The 3.x means we are supporting Django 3.0, 3.1, and 3.2 Long Term Support (LTS) releases, ensuring the content will be valid until April of 2024. So long as it is May 11, 2020 anywhere on planet Earth, the e-book version sells for just US$42.95! On May 12th, 2020, the price goes up to $49.95. Hurry up and get your book! For now, the e-book is just in PDF format and will be expanded to epub and mobi formats in the days to come. Readers of this alpha version get all the updates and have the opportunity to help us shape the direction of the book through their feedback, and to be credited as contributors. If you bought the 1.11 e-book in 2020 you'll receive an email on May 11th with a discount code covering the cost of the new edition. The book will also be printed, but for several reasons that won't happen until hopefully August of this year. When we get closer to that date we'll take pre-orders and send everyone who ordered an e-book a big discount … -
Episode 5 - How To Use Forms
On this episode, we will learn about HTML forms and Django’s form system to use when collecting input from users. Listen at djangoriffs.com. Last Episode On the previous episode, we looked at templates, the primary tool that Django provides to build user interfaces in your Django app. Web Forms 101 HTML can describe the type of data that you may want your users to send to your site. Collecting this data is done with a handful of tags. -
Optymalizacja ORM w Django
Optymalizacja ORM w Django. Kiedy stosować ORM, a kiedy to strata czasu? Zobacz, że w ORM można pisać aplikacje równie szybkie co w czystym SQL. -
What accomplishments sound like on software engineering resumes
Effective resumes need to contain two things: responsibilities and accomplishments. The first tells the read what your job was; the second, what your results were. Unfortunately, most people fail at the second part. I’ve seen thousands — maybe tens of thousands — of resumes, and most don’t contain accomplishments. This makes it difficult for a hiring manager to get excited about your resume: knowing what you were supposed to do doesn’t tell a reader how well you did that thing. -
Django News - Test all the things! - May 8th 2020
News Django 3.0.6: bugfix release If you need help upgrading properly, see the official guide. djangoproject.com New book - Speed Up Your Django Tests From Adam Johnson, a member of the Django Technical Board, comes a new book on improving the speed and performance of your Django tests. adamj.eu PSF News: Python Developers Survey 2019 Results Check out the results of the third official Python Developers Survey which includes more than 24,000 Python users from over 150 countries. blogspot.com PSF News: Python’s migration to GitHub - Request for Project Manager Resumes If you have both Project Manager skills and experience with GitHub, the PSF is looking to hire a Project Manager to assist with CPython’s migration from http://bugs.python.org to GitHub for issue tracking. blogspot.com Articles Why You Should Document Your Tests A good reminder that tests should be documented just like any other piece of code. hynek.me Working with request.data in Django REST framework Go beyond generic Django Rest Framework generic views to edit request.data itself. valentinog.com User Interaction With Forms A focus on using web forms the Django way. mattlayman.com Adding Debug Support to Django with Docker and VS Code Emily Morehouse walks us through setting up a debug … -
Django on a production server
Is your Django project ready for production? Follow this guides to bring your Django project on a production server! There are many good tutorials out there for learning Django and developing projects locally. But I think that simple tutorials for production deployment is somewhat lacking. In this guide I’ll try to fill this gap a little bit. 😉 In the last months I wrote some tutorials that will show you how to bring your Django project on production. Here is a summary of each tutorial. 1. Django – NGINX: deploy your Django project on a production server This tutorial will give you the basics on deployment using the NGINX webserver and uWSGI application server. Django – NGINX: deploy your Django project on a production server Django - NGINX is a popular and well tested combination used to deploy web applications in production. In this post ...Read More 2. How to deploy a Django project in 15 minutes with Ansible This tutorial will make a step further and will show you how to leverage the power of Ansible to automate all the steps needed for a production deployment. How to deploy a Django project in 15 minutes with Ansible In this … -
Django on a production server
Is your Django project ready for production? Follow these guides to bring your Django project on a production server! There are many good tutorials out there for learning Django and developing projects locally. But I think that simple tutorials for production deployment is somewhat lacking. In this guide I'll try to fill this gap a little bit. 😉 In the last months I wrote some tutorials that will show you how to bring your Django project on production. Here is a summary of each tutorial. 1. Django NGINX: deploy your Django project on a production server This tutorial will give you the basics on deployment using the NGINX webserver and uWSGI application server. Django NGINX: deploy your Django project on a production server Read more... 2. How to deploy a Django project in 15 minutes with Ansible This tutorial will make a step further and will show you how to leverage the power of Ansible to automate all the steps needed for a production deployment. How to deploy a Django project in 15 minutes with Ansible Read more... 3. Bitbucket Pipelines and Ansible: Continuous delivery for your Django project If you are using Bitbucket you can automate the deployment when … -
Remodeling Data Relationships - Building SaaS #55
In this episode, we’re remodeling! I changed the model relationship between GradeLevel and Course from a ForeignKey (1 to many) to a ManyToManyField. We talked through the change and started fixing all the tests that broke. After explaining the change that I wanted to make and why I want to make it, I explained how a foreign key and many to many relationship at the database level. Once we had the conceptual foundation in place, I started with the documentation. -
Django Security - Markus Holtermann
Weekly Django Chat NewsletterMarkus Holtermann personal siteDjango TeamsDEP 0010: New governance for the Django projectA Month in the Life of a DSF Board MemberDjango Announce Google GroupDjangoCICrateIO - Database for IoT ScaleDjangoCon Europe 2018 - On the Look-Out For Your DataLogging RethoughtBeeWareDep 8: Gathering Django usage analyticsSHAMELESS PLUGSLearnDjango - Free tutorials and premium books -
How to setup Celery with Django
In this Django Celery tutorial, I will talk about how to setup Celery with Django and some basic concepts which can help you better understand Celery. -
How to setup Celery with Django
In this Django Celery tutorial, I will talk about how to setup Celery with Django and some basic concepts which can help you better understand Celery. -
How to Move a Django Model to Another App
In my latest article for RealPython I share three ways to tackle one of the most challenging tasks involving Django migrations: moving a model from one Django app to another. The article covers some exotic migration operations and many of the built-in migration CLI commands such sqlmigrate, showmigrations and sqlsequencereset. In the article I also demonstrate important migrations concepts such as reversible migrations, migration plans and introspection. Read "How to Move a Django Model to Another App" on RealPython ≫ How to Move a Django Model to Another App -
Variations on the death of Python 2
On April 20th, 2020, a release manager named Benjamin Peterson smashed the “publish” button on Python 2.7.18. The Python 2 release series had already reached the end of its upstream support from the Python core team at the start of the year. I don’t know for certain, but I assumed the timing of the actual final package was meant to occur during PyCon (which, until a global pandemic struck, was scheduled for mid-April), possibly so … Read full entry -
User Interaction With Forms
In the previous Understand Django article, we saw how Django templates work to produce a user interface. That’s fine if you only need need to display a user interface, but what do you do if you need your site to interact with users? You use Django’s form system! In this article, we’ll focus on how to work with web forms using the Django form system. Web Forms 101 Before we can dive into how Django handles forms, we need to have an understanding of HTML forms in general.