Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Contributing to Django Documentation, Part 2: Submitting A Patch
Contributing to Django Documentation, Part 2: Submitting A Patch -
DjangoCon 2011 Wrap Up
Sadly DjangoCon 2011 has come and gone and while I’m sad that it is over I’m excited to try the things I learned over the conference. There were a number of excellent talks by a number of great speakers but there were a few that stood out to me. Advanced Security Topics – Paul McMillan had a great talk on different security aspects of Django. He showed a couple of critical flaws (that were patched in 1.3.1 and 1.2.7. He also talked about the django-secure application that can help you plug your security holes within your own Django projects. Overall this was my favourite talk due to Paul’s excellent presentation and the quality of the content. Secrets of PostgreSQL Performance – Frank Wiles also had a great talk on performance tuning your PostgreSQL server. While this wasn’t really geared towards Django I thought there were a number of great performance tips that he gave to speed up your DB server. I’ve already followed a few of these tips and have noticed a slight increase in performance. The Story and Tech of Read The Docs – Eric Holscher talked about how Read The Docs came to be and the technology of … -
Quick conferences report: Presentations
My lovely Fiancée, Audrey Roy, was invited to be the opening keynote speaker at both PyCon Australia on Diversity in Python (video) and PyCon New Zealand on Python on the Web.As for me, I managed to get talks into both of those conferences AND DjangoCon US. I co-presented on three of them, and I share all credit for success with my cohorts. The talks I gave at the conferences were (I'll post videos when they get up):Confessions of Joe Developer (PyCon Australia, DjangoCon US)The genesis of this talk was as a lightning talk at I gave at the Hollywood Hackathon. It is a talk about admitting that us mere mortals need to ask questions, take notes, and follow good practices in general. I gave it again at LA Django this summer, extending it to a full length talk complete with lots of technical content. At PyCon Australia I toned down the technical content because I was nervous, and while the response was positive, it could have been much better. So for DjangoCon I ramped up the tech-talk and it worked much better. I've now given the talk 4 times, and I'm leaning towards retiring it. Python Worst Practices (PyCon New Zealand)This talk grew out … -
Try Redis instead
Redis is an invaluable part of software on my server. If you have never tried, or seen it, you should go and install it anyway. You can benefit from Redis just by changing a couple of Django settings. Furthermore, it can replace several uselessly humongous applications you are probably considering right now. -
Testing Web Server Configurations with Fabric and ApacheBench
Load testing a site with ApacheBench is fairly straight forward. Typically you'd just SSH to a machine on the same network as the one you want to test, and run a command like this:ab -n 500 -c 50 http://my.web.server/path/to/page/ The -n argument determines the number of requests to execute, and the -c argument the determines ... -
Contributing to Django Documentation, Part 2: Submitting A Patch
Contributing to Django Documentation, Part 2: Submitting A Patch -
Contributing to Django Documentation, Part 1: Generating and Editing Documentation Locally
Contributing to Django Documentation, Part 1: Generating and Editing Documentation Locally -
Gedit as a Django IDE for Linux
gedit is actually a pretty bad ass IDE for Django web development. -
Por: Marcos Alcazar
gracias! -
Por: jjconti
La verdad no la uso hace rato. -
Por: Marcos Alcazar
juanjo, seguis usando esta app? en code.google desde mediados de 2010 que no hay commits, y encontré en github una que parece ser la misma :S https://github.com/mirumee/dja…… alguna idea o recomendación? -
How to discover unit tests from your project
Within code snippet below implemented very primitive way to collect your unit tests within your project. This is not for real project - I know at least two of fancy discovering tools - it's nose and discover , which do same thing in more convenient and accurate way.I was curious and I did it.# -*- coding: utf-8 -*-import osimport sysimport unittestFILE_ABSPATH = lambda p: os.path.dirname(os.path.abspath(p))COMPARE_DIRS = lambda a, b: FILE_ABSPATH(a) == FILE_ABSPATH(b)def collect_tests(): """ Function to collect tests from whole project """ basedir = os.path.abspath(os.path.dirname(__file__)) main_module = os.path.basename(basedir) test_file = "tests.py" test_dir = "tests" tests = [] new_locals = {} for root, dirs, files in os.walk(basedir): if test_file in files and \ os.path.join(root, test_file) != os.path.abspath(__file__): tests.append(os.path.join(root, test_file)) if os.path.dirname(root) == test_dir: tests.append(root) for test in tests: test_path = test.replace(basedir, '').replace('.py', '') module_name = "%s%s" % (main_module, test_path.replace('/', '.')) __import__(module_name) module = sys.modules[module_name] for cls in dir(module): attr = getattr(module, cls) try: attr.__module__ except AttributeError: continue # we don't want to import anything from current file if COMPARE_DIRS(sys.modules[attr.__module__].__file__, __file__): continue try: if issubclass(attr, unittest.TestCase): new_locals[cls] = attr except TypeError: pass return new_locals# execute testsif __name__ == '__main__': locals().update(collect_tests()) unittest.main() -
Django South : How To Fix The UnknownMigration Exception Error
Django South : How To Fix The UnknownMigration Exception Error -
Language redirects for multilingual sites with Django CMS …
If you have a multilingual website that uses Django CMS probably you have noticed that your pages can be opened both with and without language code in the URL? This leads to duplicate content but this is easy to fix problem. -
Ready Set Sprint – DjangoCon 2011 Sprints
As the conference wraps up the sprints get started. For those that don’t know what a software sprint is: A sprint is a get-together of people involved in a project to give a focused development on the project. Sprints are typically two to seven days long. Sprints have become popular events among some Open Source projects. [wikipedia] DjangoCon 2011 Sprints are being held at Urban Airship in Downtown Portland. So far I’m really impressed with their space. It’s an open style concept with a warehouse feel. The people here have been really nice to host over 100 developers, and the sponsors have even catered it. This year a number of teams have gotten together and are sprinting on different Django related projects. While all of them sounded great I decided to dive into Django’s open tickets to see how I can help. While I’ve only been here a couple of hours I’ve closed one ticket as invalid and added a patch (and documents) to another. It definitely doesn’t take a lot of work to look into Trac. Finding something you can work on is a little more difficult but even adding extra documentation or reviewing tickets can help out the core developers and make … -
DjangoCon 2011 – Making interactive maps for the web
For the last regular talk of DjangoCon US 2011 we’ll be hearing from Zain Memon on “Making interactive maps for the web”. When tasked with displaying geo-data, most developers decide to put some big red markers on an embeddable Google Map and call it a day. If you’re interested in creating maps that are more beautiful, more interactive, and more usable, this talk is for you. Updates Below: 20.05The talk is over now. I’ll update the notes with the slides if they become available. 19.51@zainy just finished up. Great talk, question time… 19.47“When you’re doing this, you’re basically telling your users to fuck off” = Use less datapoints, don’t flood information to your users. 19.43Good maps are… Attractive (Nice looking things do better. People like it more) Readable (Need to make the data pop more than the maps. Pale Dawn or Midnight Commander) Interactive (Hover states. Polygons on more information. Selecting + Filtering) Fast (Tile your map, don’t use a lot of polygons) 19.31The Stack: DB: PostgreSQL + PostGIS ORM: GeoDjango Front-end: TileStache Slippy Map: PolyMaps (GoogleMaps, leaflet) 19.27Map Tiles 256px by 256px images 21 different zoom levels Standard URL scheme (zoom)/(x)/(y).png A collection of map tiles makes up a … -
Заметки с DjangoCon 2011
Выдалось немножко свобдного времени, решил набросать быстрых заметок про DjangoCon 2011 в Потленде. Признание Я не хотел ехать на конференцию сначала. Потому что последние полгода-год всё связанное с Джанго, Питоном, интернетом, да и вообще компьютерами стало навевать на меня тоску. Да и конференции со временем утратили очарование новизны: приехал, послушал доклады, которые лучше было бы прочитать текстом, уехал — только время потерял. Однако потом передумал, потому что… да просто потому что Портленд от меня теперь в трёх-четырёх часах езды. Как теперь потихоньку понимаю, передумал не зря. Похоже, эта конференция пропитана каким-то особым духом Хабанбай-Батыра, и я снова начинаю получать удовольствие от происходящего :-). Я наконец понял, что надо не доклады слушать, а с людьми разговаривать :-). Организация Главный организатор конференции — Стивен Холден, председатель PSF, который на этом деле собаку съел (PyCon тоже он организует). Результат — организация на уровне Just Works® с отсутствием каких бы то ни было заметных проблем: DjangoCon оплачивает всем участникам отельный WiFi, так как сами отели пока ещё не додумались, что это людям несколько важнее трёх комплектов полотенец в одноместном номере. В конференц-залах работает отдельный WiFi, без которого отельная сеть бы загнулась. Он всё же иногда мигает, но довольно редко. В конференцию входит завтрак, обед … -
DjangoCon 2011 – Y’all Wanna Scrape with Us? Content Ain’t a Thing : Web Scraping With Our Favorite Python Libraries
The great talks keep on rolling in with day 3 representing. The next talk is entitled “Y’all Wanna Scrape with Us? Content Ain’t a Thing : Web Scraping With Our Favorite Python Libraries” by Katharine Jarmul. Love or hate them, the top python scraping libraries have some hidden gems and tricks that you can use to enhance, update and diversify your Django models. This talk will teach you more advanced techniques to aggregate content from RSS feeds, Twitter, Tumblr and normal old web sites for your Django projects. Updates Below: 19.09Talk has ended. I’ll try to find the slides and post them. 18.59Interesting links to read. http://www.asheesh.org/note/preso/pycon09-scraping-fun.html goldb.org/pythonwebscraping.html lxml.de lxml.de/lxmlhtml.html#cleaning-up-html scrapy.org 18.55Talking about designer friends… 18.53 re: html == strings == parseable re: Good for “I only care how many comments are on this page” feedparser: follows standard XML rules feedparser: Good for “I only care about RSS feeds” HTMLParser: good base class for your own HTMLParser HTMLParser: Good for “I have an idea about how I want to handle embed tags” 18.52feedparser, HTMLParser, re Sometimes lxml is too much or you have to parse in real-time (think page-load) Sometimes you don’t care about broken pages or trying to parse … -
DjangoCon 2011 – Advanced security topics
After a great lunch at the food trucks we’re starting off with a talk on “Advanced Security Topcis” by Paul McMillan. I’ve been excited for this talk for a while, it looks like it’s going to be great. An in-depth look (with demonstrations) at the how and why of several advanced security topics. Discussion of ways to improve security of the framework moving forward. You’ll be able to find the slides at http://subversivecode.com/talks/djangocon-us-2011 once they’re up. Updates Below: 17.12The talk is now wrapped up. Stay tuned for “Deployment, Daemons and Datacenters” 17.08Django-secure has a manage.py command called check_secure which tells you what you need to change. 17.05Django Core should have a more secure hashing algorithm by default. BCrypt or something similar 17.04Talk has ended. Answering questions now. A reading he suggested was Web Application Hackers Handbook 17.03The TL;DR: Redirect non-SSL to SSL. Use HSTS if you can Follow the advice of django-secure Configure request rate-limiting for key urls Set URLField.verify_exists == False Don’t send wildcard host requests to Django Avoid random.Random(). Use random.SystemRandom() instead Use django.utils.crypto.salted_hmac() instead of plain MD5 and SHA1 in most cases Namespace cache keys. Namespace hmac Use django.utils.crypto.constant_time_compare() Consider information leakages before they are an issue … -
DjangoCon 2011 – Advanced Django Form Usage
An experience talk from Daniel Greenfeld and Miguel Araujo Django forms are really powerful but there are edge cases that can cause a bit of anguish. This talk will go over how to handle many common solutions not currently described in the core documentation. It will also cover some useful third-party libraries and will end with clarifications about what the state of form features will be in Django 1.4. Updates below: 15.10Talk wrapped up, will post slides once they’re available. 15.02Question: “How to you advocate testing when unittests seem to only cover the django aspect” Answer: “Testing isn’t science, having tests for the django side of forms is better than nothing” 14.58Question Time… 14.57@pydanny and @maraujop wrapping up here. Great technical talk at DjangoCon. 14.56Ticket #27 – Single form field for multiple database fields. Interesting to look at, but probably won’t be fixed. 14.55HTML5 tickets Ticket #16304 Ticket #16630 Django doesn’t handle HTML5 Suggestion to use django-floppyforms if you want HTML5 14.54Problems with Custom Widget Output Oldest ticket #23 is related to forms ComboField is broken Validators are thought to validate simple values because of the way run_validators is coded 14.53Problems with Custom Widget Output Overriding render means indepth knowledge … -
Django-sites-ext
I’m announcing Django Sites Ext – utilities to make administration of content belonging to different sites easier. ChangeSiteMixin is a extends django.contrib.admin.ModelAdmin adding view to change site of an object and restricting specified relations to current site of the edited object. 1. select site view for new objects 2. change form view Source code and example app are available on github: https://github.com/bmihelac/django-sites-ext -
I'm an open-source loser.
Some whining about DjangoDash, my open-source programs and being socially awkward. -
DjangoCon 2011 – Building APIs in Django with Tastypie
Building APIs in Django with Tastypie by Issac Kelly Tastypie is one of a couple of frameworks for building APIs with Django. Issac will go over some of the reasons you might pick Tastypie, and how to implement a Tastypie on top of an existing Django project. Updates Below: 17.48Question time. Great talk. 17.41Just going over examples. You can view the code at https://github.com/issackelly/Building-Web-APIs-for-Django-with-Tastypie-Talk 17.34What else comes with Tastypie: Serialization Methods (JSON, Binary plist, YAML, XML, pretty much anything you want) Authentication Classes (NO-OP, API Key, Http Basic Auth and Digest, again anything you want) Authorization Classes (Read Only, Default Authorized, Django Authorization) Everything is Class based so you can extend it all 17.30Tastypie separates authentication and authorization. 17.29Way to create API with Tastypie #models.py class Project(TitleSlugDescriptionModel): """ Stores the projects that corkboards belong to. Only administrators should be able to set these up """ user = models.ForeignKey(User) members = models.ManyToManyField(User, related_name="ProjectMember") created_on = models.DateTimeField(_('Created On'), default=datetime.now, editable=False) updated_on = models.DateTimeField(_('Updated On'), editable=False, null=True, blank=True) class Meta: ordering = ['-created_on',] def __unicode__(self): return '%s' % (self.title) def save(self, *args, **kwargs): self.updated_on = datetime.now() super(Project, self).save() #Easy Way class ProjectResource(ModelResource): class Meta: queryset = Project.objects.all … -
Web framework focus
Over the years I’ve used, read about, and played with lots of different web frameworks. One of the things I’ve concluded is that none of them are perfect. As with the languages they live on top of, each of these frameworks is a tool that fits certain tasks better than others. One other thing I’ve realized is that the focus of the community effects the type of web sites that are made. In some frameworks there’s a huge emphasis on Ajax integration (such as web2py), then there are others that are more focused with data manipulation and control of flow (such as Django). Now one other interesting thing is that this focus leads to different types of sites being made. Two mammoth examples that come to mind are Amazon and Google. While they’re not the most perfect examples for these purposes, I bring them up because they both are layered more than the average site we work on. There’s Java or C++ behind doing all the number crunching. Then layers of other languages in between. One thing about sites like these is, although they all have Ajaxy components, not one of those pieces is superfluous. It takes so much work … -
DjangoCon 2011 – Real world Django deployment using Chef
After another great lunch (I din’t blog about it this time) we’ll be starting off the afternoons with Noah Kantrowitz and his talk on “Real world Django deployment using Chef” Chef, a configuration management tool, is increasingly popular in the Django community. Many people have yet to take the plunge, and are still managing production [...]