Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Setup React
Below is a reference we made t... -
A few JavaScript Functions for Images and Files
> This post will be updated as... -
Changing Default Python 3 in Terminal for Mac OS
Sometimes Python gets upgraded... -
Pipenv Virtual Environments for Python
`Pipenv` is an **amazing** rep... -
Deep Learning Acronym Cheatsheet
Below as a list I'm working on... -
Dataset Resources for Machine Learning
In our [Machine Learning](/cou... -
10 Crucial Questions to Ask a Potential Software Development Partner
Nobody embarks on a software development project with the goal of failing. Unfortunately, failure is a real possibility if you don’t find the right development partner. The key is getting the right information to help you make the choice that’s genuinely right for your project. So how do you do that? The post 10 Crucial Questions to Ask a Potential Software Development Partner appeared first on Distillery. -
Django ORM Optimization Tips
When it comes to optimizing an ORM, your greatest weapon is your understanding of how your ORM works under the hood (at least at a high level). This makes understanding all of the rules and guidelines for creating a speedy application much easier. Therefore, I highly recommend reading through the Django docs on the subject … Continue reading Django ORM Optimization Tips The post Django ORM Optimization Tips appeared first on concise coder. -
Django Authentication Video Tutorial
In this tutorial series, we are going to explore Django’s authentication system by implementing sign up, login, logout, password change, password reset and protected views from non-authenticated users. This tutorial is organized in 7 videos, one for each topic, ranging from 4 min to 15 min each. Setup Sign Up Login Logout Password Change Password Reset Protecting Views Conclusions Setup Starting a Django project from scratch, creating a virtual environment and an initial Django app. After that, we are going to setup the templates and create an initial view to start working on the authentication. If you are already familiar with Django, you can skip this video and jump to the Sign Up tutorial below. Sign Up First thing we are going to do is implement a sign up view using the built-in UserCreationForm. In this video you are also going to get some insights on basic Django form processing. Login In this video tutorial we are going to first include the built-in Django auth URLs to our project and proceed to implement the login view. Logout In this tutorial we are going to include Django logout and also start playing with conditional templates, displaying different content depending if the … -
Crack Django Passwords
Most of the Django projects I work with take advantage of django.contrib.auth. It manages users and groups and is tightly coupled with django.contrib.admin. In this post, we are going to explore how it resists a potential attacker. The study below assumes an attacker obtained the encrypted password column from the database: mysql> select password from auth_user limit 1; +-------------------------------------------------------------------------------+ | password | +-------------------------------------------------------------------------------+ | pbkdf2_sha256$20000$H0dPx8NeajVu$GiC4k5kqbbR9qWBlsRgDywNqC2vd9kqfk7zdorEnNas= | +-------------------------------------------------------------------------------+ Django stores passwords in the following format: <algorithm>$<iterations>$<salt>$<hash> As computers get faster, hashing a password also gets faster. This is important because the only protection password hashing offers is to make "guessing" the encrypted password more time consuming. The 2 knobs you can turn to increase this time are the algorithm and the number of iterations. Since Django 1.4 (released in 2012), the default algorithm it uses is PBKDF2 as recommended by NIST. It is interesting to note that since then the iteration parameter has been increased at least 4 times: 1, 2, 3, 4. With this in mind, I was interested to know how many passwords I could crack with a limited budget of less than $100 and few days. Performing a similar experiment against your own database will help you evaluate … -
Cracking Django Password Hashes
Most of the Django projects I work with take advantage of django.contrib.auth. It manages users and groups and is tightly coupled with django.contrib.admin. In this post, we are going to explore how it resists a potential attacker. The study below assumes an attacker obtained the encrypted password column from the database: mysql> select password from auth_user limit 1; +-------------------------------------------------------------------------------+ | password | +-------------------------------------------------------------------------------+ | pbkdf2_sha256$20000$H0dPx8NeajVu$GiC4k5kqbbR9qWBlsRgDywNqC2vd9kqfk7zdorEnNas= | +-------------------------------------------------------------------------------+ Django stores passwords in the following format: <algorithm>$<iterations>$<salt>$<hash> As computers get faster, hashing a password also gets faster. This is important because the only protection password hashing offers is to make "guessing" the encrypted password more time consuming. The 2 knobs you can turn to increase this time are the algorithm and the number of iterations. Since Django 1.4 (released in 2012), the default algorithm it uses is PBKDF2 as recommended by NIST. It is interesting to note that since then the iteration parameter has been increased at least 4 times: 1, 2, 3, 4. With this in mind, I was interested to know how many passwords I could crack with a limited budget of less than $100 and few days. Performing a similar experiment against your own database will help you evaluate … -
Django Log In with Email not Username
Update the default Django log in setting to use email instead of username. -
Django Tips #6: Custom User Model
How and why to add a custom user model to all new Django projects. -
useState React Hook by Example | Axios & Django [Part 2]
useState() is an example built-in React hook that lets you use states in your functional components. This was not possible before React 16.7. In the previous tutorial we learned about React Hooks and what problems they solve. Let's now see by example how to use the useState() built-in hook to allow component functions to have local state. In the previous tutorial, we've cloned our React/Axios/Django project and installed the project's dependencies including React 16.7 alpha which provides support for React Hooks. Our front-end application has two React components: CustomerCreateUpdate: for creating and updating customers, CustomersList: for listing customers The API requests sent with Axios are encapsulated in the CustomersService.js class. The two components uses component classes. Before diving into practice, let's see some theory about the useState() hook. Why Using useState? Before React 16.7, if you are using functional components in your app then suddenly you have a requirement to add a bunch of state to your function; you have only one solution which is to convert your function to a class that extends React.Component then you'll use this.state to add initial state and setState() to update it. Now with the latest version of React, you can still use functional … -
React 16.7 Hooks — with Axios and Django API [PART 1]
React Hooks are a new feature recently released by the React team. It's included in React 16.7 which is in its Alpha version as of this writing. In this tutorial, we'll learn to migrate our previous project created with React and Django to use function components and React Hooks instead of class components, life-cycle methods and the state object. Prerequisites You need to have: Python 3, Pip and venv installed for running the back-end API, Node.js 6+, npm 5.2+ and create-react-app for running the React app, Git for cloning our project from GitHub. Cloning and Setting Up our React/Django Project First let's start by cloning our full-stack React/Django project. Navigate to your home directory and create a virtual environment using the venv module: $ cd ~ $ python3 -m venv ./env Activate the created virtual environment using: $ source env/bin/activate Using Git run the following command from your terminal: $ git clone https://github.com/techiediaries/django-react.git django-react-hooks Next, navigate to your cloned project using: $ cd django-react-hooks Next install the dependencies using pip: $ pip install django djangorestframework django-cors-headers Now, navigate to the frontend folder and install the dependencies using npm: $ cd frontend $ npm install This will install React and Axios. … -
Agile Business is Good Business: Lessons from the 2018 Agile Business Conference
Long gone are the days when “Agile” referred only to a method of software development. Nowadays, companies across industries have adopted Agile practices in many areas of their business. Agile influences how these businesses go to market, and how they manage client relationships. It impacts how they design their people organizations and corporate culture. It informs how they manage their teams, how they communicate, how they manage their budgets, and countless other activities. The post Agile Business is Good Business: Lessons from the 2018 Agile Business Conference appeared first on Distillery. -
Container Runtimes Part 3: High-Level Runtimes
This is the third part in a four part series on container runtimes. It's been a while since part 1, but in that post I gave an overview of container runtimes and discussed the differences between low-level and high-level runtimes. In part 2 I went into detail on low-level container runtimes and built a simple low-level runtime. High-level runtimes are higher up the stack than low-level runtimes. While low-level runtimes are responsible for the mechanics of actually running a container, high-level runtimes are responsible for transport and management of container images, unpacking the ima[...] -
Container Runtimes Part 3: High-Level Runtimes
This is the third part in a four-part series on container runtimes. It's been a while since part 1, but in that post I gave an overview of container runtimes and discussed the differences between low-level and high-level runtimes. In part 2 I went into detail on low-level container runtimes and built a simple low-level runtime. High-level runtimes are higher up the stack than low-level runtimes. While low-level runtimes are responsible for the mechanics of actually running a container, high-level runtimes are responsible for transport and management of container images, unpacking the ima[...] -
Case-Insensitive Fields in Django Models
If you are trying to figure out how to create a case-insensitive field for your Django models, there are several ways to go about it. If you don’t care about preserving the actual mixed-case version, you can simply convert your strings to lowercase before they get saved to the model. If you are using PostgreSQL … Continue reading Case-Insensitive Fields in Django Models The post Case-Insensitive Fields in Django Models appeared first on concise coder. -
Django acceptance testing automation with robot framework
Testing is a typical phase in the Web application development flow, because a Web application is made of multiple layers of logic starting from HTTP request handling, to request data validation and processing, to template rendering. But testing phase of a Django Application development, it’s really easy. We use Unittest module built in to python standard library to write the test cases to simulate requests, insert the test data and inspect the application’s output. You can perform automated testing in your Django application using different tools. Few of them are, Writing the unit test cases using the python’s test client Writing the unit test cases using the selenium Writing the behavioral test cases using Django-behave framework Writing the generic test cases for acceptance testing using Robot framework In this blog, let's try to learn of what is Robot framework and how to write simple test cases using robot framework. Robot Framework is one of the best testing automation frameworks for acceptance testing. Which can be very useful in the acceptance test-driven development. This framework uses a keyword-driven testing approach, and it has easy-to-use tabular test data syntax, which is a very effective way to achieve user acceptance testing. This framework … -
DjangoCon 2018 Recap
Above: Hundreds of happy Djangonauts at DjangoCon 2018. (Photo by Bartek Pawlik.) That’s it, folks — another DjangoCon in the books! Caktus was thrilled to sponsor and attend this fantastic gathering of Djangonauts for the ninth year running. This year’s conference ran from October 14 - 19, in sunny San Diego. ☀️ Our talented Caktus contractor Erin Mullaney was a core member of this year’s DjangoCon organizing team, plus five more Cakti joined as participants: CTO Colin Copeland, technical manager Karen Tracey, sales engineer David Ray, CBDO Ian Huckabee, and myself, account exec Tim Scales. What a Crowd! At Caktus we love coding with Django, but what makes Django particularly special is the remarkable community behind it. From the inclusive code of conduct to the friendly smiles in the hallways, DjangoCon is a welcoming event and a great opportunity to meet and learn from amazing people. With over 300 Django experts and enthusiasts attending from all over the world, we loved catching up with old friends and making new ones. #Djangocon 2018 in San Diego has been the most inclusive, breath of fresh air conference I've ever attended, with the most beautiful and diverse group of people. Way to go … -
DjangoCon 2018 Recap
Above: Hundreds of happy Djangonauts at DjangoCon 2018. (Photo by Bartek Pawlik.) That’s it, folks — another DjangoCon in the books! Caktus was thrilled to sponsor and attend this fantastic gathering of Djangonauts for the ninth year running. This year’s conference ran from October 14 - 19, in sunny San Diego. ☀️ -
How To Prevent Users From Creating Certain Page Types in Wagtail CMS
Sometimes in Wagtail, we have pages that should only have a single instance in the system. Let's say we have a blog that has an index page driven by BlogIndexPage model. We create it once and want to prevent editors from creating a second instance of BlogIndexPage. How do ... Read now -
Angular 7 Tutorial: Introducing Angular for Python Developers
Angular 7 is out and we'll use it to continue with our front-end tutorial series designed for Python developers. This tutorial is part of an ongoing series for teaching Angular to Python developers. Saying that; this tutorial can be also followed by front-end developers that don't use Python as their back-end language. Before diving into practical steps for developing a full-stack Python & Angular 7 web application. Let’s first learn about the basics of this front-end framework and how to get started using it. In the previous tutorial, we've learned how to integrate Angular with Django. This tutorial (now, updated to Angular 7) will be dedicated to teach you how to get started with v7. You can also learn how we consume a Django RESTful API from an Angular interface in this tutorial which used v6. Throughout this beginner's series, you'll learn how you can use v7 to build client side web applications for mobile and desktop with a Django back-end. Angular 7 Tutorial: Introducing Angular to Python Developers What's a JavaScript Framework and Why Using it Introducing Angular Angular Features Angular 7 New Features Angular 6 New Features Angular 5 Features Angular 4 Features jQuery vs. Angular Why Would … -
Django Tips #5: Docker
Why Docker improves Django development.