Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Log In with Email not Username
Update the default Django log in setting to use email instead of username. -
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. ☀️ 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 … -
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. -
6 Significant Custom App Development Risks and How to Mitigate Them
Creating a custom app can lead to huge payoffs for your business. Given the potential benefits, enterprises and startups alike are eager to develop custom applications that help them achieve their business objectives. The post 6 Significant Custom App Development Risks and How to Mitigate Them appeared first on Distillery. -
Combining Inherited Django Forms in the Same FormView
This week, I discovered the power of Django’s generic editing views and was eager to try them out. I had two forms; one inheriting from the other. I could have them each in their own view, but for a better user experience, I wanted it all to happen on one page by allowing the user … Continue reading Combining Inherited Django Forms in the Same FormView The post Combining Inherited Django Forms in the Same FormView appeared first on concise coder. -
Django Tips #4: User permissions
Best practices for configuring user permissions in a Django project. -
U-Nest App Puts College Savings Within Parents’ Reach
These days, saving for college can seem like a daunting prospect. College costs are distinctly on the rise. Between 1987 and 2017, the average tuition for a public four-year institution increased by a whopping 213 percent, and the average tuition for a private four-year institution increased by 129 percent. That’s why it’s unsurprising that many families’ fears about their ability to pay for college are also on the rise. The post U-Nest App Puts College Savings Within Parents’ Reach appeared first on Distillery. -
Filtering and Pagination with Django
If you want to build a list page that allows filtering and pagination, you have to get a few separate things to work together. Django provides some tools for pagination, but the documentation doesn't tell us how to make that work with anything else. Similarly, django_filter makes it relatively easy to add filters to a view, but doesn't tell you how to add pagination (or other things) without breaking the filtering. The heart of the problem is that both features use query parameters, and we need to find a way to let each feature control its own query parameters without breaking the other one. Filters Let's start with a review of filtering, with an example of how you might subclass ListView to add filtering. To make it filter the way you want, you need to create a subclass of FilterSet and set filterset_class to that class. (See that link for how to write a filterset.) class FilteredListView(ListView): filterset_class = None def get_queryset(self): # Get the queryset however you usually would. For example: queryset = super().get_queryset() # Then use the query parameters and the queryset to # instantiate a filterset and save it as an attribute # on the view instance … -
Filtering and Pagination with Django
If you want to build a list page that allows filtering and pagination, you have to get a few separate things to work together. Django provides some tools for pagination, but the documentation doesn't tell us how to make that work with anything else. Similarly, django_filter makes it relatively easy to add filters to a view, but doesn't tell you how to add pagination (or other things) without breaking the filtering. The heart of the problem is that both features use query parameters, and we need to find a way to let each feature control its own query parameters without breaking the other one. Filters Let's start with a review of filtering, with an example of how you might subclass ListView to add filtering. To make it filter the way you want, you need to create a subclass of FilterSet and set filterset_class to that class. (See that link for how to write a filterset.) class FilteredListView(ListView): filterset_class = None def get_queryset(self): # Get the queryset however you usually would. For example: queryset = super().get_queryset() # Then use the query parameters and the queryset to # instantiate a filterset and save it as an attribute # on the view instance … -
Distillery Designers to Attend Adobe MAX Conference
To keep their creative juices flowing, creative professionals need the occasional infusion of inspiration. That’s exactly why Adobe created their annual MAX conference: to give creative professionals the opportunity to come together to learn, network, and get inspired. Distillery Senior UI Designer Luciana Flora and Junior UI Designer Mariana Herrera are excited to attend the 2018 conference, which takes place at the Los Angeles Convention Center from October 15th through the 17th. The post Distillery Designers to Attend Adobe MAX Conference appeared first on Distillery. -
Adding type hints to the Django ORM
It occurred to me that Django's ORM could do with a bit of a revamp to make use of recent developments in the Python language. The main area where I think Django's models are missing out is the lack of type hinting (hardly surprising since Django pre-dates type hints). Adding type hints allows Mypy to detect bugs before you even run your code. It may only save you minutes each time, but multiply that by the number of code + run iterations you do each day, and it can save hours of development time. Multiply that by the lifetime of your project, and it could save weeks or months. A clear win. Typing Django Models I'd love to be able to use type hints with the Django ORM, but it seems that the magic required to create Django models is just too dynamic and would defy any attempts to use typing. Fortunately that may not necessarily be the case. Type hints can be inspected at runtime, and we could use this information when building the model, while still allowing Mypy to analyze our code. Take the following trivial Django model: class Foo(models.Model): count = models.IntegerField(default=0) The same information could be … -
In-house or Outsourced: Which Software Development Path is Right for You?
The question of in-house vs. outsourced software development is something only you yourself can answer. With so many variables, personal preferences, and pros and cons in play, the only right answer is the one that’s right for you. The post In-house or Outsourced: Which Software Development Path is Right for You? appeared first on Distillery. -
Best Online Django Video Tutorials (2018)
An up-to-date list of online Django video tutorials. -
Evennia in Hacktoberfest 2018
Like last year, Evennia, the Python MUD creation system, takes part in Hacktoberfest, a yearly event run by Digitalocean in collaboration with GitHub.The premise is simple: Sign up at their website and then contribute with 5 GitHub pull requests during the month of October. If you do, you'll win a unique T-shirt!You can help out any OSS project to win, if you want to help out Evennia, I have marked a bunch of suitable issues with the Hacktoberfest label for you to sink your teeth in. Code on! -
Top 5 Business Benefits For DevOps Implementation
The DevOps movement has been gaining steam in recent years. More and more businesses are considering implementing changes that prioritize development and operations collaboration to utilize agile business strategies. In fact, DevOps is quickly becoming one of the must have tools for startups. But before undergoing huge changes to implement DevOps strategies, business owners want to be sure that it is worth the risk and effort. There are countless advantages to implementing new DevOps tactics at your organization. Find out the business benefits for DevOps in the post below. They are sure to help you realize the opportunities implementing a new system will afford your company. The post Top 5 Business Benefits For DevOps Implementation appeared first on Distillery.