Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Tips for Testing Django Views
Views are probably the most essential part of a Django application. They provide an interface to your application for users or other external applications. It only makes sense that these need to be well-tested. At first, it can seem difficult and/or tedious to write unit tests for them. However, by decoupling your business logic from … Continue reading Tips for Testing Django Views The post Tips for Testing Django Views appeared first on concise coder. -
De-Google my life - Part 1 of ¯ (ツ)_/¯: Why? How?
Hi everyone! I’m here with my first project of the year. It is almost done, but I think it is time to start documenting everything. One day I was hanging out with my girlfriend looking for trips to japan online and found myself bombarded by ads that were disturbingly specific. We realized at the moment that Google knows A LOT of us, and we were not happy about that. With my tech knowledge, I knew that there were a lot of alternatives to Google, but first I needed to answer a bigger question: Why? I told my techie friends about the craziness I was trying to accomplish and they all answered in unison: Why? So I came up with the following list: Privacy. The internet is a scary place if you don’t know what you are doing. I don’t like big corporations knowing everything about me just to sell ads or use my data for whatever they want. I have learned that if something is free it’s because you are the product EXCEPT in opensource (thanks to /u/SnowKissedBerries for that clarification. Security. I live in a very controlled country (Venezuela). Over here, almost every government agency is looking at you, … -
De-Google my life - Part 1 of ¯ (ツ)_/¯: Why? How?
Hi everyone! I’m here with my first project of the year. It is almost done, but I think it is time to start documenting everything. One day I was hanging out with my girlfriend looking for trips to japan online and found myself bombarded by ads that were disturbingly specific. We realized at the moment that Google knows A LOT of us, and we were not happy about that. With my tech knowledge, I knew that there were a lot of alternatives to Google, but first I needed to answer a bigger question: Why? I told my techie friends about the craziness I was trying to accomplish and they all answered in unison: Why? So I came up with the following list: Privacy. The internet is a scary place if you don’t know what you are doing. I don’t like big corporations knowing everything about me just to sell ads or use my data for whatever they want. I have learned that if something is free it’s because you are the product EXCEPT in opensource (thanks to /u/SnowKissedBerries for that clarification. Security. I live in a very controlled country (Venezuela). Over here, almost every government agency is looking at you, … -
Using Multiple SSH Keys
Every time you use a new host,... -
Using SSH & Creating SSH Keys
Using a Secure Shell (`ssh`) w... -
Hello Linux: Custom Domain & Https with Let's Encrypt
<div class='alert alert-succes... -
Hello Linux: Nginx & UFW Firewall
<div class='alert alert-succes... -
Hello Linux: Gunicorn & Supervisor
<div class='alert alert-succes... -
Hello Linux: PostgreSQL on Live Linux Server
<div class='alert alert-succes... -
Hello Linux: Virtual Environment in Working Directory
# Virtual Environment For Prod... -
Hello Linux
<div class='alert alert-warnin... -
Git Push Local Code to Live Linux Server
<div class='alert alert-succes... -
Webinar: Deploying Django—from zero to production in 20 minutes
I held this webinar two years ago—28 February 2017. We start from zero: no server, no DNS, only a Django project in development. In 20 minutes we have a Ubuntu server running our Django project with nginx, Gunicorn and SQLite. Even if you only know Windows, you will get a good feeling of these technologies and understand why deploying on GNU/Linux is usually the most cost-effective solution. We have some fun making requests altogether in order to see whether the server can take it, and we also see whether SQLite is up to the task. Less than 30 minutes of presentation and lots of Q&A (total duration one hour). These are questions that were asked and the times in the video in which I answer Different settings for development and production environment 27m30s Managing passwords and secret keys 31m35 Is /etc/opt a standard? I have seen other locations like /usr/local/etc 36m00s The FHS isn’t entirely clear. It says you can put third-party applications in /usr/local or /opt or /srv. If you choose to put everything (program files, data files, configuration files etc.) under a single directory it should be /srv. My impression from common practices and from discussing it is … -
5 Samsung Galaxy Fold Features That Enhance Mobile Functionality
Samsung's new Galaxy Fold provides consumers with a phone and tablet in one device. Although it is a costly phone, it could eliminate your need for other expensive devices. In this way, it takes mobile phones to the next level for consumers and businesses alike. The post 5 Samsung Galaxy Fold Features That Enhance Mobile Functionality appeared first on Distillery. -
Multiple Image/File Upload with Django, Ionic 4 and FormData
In this tutorial, you'll learn to implement multiple file upload with Ionic 4, Django and FormData. In a previous tutorial, we've created a django RESTful application for uploading files using Django REST framework and Ionic 4. Since the backend code will be the same as we only need an /upload endpoint that accepts POST requests we'll simply clone the previous and start our django REST API server using the following command: $ cd ~/demos $ mkdir ionic-file-upload $ cd ionic-file-upload $ git clone https://github.com/techiediaries/django-rest-file-upload.git backend Next, create and activate a virtual environment using the following commands: $ cd backend $ python3 -m venv .env $ source .env/bin/activate Next, install the Python packages used in the project: $ pip install -r requirements.txt You can then start the development server using: $ python manage.py makemigrations $ python manage.py migrate $ python manage.py runserver Your RESTful django server will be available from the 127.0.0.1:8000 address. Here is some information about our restful server: It exposes an /upload endpoint which accepts POST requests for uploading files. It has CORS enabled so you can send requests from different doamins without getting blocked by the Same Origin Policy. Prerequisites This tutorial makes use of Ionic 4 … -
Post Multipart Form Data in Python with Requests: Flask File Upload Example
In this tutorial we'll demonstrate how to upload a file from a Python server to another server by sending a POST request with multipart/form-data using the Python requests library. We'll be using two servers. The server that receives the file doesn't need to be a Python server but since we'he previously created one with Django in this tutorial, let's use it instead of re-inventing the wheel. Note: Typically we upload files from a client to a server but in this tutorial, we'll see how we can upload files from a server to another web server using Python and the Requests library. Open a new terminal and create and activate a virtual environment: $ python3 -m venv .env $ source .env/bin/activate Next, clone the GitHub repository and install the dependencies: $ git clone https://github.com/techiediaries/django-rest-file-upload.git server2 $ cd server2 $ pip install -r requirments.txt Next, run the server using the following commands: $ python manage.py makemigrations $ python manage.py migrate $ python manage.py runserver The server will be available from the 127.0.0.1:8000 and will expose an /upload endpoint that accepts a POST request. Note: This server has also CORS enabled which means it can accept requests from different domains so make sure … -
Multiple File Image/Upload with Django, Angular 7 and FormData
In the previous tutorial we have seen how to implement file uploading in Django and Angular 7. In this tutorial, we'll see how to implement multiple file uploading. It's recommended that you start from the previous tutorial to see detailed steps of how to create a django project, how to install Angular CLI and generate a new Angular 7 project along with services and components as we won't cover those basics in this part. If you don't want to follow the steps from the previous part, you first need to get the project we've built. Open a new terminal and run the following command: $ git clone https://github.com/techiediaries/django-angular-file-upload-example.git Next, navigate inside the project's folder and install the npm dependencies using the following command: $ cd django-angular-file-upload-example $ npm install Next, start the development server using: $ ng serve Your Angular application will be available from the 127.0.0.1:4200 address. Open a new terminal window and create a virtual environment using the following command: $ python3 -m venv .env Next, activate the virtual environment using: $ source .env/bin/activate Next, navigate to the backend project and install the Python packages using: $ cd django-angular-file-upload-example/backend $ pip install -r requirements.txt Finally, start the development … -
Django REST Framework Image File Upload Tutorial & Example [FormData & Angular 7 UI]
Throughout this tutorial, we'll see how you can implement file upload in Django and Django REST Framework with a step by step example. Our application will expose an /upload endpoint that accepts POST requests that contain the file posted with a multipart/form-data content type using FormData. For the frontend, we'll be using Angular 7 to create a simple interface that allows the user to select a file and upload it to the server via a POST request and FormData. These tutorials is divided in two parts: In the first part we'll create the Django application and make a REST API client to make sure it properly work. In the second part, we'll proceed to create a frontend with Angular 7. Let's get started! Prerequisites For this tutorial, you will need to have a few prerequisites such as: Python and pip installed on your system. We'll be using Python 3.7, Familiarity with Python and Django. Node.js and NPM installed on your system. These are required by Angular CLI. Familiarity with TypeScript. Creating a Virtual Environment & Installing Django If you have Python and pip installed on your system, let's get started by creating a new virtual environment for our project's dependencies. … -
Why We Love Wagtail (and You Should, Too)
New clients regularly ask us if we build WordPress sites. When we dig deeper, we generally learn that they’re looking for a user-friendly content management system (CMS) that will allow them to effortlessly publish and curate their site content. As we’ve written about previously, WordPress can be a good fit for simple sites. However, the majority of our clients need a more robust technical solution with customizable content management tools. For the Python-driven web applications that we develop, we love to work with Wagtail. What is Wagtail? Wagtail is a Python-driven CMS built on the Django web framework. It has all the features you’d expect from a quality CMS: intuitive navigation and architecture user-friendly content editing tools painless image uploading and editing capabilities straightforward and rapid installation What Makes Wagtail Different? From the user’s perspective, Wagtail’s content editor is what sets it apart, and it’s why we really love it. Most content management systems use a single WYSIWYG (“what you see is what you get”) HTML editor for page content. While Wagtail includes a WYSIWYG editor — the RichTextField — it also has the Streamfield, which provides an interface that allows you to create and intermix custom content modules, each … -
DjangoChat Podcast
Launching a new podcast with Carlton Gibson focused on Django. -
The Benefits of Design Systems: Cutting Costs and Creating Competitive Advantage
A design system is far more than a UI kit. A design system is a continuously evolving single source of truth that establishes rules of visual narration and interaction. It must be comprehensive, combining components, behaviors, and branding. The post The Benefits of Design Systems: Cutting Costs and Creating Competitive Advantage appeared first on Distillery. -
Contributing to classiness (in Django)
A couple weeks ago I ran a poll on Twitter asking people whether they’d ever used, or considered using, the contribute_to_class() method to write something that attaches to or hooks into a Django ORM model class, and if so what their thoughts were. There was also a “don’t know what that is” option, which won by a large margin, and I promised I’d provide an explanation. Unfortunately, that was around the time I suffered a kitchen ... Read full entry -
My involvement in the Python community
An article about me and my involvement in the Python community (mainly Django) as a Free Software developer, GNU/Linux user and tech conference speaker. -
My involvement in the Python community
An article about me and my involvement in the Python community (mainly Django) as a Free Software developer, GNU/Linux user and tech conference speaker. -
Django: Recommended Reading
Pictured: Our library of reference books at Caktus cover topics including Django and Python, as well as project management and Agile methodologies. At Caktus, we believe in continued learning (and teaching). It's important to read up on the latest industry trends and technologies to stay current in order to address our clients' challenges. We even maintain a library in our office for staff use, and we add references frequently. Our team enjoys sharing what they've learned by contributing to online resources, such as the Django Documentation and the Mozilla Developer Network Web Docs. Below is a list (in alphabetical order) of the books, blogs, and other documents that we’ve found to be the most accurate, helpful, and practical for Django development. Django Documentation Authors: Various Recommended by Developer Dmitriy Chukhin Overview: When Dmitriy first began learning about Django, he went through the official Django tutorial. Then, as a developer, he read through other pieces of documentation that are relevant to his work. A Valuable Lesson: Dmitriy learned that detailed documentation makes working with a framework significantly easier than trying to figure it out on his own or from other developers’ posts about their errors. The documentation is readable, uses understandable …