Django Project on NGINX Unit
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
2w ago
Recently, I learned about the NGINX Unit and decided to try it on my DjangoTricks website. Unit is a web server developed by people from NGINX, with pluggable support for Python (WSGI and ASGI), Ruby, Node.js, PHP, and a few other languages. I wanted to see whether it's really easy to set it up, have it locally on my Mac and the remote Ubuntu server, and try out the ASGI features of Django, allowing real-time communication. Also, I wanted to see whether Django is faster with Unit than with NGINX and Gunicorn. This article is about my findings. My observations Unit service uses HTTP requests t ..read more
Visit website
How to Rename a Django App
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
1y ago
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 ..read more
Visit website
How I Integrated Zapier into my Django Project
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
2y ago
As you might know, I have been developing, providing, and supporting the prioritization tool 1st things 1st. One of the essential features to implement was exporting calculated priorities to other productivity tools. Usually, building an export from one app to another takes 1-2 weeks for me. But this time, I decided to go a better route and use Zapier to export priorities to almost all possible apps in a similar amount of time. Whaaat!?? In this article, I will tell you how. What is Zapier and how it works? The no-code tool Zapier takes input from a wide variety of web apps and outputs it to ..read more
Visit website
Generic Functionality without Generic Relations
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
2y ago
When you have some generic functionality like anything commentable, likable, or upvotable, it’s common to use Generic Relations in Django. The problem with Generic Relations is that they create the relationships at the application level instead of the database level, and that requires a lot of database queries if you want to aggregate content that shares the generic functionality. There is another way that I will show you in this article. I learned this technique at my first job in 2002 and then rediscovered it again with Django a few years ago. The trick is to have a generic Item model where ..read more
Visit website
17 Django Project Ideas that can Make a Positive Impact around You
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
2y ago
For more than a decade, I was focused only on the technical part of website building with Django. In the process, I have built a bunch of interesting cultural websites. But I always felt that those sleepless nights were not worthy of the impact. They say, "Don’t work hard, work smart!" I agree with that phrase, and for me it's not about working less hours. For me, it's working as much as necessary, but on things that matter most. So after years of collecting facts about life, I connected the dots and came up with make-impact.org – a social donation platform, which became one of the most impor ..read more
Visit website
How to Use Semantic Versioning for Shared Django Apps
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
2y ago
When you are building websites with Django, there is no need to track their software versions. You can just have a stable branch in Git repository and update the production environment whenever it makes sense. However, when you create a Django app or package shared among various websites and maybe with multiple people, it is vital to keep track of the package versions. The Benefits Versioning allows you to identify a specific state of your package and has these benefits: Developers can be aware of which package version works with their websites together flawlessly. You can track which versio ..read more
Visit website
How to Use Semantic Versioning for Shared Django Apps
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
2y ago
When you are building websites with Django, there is no need to track their software versions. You can just have a stable branch in Git repository and update the production environment whenever it makes sense. However, when you create a Django app or package shared among various websites and maybe with multiple people, it is vital to keep track of the package versions. The Benefits Versioning allows you to identify a specific state of your package and has these benefits: Developers can be aware of which package version works with their websites together flawlessly. You can track which versio ..read more
Visit website
Guest Post: Django Crispy Forms Advanced Usage Example
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
3y ago
This is a guest post by Serhii Kushchenko, Python/Django developer and data analyst. He is skillful in SQL, Python, Django, RESTful APIs, statistics, and machine learning. This post aims to demonstrate the creation and processing of the large and complex form in Django using django-crispy-forms. The form contains several buttons that require executing different actions during the processing phase. Also, in the form, the number of rows and columns is not static but varies depending on some conditions. In our case, the set of rows and columns changes depending on the number of instances (column ..read more
Visit website
How I Tested ReactJS-based Webapp with Selenium
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
3y ago
For quite some time, I have been building a SaaS product - strategic prioritizer 1st things 1st. It's using Django in the backend and ReactJS in the frontend and communicating between those ends by REST API. Every week I try to make progress with this project, be it a more prominent feature, some content changes, or small styling tweaks. In the past week, I implemented frontend testing with Selenium, and I want to share my journey with you. What can you do with 1st things 1st 1st things 1st allows you to evaluate a list of items by multiple criteria and calculates priorities for you to follow ..read more
Visit website
How to Upload a File Using Django REST Framework
DjangoTricks
by Aidas Bendoraitis a.k.a. archatas
3y ago
When you develop a web app or a mobile app with Django, it is common to use the Django REST Framework for communication with the server-side. The client-side makes GET, POST, PUT, and DELETE requests to the REST API to read, create, update, or delete data there. The communication by Ajax is pretty uncomplicated, but how would you upload an image or another file to the server? I will show you that in this article by creating user avatar upload via REST API. Find the full code for this feature on Github. Extend Django User model We will start by installing Pillow for image handling to the virtu ..read more
Visit website

Follow DjangoTricks on FeedSpot

Continue with Google
Continue with Apple
OR