Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
How to Rename a Django App
When I initially created my MVP (minimal viable product) for 1st things 1st, I considered the whole Django project to be about prioritization. After a few years, I realized that the Django project is about SaaS (software as a service), and prioritization is just a part of all functionalities necessary for a SaaS to function. I ended up needing to rename apps to have clean and better-organized code. Here is how I did that. 0. Get your code and database up to date Ensure you have the latest git pull and execute all database migrations. 1. Install django-rename-app Put django-rename-app into pip requirements and install them or just run: (venv)$ pip install django-rename-app Put the app into INSTALLED_APPS in your settings: INSTALLED_APPS = [ # … "django_rename_app", ] 2. Rename the app directories Rename the oldapp as newapp in your apps and templates. 3. Rename the app name occurrences in the code Rename the app in all your imports, relations, migrations, and template paths. You can do a global search for oldapp and then check case by case where you need to rename that term to newapp, and where not. 4. Run the management command rename_app Run the management command … -
How to Rename a Django App
When I initially created my MVP (minimal viable product) for 1st things 1st, I considered the whole Django project to be about prioritization. After a few years, I realized that the Django project is about SaaS (software as a service), and prioritization is just a part of all functionalities necessary for a SaaS to function. I ended up needing to rename apps to have clean and better-organized code. Here is how I did that. 0. Get your code and database up to date Ensure you have the latest git pull and execute all database migrations. 1. Install django-rename-app Put django-rename-app into pip requirements and install them or just run: (venv)$ pip install django-rename-app Put the app into INSTALLED_APPS in your settings: INSTALLED_APPS = [ # … "django_rename_app",] 2. Rename the app directories Rename the oldapp as newapp in your apps and templates. 3. Rename the app name occurrences in the code Rename the app in all your imports, relations, migrations, and template paths. You can do a global search for oldapp and then check case by case where you need to rename that term to newapp, and where not. 4. Run the management command rename_app Run the management command rename_app: … -
Episode 17 - Accepting Files
On this episode, we’re going to dig into file management. Unlike the static files that you create for the app yourself, you may want your app to accept files from your users. Profile pictures are a good example of user files. You’ll see how Django handles those kinds of files and how to deal with them safely. Listen at djangoriffs.com or with the player below. Last Episode On the last episode, we looked at how to manage settings on your Django site. -
Find the largest node_modules directories with bash
tl;dr; `fd -I -t d node_modules | rg -v 'node_modules/(\w|@)' | xargs du -sh | sort -hr -
Django News - Heroku Alternatives for Django Apps - Sep 30th 2022
News PyScript 2022.09.1 RC2 request for help The PyScript team is asking for help testing 2022.09.1 RC2. github.com Reminder: 2022 Django Developers Survey The survey will run until October 21st. Please take a moment to fill it out! After the survey is over, the aggregated results and anonymized raw data will be published. djangoproject.com Sponsored Ad Crunchy Bridge - Fully Managed Postgres as a Service crunchybridge.com Articles Heroku Alternatives for Python-based Applications Since Heroku is discontinuing its free tier November 28, 202 this article covers numerous Heroku alternatives and their pros and cons. testdriven.io Pytest for Beginners Not just for beginners, this article covers all the main parts of pytest, including parameterizing, fixtures, temporary files, and even monkeypatching. testdriven.io Django on K8s A 7-part series on Django and Kubernetes. dev.to Dockerize a Django, React, and Postgres application with Docker and docker-compose A relatively concise guide to Dockerizing a website with Django and React. dev.to Will Serving Real HTML Content Make A Website Faster? Let's Experiment! Some performance comparisons and stats compare rendering HTML and JS rendered websites. webpagetest.org Videos Preparing for Hacktoberfest with Phoebe Quincy Hacktoberfest kicks off on October 1st and lasts all month. Python Community News covers what … -
How to Develop Responsive HTML Email in Django
In this tutorial, I will talk about how to use Django-mjml to develop Responsive HTML Email in Django -
JavaScript FormData - Building SaaS with Python and Django #146
In this episode, we finished off one of the dynamic features of my homeschool app that required working with some JavaScript. I showed off what I learned about some of my mistakes from the previous week, and we completed the feature and tested things out. -
JavaScript FormData - Building SaaS #146
In this episode, we finished off one of the dynamic features of my homeschool app that required working with some JavaScript. I showed off what I learned about some of my mistakes from the previous week, and we completed the feature and tested things out. -
DjangoCon Europe 2022 - Kojo Idrissa
@KojoIdrissa on TwitterKojo Idrissa Kojo at RevSysNaomi Ceder PyCon US 2022 Keynote textDjangoCon US 2022 -
Spot the JavaScript bug with recursion and incrementing
Keep it simple and appreciate the difference between myvar++, ++myvar, and myvar + 1 -
Django News - 2022 Django Developers Survey and DRF 3.14 - Sep 23rd 2022
News 2022 Django Developers Survey The 2022 Django Developers Survey is now live and available in 10 different languages. Please take a moment to fill it out! djangoproject.com Django REST framework 3.14 released The latest release fully supports Django 4.1, and drops support for Django 2.2. Check out the 3.14.0 release notes for more details. django-rest-framework.org Sponsored Ad Wagtail CMS in Action Discount! Wagtail CMS in Action is a fun guide to building websites with Wagtail, a content management system based on Python and Django, brought to you by Kalob Taulien, a core member of the Wagtail development team. Here is a 30% off discount code!: nldjangonws22 mng.bz Events What’s New in Wagtail is back! Register for live demos on October 11th and 12th of Wagtail 4.0 and its many new features: redesigned page editor, enhanced accessibility, new features for snippets, global settings for multi-site installations, and more! wagtail.org Articles How I’m a Productive Programmer With a Memory of a Fruit Fly A love letter to tools that changed everything for me. hynek.me Django Rest API with Elastic Search An introduction to using DRF with Elasticsearch DSL to build a search rest api. dev.to Primer to Django and HTMx An … -
Post-interview recommendations: a case against 'maybe'
If you’re ever an interviewer on a role I’m hiring for, there’s this one thing I’m going to ask you to do that might feel weird. After you conduct that interview, I’m going to ask you to send me a recommendation, and I’m going to insist that the recommendation begins with a very clear “hire” or “no hire”. I won’t accept any form of “maybe”. -
How to calculate contrast color in Python
<![CDATA[ How to calculate contrast color in Python In my ImpressKit project, users can choose an accent color for their app press kits. While this was quite easy to implement, it posed new challenges. A bunch of UI uses the accent color as a background for text. This means I need to know if black or white contrasts better with the given color. After some experimentation, I arrived at a simple solution that uses luminance value to determine if I should use white or black foreground. I am using HEX codes for simplicity. If you have colors in other formats, you probably need to convert to HEX first or get the red, blue, and green values. Calculating luminance Let’s look at the code. Here is my method to get the luminance: def get_luminance(hex_color): color = hex_color[1:] hex_red = int(color[0:2], base=16) hex_green = int(color[2:4], base=16) hex_blue = int(color[4:6], base=16) return hex_red * 0.2126 + hex_green * 0.7152 + hex_blue * 0.0722 I am validating the input before the hex_color is passed in to ensure it is in the correct format. The magic numbers in the return statements represent how the human eye sees colors and tries to get them equal weight. … -
Customer Features - Building SaaS with Python and Django #145
In this episode, we picked up some customer features to improve the app. I knocked out the first feature pretty quickly. The second feature involved working with FormData in the DOM, which proved to have some interesting challenges. -
Customer Features - Building SaaS #145
In this episode, we picked up some customer features to improve the app. I knocked out the first feature pretty quickly. The second feature involved working with FormData in the DOM, which proved to have some interesting challenges. -
How I’m a Productive Programmer With a Memory of a Fruit Fly
A love letter to tools that changed everything for me. -
Django News - Python 3.11 Last Call Before Release - Sep 16th 2022
News Python 3.11.0rc2 This release, 3.11.0rc2, is the last preview before the final release of Python 3.11.0 on October 24th. python.org Sponsored Ad Wagtail CMS in Action Discount! Wagtail CMS in Action is a fun guide to building websites with Wagtail, a content management system based on Python and Django, brought to you by Kalob Taulien, a core member of the Wagtail development team. Here is a 30% off discount code!: nldjangonws22 mng.bz Articles Docker Tip #94: Docker Compose v2 and Profiles Are the Best Thing Ever If you have never used Docker Compose v2's profiles then you are missing out. nickjanetakis.com Working local with GitHub PRs Sage advice from Django Fellow Carlton Gibson on working with Git. noumenal.es Securing the Supply Chain of Nothing Kelly Shortridge's rebuttal to the recent guide on “Securing the Software Supply Chain” that was published by CISA, ODNI, and the NSA. Worth a read. swagitda.com Tutorials Django Favicon Guide Two different ways to add a Favicon to your Django project. accordbox.com Django Hello, World + Fly.io Deployment Step-by-step instructions to building a Django "Hello, World!" website and then deploying with Fly.io. learndjango.com Sponsored Link Django for Beginners/APIs/Professionals Level up your Django knowledge with Django … -
Django Hello, World + Fly.io Deployment
In this tutorial we will build a "Hello, World" website with Django and then deploy it to [Fly.io](https://fly.io/). If you want to learn Django properly, I provide step-by-step instructions and … -
Django News - Django 4.1.1 Bugfix Release - Sep 9th 2022
News Django 4.1.1 released Django 4.1.1 has been released. It addresses 15 different bugfixes. djangoproject.com Python 3.10.7, 3.9.14, 3.8.14, and 3.7.14 released Python releases 3.10.7, 3.9.14, 3.8.14, and 3.7.14 are now available. blogspot.com Python Packaging User Survey Please help the Python Software Foundation (PSF) better understand the challenges and opportunities within the Python packaging ecosystem, especially around PyPI. surveymonkey.co.uk Sponsored Ad Wagtail CMS in Action Discount! Wagtail CMS is a fast, elegant content management system based on Python and Django - used by Google, NASA, and MIT. Learn how to create powerful yet simple web applications with Wagtail in Action by Kalob Taulien, a core member of the Wagtail development team. Here is a 30% off discount code!: nldjangonws22 mng.bz Events Hybrid Panel: Hot Takes on CI Tools We Use at IndyPy on Sept. 13 On Tuesday, Sept. 13 from 7-9pm ET, experts from Azure DevOps, GitHub Actions, GitLab CI/CD and JFrog Pipelines will join IndyPy for a panel: “Hot Takes on CI Tools We Use.” The lively discussion, moderated by Calvin Hendryx-Parker (Six Feet Up), will feature the pros and cons of your favorite tools and, as always, awesome door prizes. Register now: https://meetingplace.io/indypy/events/9487. meetingplace.io Articles Why naïve times … -
Quality Is Systemic
Software quality is more the result of a system designed to produce quality, and not so much the result of individual performance. That is: a group of mediocre programmers working with a structure designed to produce quality will produce better software than a group of fantastic programmers working in a system designed with other goals. -
Create a large empty file for testing
`dd if=/dev/zero of=big.file count=500 bs=1024` to create a 500KB empty binary file -
Delete Task UX - Building SaaS with Python and Django #144
In this episode, I worked on an issue to improve the user experience when deleting a task. The previous version forgot the user’s position in a task delete, and we updated the view so that the user would be returned to the same portion of a task list in the course. -
Delete Task UX - Building SaaS #144
In this episode, I worked on an issue to improve the user experience when deleting a task. The previous version forgot the user’s position in a task delete, and we updated the view so that the user would be returned to the same portion of a task list in the course. -
Sign AWS CloudFront Objects with Python
How do you enable faster downl... -
But what are *args & **kwargs?
[[ youtube id="GdSJAZDsCZA" ]...