Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django or Drupal for Content Management: Which Fits your Needs?
If you’re building or updating a website, you’re probably wondering about which content management system (CMS) to use. A CMS helps users — particularly non-technical users — to add pages and blog posts, embed videos and images, and incorporate other content into their site. CMS options You could go with something quick and do-it-yourself, like WordPress (read more about WordPress) or a drag-and-drop builder like Squarespace. If you need greater functionality, like user account management or asset tracking, or if you’re concerned about security and extensibility, you’ll need a more robust CMS. That means using a framework to build a complex website that can manage large volumes of data and content. Wait, what’s a framework? Put simply, a framework is a library of reusable code that is easily edited by a web developer to produce custom products more quickly than coding everything from scratch. Django and Drupal are both frameworks with dedicated functionality for content management, but there is a key difference between them: Drupal combines aspects of a web application framework with aspects of a CMS Django separates the framework and the CMS The separation that Django provides makes it easier for content managers to use the CMS because … -
python django (django template language)
Django Template Language Tags forThe for loop over each item in an array for example to display a list of athletes provided in athlete_list:<ul>{%for athlete in athlete_list%}<li>{{athlete.name}}</li>{%endfor%} </ul>if ,elif,and elseEvaluates a variable and if that variable is true the contents of the block are displayed {% if athlete_list %} Number of athletes: {{ athlete_list|length }}{% elif athlete_in_locker_room_list %} Athletes should be out of the locker room soon!{% else %} No athletes.{% endif %}in the above if athlete_list is not empty the number of athletes will be displayed by the {{athlete_list|length}} variable . Otherwise if athlete_in_locker_room_list is not empty the message "Athletes should be out..." will be displayed if both lists are empty "No athletes " will be displayedyou can also use filters and various operators in the if tag:{% if athlete_list|length > 1 %} Team: {% for athlete in athlete_list %} ... {% endfor %}{% else %} Athlete: {{ athlete_list.0.name }}{% endif %}most templates will return string so mathematical comparisons using filters will generally not work as you expect Length is an exception Commentsthe comment out part of a line in a template use the comment syntax{# #} for example this template would render as 'hello':{#greeting#}helloa comment can contain any … -
Utrecht (NL) python meetup september 2018
Data processing using parser combinators - Werner de Groot He collaborated with data scientists from Wageningen University. The scientists did lots of cool programming stuff. But they did not use version control, so they introduced git :-) They also had lots and lots of data, so they introduced Apache Spark. Their data sets were in ascii files, which are huge. So the ascii files need to be parsed. He showed an example of a file with DNA data. Ouch, it turns out to be pretty complex because there are quite some exceptions. Fields (in this example) are separated by semicolons. But some of the values also contain semicolons (quoted, though). So the generic python code they used to parse their DNA data was littered with "if" statements. Unmaintainable. You probably heard that hard problems need to be split up into smaller problems. Yes, that's true. But the smaller parts also need to be combined again. So: smaller parsers + a combining them again. A parser takes an input and returns the part that matched and the part that remained. He showed parsy as a library for "parser combinators". Many languages have such libraries. He demonstrated how to combine those input/match/remainder … -
Believe the Buzz: 3 Use Cases that Show Why Good UX Is Good for Business
In recent years, user-centered design (UCD) has become widespread well beyond the design field. Companies and organizations ranging from NASA to IKEA and everything in between have benefited from adopting UCD. The post Believe the Buzz: 3 Use Cases that Show Why Good UX Is Good for Business appeared first on Distillery. -
Dataset Resources for Machine Learning
In our [Machine Learning](/cou... -
Dataset Resources
In our [Machine Learning](/cou... -
Bringing FeinCMS and django-content-editor/feincms3 closer together
Bringing FeinCMS and django-content-editor/feincms3 closer together If I had more time those are the features I would try to implement next: Reimplement FeinCMS’s TreeEditor using django-mptt’s DraggableMPTTAdmin This shouldn’t be a big effort. The toggleable booleans are probably the only feature from the TreeEditor that haven’t made it into django-mptt. Add features to django-content-editor Moving content blocks as a group It would be awesome if it was possible to collapse the content blocks’ fieldsets, mark consecutive blocks and move them as a group. Adding content blocks in the middle and improving reordering Right now it’s only possible to add new content blocks at the end; only after saving is it allowed to move new blocks in-between pre-existing content. This is a limitation of django’s InlineFormset respectively of django-content-editor’s naive reuse which expects new inline instances to always be ordered after existing forms. I suspect that by using flexbox’s order attribute and some custom JavaScript code it should be possible to keep the ordering of inlines stable in the HTML code. If that was true the backend code wouldn’t have to be changed, which would also keep maintenance lower for the future. The ItemEditor from FeinCMS supports adding content in the … -
The state of things in FeinCMS 1.x land
The state of things in FeinCMS 1.x land FeinCMS is still in active use, but not very actively developed. This does not have to be a bad thing – FeinCMS is compatible with the recently released Django 2.1 back to Django 1.7, it works well and it’s pain points are generally well known by long time users. Slow development also means minimal breakage because of new incompatibilities, not bad either. That being said, here’s a list of things with I find bothersome when working with FeinCMS: The extension mechanism and create_content_type are brittle. Many hacks and workarounds and fumbling with Django’s internals were necessary over the years to avoid invalid and/or incomplete model meta information. Also, testing the dynamic creation of models is hard to test and most breakages were very hard to reproduce. It has a few features which make it hard to know what’s going on. There’s no single place to look if you want to know what fields the page model has. There’s no place no look if you want to know what happens when processing a request because request and response processors and also the content types themselves all have ways to interfere and even short … -
What did FeinCMS get right?
What did FeinCMS get right? Here’s a list of things FeinCMS got right. The list will never be exhaustive. Sites are different. Building a framework and not a single product covering all use cases is still a good idea. Also, we are building on top of Django, so we shouldn’t have to sell the advantages of using a framework compared to using a ready-made CMS which looks better when comparing features but not when really working with it day to day. The ItemEditor and its structuring of content (e.g. keeping images separate, rigidly clean HTML blobs) is still the right way to do it, even though I can’t disagree that the interface for editors might be improved. Making things reusable (the ItemEditor for blog entries, the TreeEditor for any tree shaped data) was the right thing to do. The tree editor code has its descendants (pun intended) everywhere, in django-mptt, in django-treebeard and also in other projects. It also seems to me that the same ideas ItemEditor implements have found their way into other projects, although I’m certainly not claiming credit for all those. Staying close to Django’s administration interface instead of diverging (and having to rebuild functionality at great … -
The other future of FeinCMS: django-content-editor and feincms3
The other future of FeinCMS: django-content-editor and feincms3 The FeinCMS ItemEditor code lives on in a new project, django-content-editor1. By contrast feincms3 is a completely new project, which was the result of starting to build websites with a stripped down environment of django-content-editor and django-mptt2 only. feincms3 avoids many of the downsides of FeinCMS 1.x by doing less. At first sight it sounds like building a website with feincms3 will be more work. In my view this does not have to be, since feincms3 offers more direct ways of achieving the same results. feincms3 addresses FeinCMS’ issues by: It does not offer concrete models, only mixins. Because of this, all problems with dynamic model creation and the extensions mechanism simply disappear. You write the page model yourself, so you’ll know what fields it has. No request and response processors, and plugins (content types in FeinCMS 1.x) do not have any ways of interferring with request and response processing. This makes at all times obvious what’s going to happen when processing a request. Redirects? Easy, DIY in your own, short view function. The automatic creation of inlines for the admin interface is gone. This avoids the custom feincms_item_editor_inline protocol, and its … -
The future of FeinCMS
The future of FeinCMS A recent exchange in an issue in the elephantblog repository on Github asking whether the project was still alive and my own work on feincms3 made me think about the need to clarify my position on the future of FeinCMS 1.x. In the issue I wrote that it (meaning elephantblog) is mostly in maintenance mode and not actively developped anymore, and I also pointed people towards feincms3 for new projects. There are a lot of things FeinCMS 1.x got right and there are things that could be better or I could have handled better. The state of things in FeinCMS 1.x land What did FeinCMS get right? (not published yet) The other future of FeinCMS: django-content-editor and feincms3 (not published yet) -
Writing documentation
Writing documentation Why do I like writing documentation? A good part of it is that I am writing docs for myself. Similar to writing tests or commit messages, writing docs is a way of thinking about the same issues from a different viewpoint, with a different part of the brain so to speak. Sometimes code feels bad, but it’s hard to tell why. Surprisingly often the badness really shows itself as soon as I start writing docs. The Zen of Python says it much better than I could: If the implementation is hard to explain, it’s a bad idea. If the implementation is easy to explain, it may be a good idea. When do I write documentation? I mostly start writing documentation when the first or second iteration of a project basically works and when it is time to move towards the beta quality stage. Documenting alpha quality software is mostly not worth the effort; it only adds documentation churn to code churn. Documenting a 1.0 release is too late except for trivial software, since documenting often surfaces simpler ways to achieve the same results. Docs I spent a lot of time on I’m quite proud of the following projects’ … -
Diverse Speaker Line-up for DjangoCon is Sharp
Above: Account Manager Tim Scales with a table full of various Caktus promotional materials that will be available at DjangoCon. We’re looking forward to taking part in the international gathering of Django enthusiasts at DjangoCon 2018, in San Diego, CA. We’ll be there from October 14 - 19, and we’re proud to attend as sponsors for the ninth year! As such, we’re hosting a mini golf event for attendees (details below). This year’s speakers are impressive, thanks in part to Erin Mullaney, one of Caktus’ talented developers, who volunteered with DjangoCon’s Program Team. The three-person team, including Developer Jessica Deaton of Wilmington, NC, and Tim Allen, IT Director at The Wharton School, reviewed 257 speaker submissions. They ultimately chose the speakers with the help of a rating system that included community input. “It was a lot of fun reading the submissions,” said Erin, who will also attend DjangoCon. “I’m really looking forward to seeing the talks this year, especially since I now have a better understanding of how much work goes into the selection process.” Erin and the program team also created the talk schedule. The roster of speakers includes more women and underrepresented communities due to the DjangoCon diversity … -
Diverse Speaker Line-up for DjangoCon is Sharp
Above: Caktus Account Manager Tim Scales gears up for DjangoCon. We’re looking forward to taking part in the international gathering of Django enthusiasts at DjangoCon 2018, in San Diego, CA. We’ll be there from October 14 - 19, and we’re proud to attend as sponsors for the ninth year! As such, we’re hosting a mini golf event for attendees (details below). This year’s speakers are impressive, thanks in part to Erin Mullaney, one of Caktus’ talented developers, who volunteered with DjangoCon’s Program Team. The three-person team, including Developer Jessica Deaton of Wilmington, NC, and Tim Allen, IT Director at The Wharton School, reviewed 257 speaker submissions. They ultimately chose the speakers with the help of a rating system that included community input. “It was a lot of fun reading the submissions,” said Erin, who will also attend DjangoCon. “I’m really looking forward to seeing the talks this year, especially because I now have a better understanding of how much work goes into the selection process.” Erin and the program team also created the talk schedule. The roster of speakers includes more women and underrepresented communities due to the DjangoCon diversity initiatives, which Erin is proud to support. What we’re excited … -
Django Tips #3: Template Structure
Best practices for templates in Django. -
How to Integrate a C Library into an iOS App Written in Swift
Nowadays, everyone values privacy and security. That’s why it wasn't surprising when, recently, we needed to use an encryption library on one of our Distillery projects. For the project in question, the decision was made to use libsignal. Originally developed for Signal Private Messenger, libsignal has a good reputation among security specialists. The post How to Integrate a C Library into an iOS App Written in Swift appeared first on Distillery. -
Podcast.__init__ Interview - The Business of Technical Authoring
An interview with Tobias Macey on learning and teaching Django. -
Alexa, What Can You Teach Me Today? Distillery Developer Attends Alexa Dev Day
We shouldn’t take Alexa for granted. While Amazon’s intelligent assistant may seem capable of answering our every whim and inquiry, it takes a lot of behind-the-scenes development to make it happen. Just ask Distillery Android Developer Dmitry Sitnikov. The post Alexa, What Can You Teach Me Today? Distillery Developer Attends Alexa Dev Day appeared first on Distillery. -
Alexa, What Can You Teach Me Today? Distillery Developer Attends Alexa Dev Day
We shouldn’t take Alexa for granted. While Amazon’s intelligent assistant may seem capable of answering our every whim and inquiry, it takes a lot of behind-the-scenes development to make it happen. Just ask Distillery Android Developer Dmitry Sitnikov. The post Alexa, What Can You Teach Me Today? Distillery Developer Attends Alexa Dev Day appeared first on Distillery. -
Alexa, What Can You Teach Me Today? Distillery Developer Attends Alexa Dev Day
We shouldn’t take Alexa for granted. While Amazon’s intelligent assistant may seem capable of answering our every whim and inquiry, it takes a lot of behind-the-scenes development to make it happen. Just ask Distillery Android Developer Dmitry Sitnikov. The post Alexa, What Can You Teach Me Today? Distillery Developer Attends Alexa Dev Day appeared first on Distillery. -
Distillery Developer Attends Scala Days Conference in New York
At the 2018 Scala Days North America conference, Distillery Scala Developer Artem Mitrakov learned many things. Chiefly, however, he learned how incredibly much there is to learn about Scala. The Scala community is steaming ahead, actively developing Scala-based technologies and frameworks (e.g., Apache Spark, Akka Streams, Akka HTTP, Apache Kafka) that, according to Artem, “can help make apps more efficient, stable, and robust.” The post Distillery Developer Attends Scala Days Conference in New York appeared first on Distillery. -
Distillery Developer Attends Scala Days Conference in New York
At the 2018 Scala Days North America conference, Distillery Scala Developer Artem Mitrakov learned many things. Chiefly, however, he learned how incredibly much there is to learn about Scala. The Scala community is steaming ahead, actively developing Scala-based technologies and frameworks (e.g., Apache Spark, Akka Streams, Akka HTTP, Apache Kafka) that, according to Artem, “can help make apps more efficient, stable, and robust.” The post Distillery Developer Attends Scala Days Conference in New York appeared first on Distillery. -
Distillery Developer Attends Scala Days Conference in New York
At the 2018 Scala Days North America conference, Distillery Scala Developer Artem Mitrakov learned many things. Chiefly, however, he learned how incredibly much there is to learn about Scala. The Scala community is steaming ahead, actively developing Scala-based technologies and frameworks (e.g., Apache Spark, Akka Streams, Akka HTTP, Apache Kafka) that, according to Artem, “can help make apps more efficient, stable, and robust.” The post Distillery Developer Attends Scala Days Conference in New York appeared first on Distillery. -
Django Filters Problem: How To Display All Results When The Filter Is Not Set
If a view extends django-filter's FilterView it may look similar to this: from django_filters.views import FilterView from .filters import JobFilter class JobList(FilterView): model = Job paginate_by = 20 filterset_class = JobFilter JobFilter has a single filter field city that filters jobs by city and generate URL like /jobs/?city=London ... Read now -
Angular API Calls with Django, Part 2: Building the Micro-Blog App
Angular API Calls with Django, Part 2: Building the Micro-Blog App Keith Dechant Sun, 09/09/2018 - 07:24 This is the second part of a two-part series exploring the use of the Angular 6 HttpClient to make API calls against a Django back-end using Django Rest Framework. In the first part, we learned how to authenticate against Django using the Django Rest Framework JWT package. This post demonstrates how to set up the Django models and views for the micro-blogging app, as well as the Angular Service and templates.