Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
PostgreSQL and PostGIS installation from source on Mac OS X Lion
This is a cookbook for installing PostgreSQL and PostGIS on Mac OS X Lion from source, as alternative you can install the binaries from EnterpriseDB or KyngChaos. You don't have to install all packages but if you're using Django will be useful. Requirements Xcode with "Command Line Tools": Installation via Xcode > Preferences > Downloads. PostgreSQL Create the postgres user via System Preferences(for simplicity), use "postgres" as username. Compiling and installing PostgreSQL: $ curl -O http://ftp.postgresql.org/pub/source/v9.1.3/postgresql-9.1.3.tar.gz $ tar xzfp postgresql-9.1.3.tar.gz $ cd postgresql-9.1.3 $ ./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ "CFLAGS=-arch x86_64" "LDFLAGS=-arch x86_64" "CXXFLAGS=-arch x86_64" $ make $ sudo make install $ cd .. Create PostgreSQL Database Cluster: $ sudo mkdir /usr/local/pgsql/data $ sudo chown postgres /usr/local/pgsql/data $ sudo -u postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data Start PostgreSQL Server: $ sudo -u postgres /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start After installation add to .profile or .zshrc: export PATH=/usr/local/pgsql/bin:$PATH PROJ4 PROJ.4 is a library for converting geospatial data to different coordinate reference systems. $ curl -O http://download.osgeo.org/proj/proj-4.8.0.tar.gz $ curl -O http://download.osgeo.org/proj/proj-datumgrid-1.5.zip $ tar xzfp proj-4.8.0.tar.gz $ cd proj-4.8.0/nad $ unzip ../../proj-datumgrid-1.5.zip $ cd .. $ ./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ "CFLAGS=-arch x86_64" "LDFLAGS=-arch x86_64" "CXXFLAGS=-arch x86_64" $ make $ sudo make install $ cd .. GEOS GEOS is a … -
#18251 multithreading deadlock in django.models.loading.get_apps – Django
#18251 multithreading deadlock in django.models.loading.get_apps – Django. Und noch eine Sache, die uns vielleicht betreffen könnte – Raceconditions zwischen Django-Threads bei der Initialisierung von Django-Applications. Gibt auch schon einen Patch dafür, der das in den Django Internals behebt. -
Using SELECT FOR UPDATE in Django
Using SELECT FOR UPDATE in Django. Drin was dran steht. Denn der Django ORM kann derzeit keinen SELECT FOR UPDATE erzeugen, aber manchmal braucht man ihn einfach. -
DjangoSites Move Complete
I've finished migrating DjangoSites to it's new home, and everything should be back online. I've got a few tips for migrating simple Django-powered sites if you click through to read the rest of this blog post. -
DjangoSites Move Complete
For the past few years I've hosted all of my projects on a single RimuHosting VPS. It's old, running Debian 5.0, and maintenance and upgrades have become headachy. It isn't easy to run Python 2.7 on old Debian versions, and since I only started using virtualenv relatively recently, things were a real mess. As such, it was time to upgrade the VPS. I made the decision to look around for other hosting options, and eventually settled on Prgmr as the performance-for-dollar ratio seemed much higher to me. I've taken the opportunity to break things down into multiple smaller VPS units to try and keep maintenance somewhat simpler. I can pull a single site's server down without breaking any other sites, and I can upgrade components individually for a single site. Prgmr's pricing makes this possible: Their 'base' is very low - you pay $4 for each VPS plus RAM. Djangosites.org now sits on it's own 512mb Prgmr Debian 6.0 instance. With 128mb taken up with memcached and a small portion to nginx and the operating system, there's plenty of RAM left for my gunicorn worker processes. So how did I move everything across? Although it took me 3 days to … -
DjangoSites Move Complete
For the past few years I've hosted all of my projects on a single RimuHosting VPS. It's old, running Debian 5.0, and maintenance and upgrades have become headachy. It isn't easy to run Python 2.7 on old Debian versions, and since I only started using virtualenv relatively recently … -
Making the django foreign key admin widget more useful
Thanks to a user at Django-snippets, I was able to quickly create an app containing a widget for displaying icons along side the normal related widget for foreignkey fields. The result looks like this: It’s pretty easy to use. Check it out on Github! -
Mining the Social Web: for fun , profit and satisfaction
I have recently read "Mining the social web" By Matthew A. Russell. It was part of my "big data & Natural Language" master plan, and, since the example were in python it looked as a good read. And it is! This is a review I completly agree with: Mining the Social Web is a good start for anyone is going to create scripts to analyze patterns in Social Networks. I've to say that this book -
Using Factory Boy in Django application tests
Factory Boy is a fixtures replacement for Django tests (and not only). In an easy and manageable way you can create and maintain data needed for tests. Fixtures can be hard to maintain. Direct ORM usage isn't the best thing too. Factory Boy is here to help... You can find Factory Boy on github. There is also full documentation of the project. Factory Boy allows you to create factories for models (not only for models). A factory is something like a wrapper that provides data required for object creation. -
Neo 4J Graph Database
In this post, I will give a brief introduction to Neo 4J database, installation and basic usage with JAVA . Firstly, Neo4J is a NO-SQL database. It is used to store data in the form of a graph data structure , i.e. a structure having nodes and edges(called relationships) among the various nodes. This form of database finds its use case in many applications such as storing a social network in systems like facebook , twitter ,etc . More information on what Neo 4J can be found here . Now, coming to the setup of neo 4J graph database. You can download the installation package from the official site here. Save the tar in a local folder and extract the contents. For this post I am going to run a sample code in neo 4j using eclipse(Details about eclipse can be found here). Open the eclipse IDE and create a new project , say “firstNeo4jApp”. Add a class named graphDb.java in the default package. Now here comes the important step, to add the neo4j libraries to the build path of eclipse.(Improperly configured build path can lead to errors while compiling the code). To add the neo4j libraries , right click … -
django CMS 2.3 release candidate 1 available
-
Unofficial mercurial mirror for Django that works
The documentation for Django mentions an “official” mirror for mercurial. Django got us used to a very high standard when it comes to quality. Unfortunately, this is exactly the contrary for this mirror. It’s quite often broken, or not updated, or both. The last itch is that nobody has taken care of it since the […] -
Django-floppyforms 1.0 released
I just pushed django-floppyforms 1.0 to the cheese shop. The previous version (0.4.7) was published quite some time ago and a couple of things happened since then. What is django-floppyforms? This project started from too much frustration trying to customize form widgets in Django. It lets you customize the output of forms using Django templates instead of python code. So, what's new in 1.0? Gregor Mülleger did a GSoC project on Django last summer, aiming to switch Django forms to template-based rendering. His work didn't get merged in Django itself for performance concerns with regards to the Django Template Language but has been added to floppyforms by Jannis Leidel. There is now a nice layout API that lets you completely customize the way forms are rendered. As a side effect, Jannis and Gregor are core committers on the project! Django 1.2 support was dropped, only Django 1.3 and above are supported. Select widgets now support <optgroup>. This change is backwards-incompatible if you have any custom templates for Select widgets and friends (SelectMultiple, CheckboxSelectMultiple, etc.) Keep an eye on them while upgrading. Various areas of the code are now more robust and better tested. If you are hesitant to use it … -
Python is not a Panacea …
… neither is any other language or framework This post was inspired by the serial discussion on the topic “Python vs other language”(in the specific case the other one was PHP, and the question was asked in a Python group so you may guess whether there are any answers in favor of PHP). It is very simple, I believe that every Python developer will tell you that Python is the greatest language ever build, how easy is to learn it, how readable and flexible it is, how much fun it is to work with it and so on. They will tell you that you can do everything with it: web and desktop development, testing, automation, scientific simulations etc. But what most of them will forgot to tell you is that it is not a Panacea. In the matter of fact you can also build “ugly” and unstable applications in Python too. Most problems come not from the language or framework used, but from bad coding practices and bad understanding of the environment. Python will force you to write readable code but it wont solve all your problems. It is hard to make a complete list of what exactly you must … -
DjangoSites Downtime - Server Move
Heads-up: DjangoSites.org will be down, at some point in the next week, while I move it to a new server. Expected downtime is approximately 1 hour to transfer files & database; if your ISP has DNS servers that don't observe TTL then you might not see updates for a while longer. -
DjangoSites Downtime - Server Move
Heads-up: DjangoSites.org will be down, at some point in the next week, while I move it to a new server. Expected downtime is approximately 1 hour to transfer files & database; if your ISP has DNS servers that don't observe TTL then you might not see updates for a while … -
DjangoSites Downtime - Server Move
Heads-up: DjangoSites.org will be down, at some point in the next week, while I move it to a new server. Expected downtime is approximately 1 hour to transfer files & database; if your ISP has DNS servers that don't observe TTL then you might not see updates for a while longer. This is happening as I'm moving DjangoSites to it's own VPS to make it easier to balance available resources between it and my other projects. -
Coding from the inside
Some time ago, a message on the Evennia mailing list asked about "softcode" support in Evennia. Softcode, a defacto standard in the MUX/MUCK/MUSH/MOO world, is conceptually a "safe" in-game scripting language that allows Players to extend the functionality of things without having access to the server source. Now, Evennia is meant to be extended by normal Python modules. For coding game systems and advanced stuff, there is really no reason (in my opinion) for a small development team to not use a modern version control system and proper text editors rather than entering things on a command line without formatting.But there is a potential fun aspect of having an online scripting language - and that is player content creation. Crafters wanting to add some pizazz to their objects, builders getting an extra venue of creativity with their rooms - that kind of thing. I didn't plan to add softcode support to Evennia, but it "sounded like an interesting problem" and one thing led to another. Python is of course an excellent scripting language from the start. Problem is that it's notoriously tricky to make it run safely with untrusted code - like that inserted by careless or even potentially malignant … -
My Trip To Djangocon 2012 Zurich
I'm back from my trip in Zurich for the 2012 european Django Conference. It was great! Great talcks, great organization, free snacks, good WIFI and amazing location. The venue Stadion Letzigrund... a conference in a stadium foyer? YES great idea the location was perfect may be a bit cold in te morning but great talks and a hundreds of laptops wormed it up easly. The topics The trendy -
Announcing PyCon Philippines!
PyCon Philippines 2012, set to occur on June 30 and July 1, is the first Python programming conference held in the Philippines. PyCon is a volunteer run effort that brings together Python developers from a variety of backgrounds and skill levels into a friendly, cooperative environment in order to educate, inspire, and work together - building relationships that transcend the event and can turn into lifelong friendships or even very impressive business alliances. This event is possible due to the hard work and contributions of members of the Manila Python users group, the support of the Python Software Foundation, various members of the Python community, our gracious sponsors, and many others. I'll be there, along with Audrey Roy and Django core developer Malcolm Tredinnick. Hope to see you there! What is Python? Python is an open source programming language used for science, engineering, robotics, entertainment, web development, and more. It is used by organizations such as Google, NASA, Instagram, Pinterest, Mozilla, Walt Disney Animation Studios, WETA Digital, and many more. Interested in attending? Then head to the registration page. The early bird discount ends on June 15th, so buy your tickets now! Interested in sponsoring? Please go to the sponsorship … -
Announcing PyCon Philippines!
PyCon Philippines 2012, set to occur on June 30 and July 1, is the first Python programming conference held in the Philippines. PyCon is a volunteer run effort that brings together Python developers from a variety of backgrounds and skill levels into a friendly, cooperative environment in order to educate, inspire, and work together - building relationships that transcend the event and can turn into lifelong friendships or even very impressive business alliances. This event is possible due to the hard work and contributions of members of the Manila Python users group, the support of the Python Software Foundation, various members of the Python community, our gracious sponsors, and many others. I'll be there, along with Audrey Roy and Django core developer Malcolm Tredinnick. Hope to see you there! What is Python? Python is an open source programming language used for science, engineering, robotics, entertainment, web development, and more. It is used by organizations such as Google, NASA, Instagram, Pinterest, Mozilla, Walt Disney Animation Studios, WETA Digital, and many more. Interested in attending? Then head to the registration page. The early bird discount ends on June 15th, so buy your tickets now! Interested in sponsoring? Please go to the sponsorship … -
Testing with Jenkins, Selenium and Continuous Deployment
My presentation at KharkivPy#4 about Selenium, Jenkins and Continuous Deployment. A lot of people asket me about code samples. There's no samples. There's no python code at all in this presentation. The main purpose of this presentation is that you can build full cycle testing for your project easy enough.For example by using tools like Fabdeploy or even raw FabricTesting with Jenkins, Selenium and Continuous Deployment View more presentations from Max KlymyshynUpdate: video of this presentation in russian -
Let’s talk about password storage
During the course of this week, a number of high-profile websites (like LinkedIn and last.fm) have disclosed possible password leaks from their databases. The suspected leaks put huge amounts of important, private user data at risk. What’s common to both these cases is the weak security they employed to “safekeep” their users’ login credentials. In the case of LinkedIn, it is alleged that an unsalted SHA-1 hash was used, in the case of last.fm, the technology used is, allegedly, an even worse, unsalted MD5 hash. Neither of the two technologies is following any sort of modern industry standard and, if they were in fact used by these companies in this fashion, exhibit a gross disregard for the protection of user data. Let’s take a look at the most obvious mistakes our protagonists made here, and then we’ll discuss the password hashing standards that Mozilla web projects routinely apply in order to mitigate these risks. A trivial no-no: Plain-text passwords This one’s easy: Nobody should store plain-text passwords in a database. If you do, and someone steals the data through any sort of security hole, they’ve got all your user’s plain text passwords. (That a bunch of companies still do that … -
New Django mercurial mirrors aimed at production servers
When Django was still using subversion, I used to mirror stable branches (1.2 when I started, 1.4 recently). This worked well and I could clone those repositories on production servers, and then it was just a matter of ‘hg pull -u’ to bring updates/fixes. Now.. Django has moved to git. I won’t comment on how […] -
Selective restore from database backups with Django
Selective restore from database backups with Django When things go wrong and you lose your database, backups will help save the day. If the whole production database is corrupted or lost, it’s simple to throw it away and restore it in its entirety from the latest backup. If data loss caused by a user error has remained unnoticed for some time, valuable data may since have been stored, and restoring a complete backup is not an option. In such cases it’s useful to be able to do a partial restore of one or more tables while keeping the rest of the database. For these complex cases, I’m going to describe a technique for restoring a subset of the data in one or more relational database tables using Django. Django 1.2 or later is required since this technique depends on having multiple database connections (see Django’s multi-db support). This opened the possibility to copy data between databases using the Django ORM. To cut some corners, I’ll use SQLite as the database engine in the example project. The shell examples assume an Ubuntu server. The example project The victim of simulated data loss is an example project which uses Photologue for managing …