Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Prevent Unintended Data Modification With django-read-only
Last week I released a new Django package, django-read-only. It provides a read-only mode for Django’s database layer. This can be useful to reduce the risk of giving developers access to your production instances. Access to manage.py shell on production allows you to iterate faster when creating new features, migrations, and backfills. But with great power comes great accident potential. It’s all too easy to mix up terminal sessions and run the wrong thing on production. Even if the individual chance of making such a mistake is small, multiplying it by team size and time, the chance of a mistake can become almost certain, and the potential cost can be huge. Rather than locking your team members out of production, you can protect against these mistakes with django-read-only. The package uses some always-installed database instrumentation to block database access when its read-only mode is active. You can then enable read-only mode for interactive production sessions via an environment variable or setting, so when developers access production writes are disabled by default. Read-only mode can be disabled, so the occasional manual data fix is still possible. For example, if the environment variable was set, we couldn’t log into the shell and … -
Python 3.9: What's New
This article looks at the new features in Python 3.9 and how they can be implemented. -
Django News - Django Technical Board Results and Python 3.9 released - Oct 9th 2020
News Django Technical Board Election Results 2020 The winners of the first Django Technical Board Election after the adoption of DEP-10 are: Andrew Godwin Adam Johnson Markus Holtermann Tom Forbes James Bennett djangoproject.com Python Release Python 3.9.0 Python 3.9.0 is the newest major release of the Python programming language, and it contains many new features and optimizations. python.org Wagtail Telepath - the next evolution of StreamField Adding the missing link to provide richer client-side behaviour in StreamField and beyond. wagtail.io Events PyTennessee 2021 CFP closes on October 13 PyTennessee is a yearly regional Python conference in Nashville, TN. The conference was started in 2014 by Jason Myers and Will Golden, and has been a staple of the conference calendar every year since. PyTennessee 2021 will be our 8th year, and our first year doing a purely virtual conference! papercall.io Articles Django Stripe Subscriptions Use Stripe Checkout to add subscriptions to a Django project. testdriven.io Django Slug + ID URLs: Copying Dev.to's URL pattern to Copying the dev.to URL design of a username, slug, and hashed value in Django. dev.to A Django project blueprint to help you learn by doing A description of a Django project for beginners, which you can … -
Use Django in Jupyter
Below is a simple method to us... -
Make A Landing Page - Building SaaS #75
In this episode, I added a landing page design to the app that I’m building. By using a Tailwind CSS landing page template, I could fit the design in with my existing CSS tools. I showed some available templates that I discovered while researching for Tailwind-based landing pages. Once I found a decent template, I copied the source of sample landing page into my index page template. Since I copy and pasted from the landing page, the initial look was terrible. -
Testing Flask Applications with Pytest
This articles serves as a guide to testing Flask applications with pytest. -
Django Bootcamp - October 2020
Learn Django little by little ... -
Teaching the last Two Scoops of Django Live Class
We're offering our last live, online class of Two Scoops of Django Live. This is a fully interactive class conducted via Zoom conferencing software. Daniel Feldroy is going to dive deep into Django and Python. He's going to turn on the firehose of knowledge, so come prepared to learn. As this is a live class, attendees are encouraged to ask questions. Material covered includes everything from code architecture to model design to API development to bottleneck analysis to user accessibility and much more. This is not a beginner tutorial, it is meant for developers who have begun to create real projects with Django. Details: The course starts at 9 AM PST (4 PM UTC) and ends seven (7) hours later There will be an hour long break for lunch and short breaks every hour. This event is live and won't be recorded. We won't teach a public version of this class again. Class prerequisites: Knowledge of the Python programming language. Django experience beyond basic tutorials. A device capable of running the Zoom meeting software. Internet fast enough to join online meetings. Use code "THREESCOOPS" during checkout to get $100 off. This code expires at Midnight, October 7th, Pacific Time. SIGN … -
Hijack To Help Customers
You have an upset customer with a really thorny problem on your Django-powered website. Your customer used your help ticket system and reported their woe. You’ve done your due diligence and have already checked: The logs from your site show nothing interesting related to the customer’s actions The error tracking system reveals no exceptions from what the customer did The customer’s description doesn’t contain enough info to diagnose the problem fully The experiments in your dev environment have not worked to replicate the problem What can you do? -
Django Stripe Subscriptions
This tutorial looks at how to handle subscription payments with Django and Stripe. -
Migrate Away from cmsplugin-filer in a Few Easy Steps
Companion code for this post: https://github.com/ImaginaryLandscape/deprecate_cmsplugin_filer If you've been building projects using django CMS for any length of time, chances are you're familiar with Divio's cmsplugin-filer application which provided image, link, file, folder and video plugins for interacting with django-filer. And if you're here, chances are you're aware that cmsplugin-filer has now been deprecated in favor of their standalone djangocms-[picture/file/link/video] plugins. Unfortunately, for a production project that already has hundreds of these cmsplugin-filer objects, simply switching to the newer packages is no simple task. You really only have a couple options — switching over to a fork with the hopes that it will continue to be supported as future Django versions are released, or setting about to migrate all of your existing plugins. Here we'll walk you through the latter. Let's start with a word of caution. This remains experimental code. Taking these steps will make irreversible changes to your database objects. It's highly recommended you run this on a development version of your project before modifying production data to identify any issues that may arise. At the least, make a backup of your database to allow restoring if needed. In searching for an existing solution to this problem, you may have … -
A Django project blueprint to help you learn by doing
There's an awkward point when you're learning Django where you've done the official tutorial and maybe built a simple project, like a to-do list, and now you want to try something a little more advanced. People say that you should "learn by building things", which is good advice, but it … -
Django Crash Course Live!
This is your last chance to sign up for our class on October 2-4, 2020! Sign up at: Django Crash Course Live This is your chance to learn and interact live with Daniel and Fabio, two experienced Django developers! -
Deploying Django > 3.1 (async) with Uvicorn and Nginx
Django async Django 3.1 shipped with async views. This means we can start using async/await in Django views: async def index(request): res = await do_stuff_async() # return your view To reap all the benefits of this feature, you have to run Django under an ASGI server like Daphne, Uvicorn, or Hypercorn. In this guide I use Uvicorn. The setup The stack uses battle-tested components: PostgreSQL Nginx Uvicorn with Gunicorn Django async The setup Install and configure Postgres Install and configure Git, install Python Install Nginx Configure Nginx Install Certbot and configure SSL Preparing the environment for deploy Split settings Testing Django with Uvicorn Making Uvicorn persistent Static files, settings, and migrations Infinite redirects and SECURE_SSL_REDIRECT Automate all the things! Resources Install and configure Postgres First off, head over PostgreSQL Downloads and configure the appropriate repo for your operating system. Next up, install Postgres, start the service, and enable it at boot. Also, create a role and a database. Install and configure Git, install Python On the target production server install Git and Python > 3.6. Git is needed later for cloning and pulling the Python code. Install Nginx Head over the Nginx documentation and configure the appropriate repo for your … -
Django News - PyGotham TV, Django T-Shirts, and Many New Releases - Oct 1st 2020
News New DjangoCon t-shirts Beautiful new t-shirt designs representing DjangoCon US, Europe, Australia, and Africa have been added to the store! threadless.com Django 3.1.2 bugfix release A new bugfix package is available. djangoproject.com Django REST Framework 3.12 release The 3.12 release brings a handful of refinements to the OpenAPI schema generation, plus support for Django's new database-agnostic JSONField, and some improvements to the SearchFilter class. django-rest-framework.org Wagtail 2.10.2 release New updates to the popular Django CMS. github.com pytest 6.1.0 released A new version of the very popular Python testing package is out. pytest.org django-filter 2.4.0 released A security update to 2.4.0. Upgrading highly recommended. pypi.org Celery v5.0.0 Released Version 5.0.0 of Celery, a very popular distributed task queue. github.com Events PyGotham TV PyGotham TV is this Friday, Oct. 2 & Saturday, Oct. 3, and tickets are FREE. pygotham.tv Python Web Conf 2021 CFP Python Web Conference is a fully virtual, 3 day, 3 track conference you can join from the comfort of your home office. Their CFP just opened up. papercall.io Articles Understanding Django - Anatomy of an Application The 8th in a series from Matt Layman, this one focusing on understanding Django apps. mattlayman.com Deep dive: Django Q and … -
Check Web App Security With Bandit - Building SaaS #74
In this episode, I integrated the bandit static analysis tool to do automated security checking of my code before each commit. We talked about pre-commit and how to add in a new hook. After finishing that tool addition, we got deep into Django while removing some messages inserted by django-allauth on sign up. We began by talking about what the bandit tool does and how it works. Once I explained bandit, I focused on the bandit documentation to see how to add the tool. -
Teaching Python - Michael Kennedy
TalkPython.fmHow to Make a CNC Table Saw by Jeremy Fielding40% off all Talk Python Manning courses with the promo: poddjango20Manning | Talk Python: Python for Absolute BeginnersManning | Talk Python: MongoDB for DevelopersManning | Talk Python: Async Techniques and ExamplesManning | Talk Python: Building Data-Driven Web Apps with Flask and SQLAlchemySupport the ShowOur podcast does not have a sponsor and is a labor of love. To support the show, please consider purchasing one of the books on LearnDjango.com or suggest one to a friend. -
How to Contribute to Django Docs
Makes updates to Django's official docs. -
Python, Django top frameworks and it's comparison
Python is a general-purpose programming language. We can use python for so many applications including web applications. Framework is a collection of modules or packages, which helps in writing a web application or helps in developing a web application. We don't have to worry about low level details such as protocols, socket, thread management when working with a framework. Framework makes the developer’s life smarter and easier by giving a structure for application development. They automate the implementation of common solutions, which gives flexibility to developers to focus only on app logic instead of routine. They provide common backend fast reliable and scalable easily maintainable web applications. Frameworks provides functionality to perform the following operations for developing web applications. URL Routing. Input form handling and validation. Output Formats with Templating Engine HTML, XML, JSON. Data Connection, manipulating using ORM mappers. Web security. Session Storage and retrieval. URL Routing Mechanism of URL mapping is staying at the same web page when you click on some other link. Input Form handling and Validation The data entered into a form needs to be in the right format, and certain fields are mandatory for effective use of form. Output Formats with Templating Engine Allows … -
Database Design Tutorial for Beginners
Databases are at the heart of every web application. Their design, or schema, is literally the blueprint for how all information is stored, updated, and accessed. However learning about databases … -
Why should you use Django for Web Development
Django is a highly powerful framework for building small and large scale web applications. Being a Python-based framework, Django for web development is the preferred choice of companies all over the world. If you are looking for proof of Django’s popularity, here it is – Django framework for web development is used by YouTube, Dropbox, […] The post Why should you use Django for Web Development appeared first on BoTree Technologies. -
Django News - Django Day Copenhagen 2020 - Sep 24th 2020
News Python 3.8.6 is now available Python 3.8.6 is a maintenance release. Check out the What's New In Python 3.8 document for more information about features. blogspot.com Django CMS 3.8.0 RC1 released The first Django CMS release under a newly founded Django CMS Association. This release focuses on Django 3.1 support. django-cms.org Events Django Day Copenhagen 2020 Djangonauts from in and around Denmark are meeting up for the second edition of Django Day, to be held on September 25th 2020. It will be a full day of talks, either to be experienced online -or- at our venue with safe social distancing. djangoday.dk Articles Django Best Practices: Security Django security best practices starting with the most important and working down the list. learndjango.com Docker Github Actions V2 Docker released V2 of their Docker Github Actions which adds some much better build and caching options. docker.com Django and its default values A dive into how Django's migration system handles default values on model fields. medium.com What is the Value of Browser Diversity? A thoughtful take on what's lost if one/two browsers dominate. daverupert.com feincms may still be relevant Thoughts on the Django CMS landscape from the creator of feincms. 406.ch Using sorl-thumbnail … -
How to use both camelCase and snake_case in frontend and backend
Python uses snake_case variable naming while JavaScript favours camelCase. When you're buiding an web API with Django then you'll be using both langauges together. How do you keep your styles consistent? You could just use one style for both your frontend and backend, but it looks ugly. Perhaps this is … -
Dynamically Regrouping QuerySets In Templates - Building SaaS #73
In this episode, we worked on a new view to display course resources. While building out the template, I used some template tags to dynamically regroup a queryset into a more useful data format for rendering. I started a new view before the stream to display content, but I had not filled it in before the stream started. We added new data to the context, and did some adjustments to the URL based on the required inputs for the view. -
Deep Dive into Flask's Application and Request Contexts
This post explores how the Application and Request contexts work in Flask.