background preloader


Facebook Twitter

Beating Google With CouchDB, Celery and Whoosh (Part 3) « Andrew Wilkinson. In this series I’ll show you how to build a search engine using standard Python tools like Django, Whoosh and CouchDB.

Beating Google With CouchDB, Celery and Whoosh (Part 3) « Andrew Wilkinson

In this post we’ll start crawling the web and filling our database with the contents of pages. One of the rules we set down was to not request a page too often. If, by accident, we try to retrieve a page more than once a week then don’t want that request to actually make it to the internet. To help prevent this we’ll extend the Page class we created in the last post with a function called get_by_url. This static method will take a url and return the Page object that represents it, retrieving the page if we don’t already have a copy. We only actually want to retrieve the page from the internet in one of the three tasks the we’re going to create so we’ll give get_by_url a parameter, update that enables us to return None if we don’t have a copy of the page. The key line in the static method is doc.update(). Django MongoDB Engine. [PostgreSQL] Obter locais próximos (fórmula de Haversine) « Blog do Bragil.

Sabe aquele recurso que algumas redes sociais têm, de exibir os pontos próximos à sua localização?

[PostgreSQL] Obter locais próximos (fórmula de Haversine) « Blog do Bragil

Sim, é possível e bem simples de fazer. A fórmula matemática que faz tudo funcionar chama-se Fórmula de Haversine . Sem mais delongas, vamos ao código: Suponhamos que exista uma tabela de usuários onde exista os campos latitude e longitude. É fácil criar uma query usando a função acima para trazer os usuários mais próximos do seu local, em um raio de 10 Km: Serão listados os usuários que estão a menos de 10 Km de distância de você. OBS: Se quiser usar milhas ao invés de quilômetros, use a constante 3959 ao invés de 6371 na função: Tags: PostgreSQL , geolocalização , haversine. Build a simple GIS web application using GeoDjango and Google Maps — Tutorials v0.9.0 documentation. By the end of this tutorial you will have built a simple GIS web application for viewing, editing, searching and uploading GIS data.

Build a simple GIS web application using GeoDjango and Google Maps — Tutorials v0.9.0 documentation

We first presented this tutorial as part of a three-hour session on Working with Geographic Information Systems in Python during the 2009 Python Conference in Chicago, Illinois. This tutorial has been updated to work with Django 1.3. Example Make sure that the latest version of GeoDjango is installed; see Install GeoDjango. Start PostgreSQL server. su -c 'service postgresql start' Create PostgreSQL user and PostGIS database. createuser -U postgres geouser -S -D -R psql -U postgres -c "alter role geouser with password 'geopassword';" createdb -U postgres -T template_postgis -O geouser geodatabase Download the code and data. Django data visualization with graphviz. Django REST framework. App engine - django. Django on Google App Engine in 13 simple steps : Thomas Brox Røst. Django App Engine. Djangoappengine contains all App Engine backends for Django-nonrel, e.g. the database and email backends.

Django App Engine

In addition we provide a testapp which contains minimal settings for running Django-nonrel on App Engine. Use it as a starting point if you want to use App Engine as your database for Django-nonrel. We've also published some details in the Django on App Engine blog post. Installation Make sure you've installed the App Engine SDK. Clone the following (on those pages you can also download a zip file): If you downloaded zip files then now's the time to unzip everything. Copy the following folders into your project (e.g., django-testapp): django-nonrel/django =><project>/djangodjangotoolbox/djangotoolbox =><project>/djangotoolboxdjango-autoload/autoload =><project>/autoloaddjango-dbindexer/dbindexer =><project>/dbindexerdjangoappengine =><project>/djangoappengine That's it.

Integrating Django with Nose at DISQUS by David Cramer. About a month ago we decided to make the transition off of Django’s test suite over to the Nose runners.

Integrating Django with Nose at DISQUS by David Cramer

Our main selling point was the extensibility, and the existing ecosystem of plugins. Four weeks later I’m happy to say we’re running (basically) Nose with some minor extensions, and it’s working great. Getting Django running on Nose is no small feat. Luckily, someone else has already put in a lot of that effort, and packaged it up all nice and neat as django-nose. I won’t go through setting up the package, but it’s pretty straight forward. A few of the big highlights for us: Xunit integration (XML output of test results) Skipped and deprecated test hooks The ability to organize tests outside of the Django standards I’m wanted to talk a bit about how we solved some of our problems, and the other benefits we’ve seen since adopting it. Test Organization The biggest win for us was definitely being able to reorganize our test suite. Unittest Compatibility Test Case Selection Bisecting Tests.

Voando com o Django no Google App Engine. O Google App Engine é uma ferramenta sensacional para desenvolvedores web.

Voando com o Django no Google App Engine

Uma ferramente certamente útil e que deveria pelo menos ser experimentada por todo desenvolvedor web que se preza :) A primeira linguagem de programação suportada pelo App Engine foi o Python, e hoje a linguagem Java também é suportada.