background preloader

Django 2

Facebook Twitter

Deployment

Testing. Webdesign. Sciyoshi's pyfacebook at master - GitHub. Markdown in Python: Overview. Jinja2 Documentation. Jinja2 is a modern and designer friendly templating language for Python, modelled after Django’s templates.

Jinja2 Documentation

It is fast, widely used and secure with the optional sandboxed template execution environment: <title>{% block title %}{% endblock %}</title><ul>{% for user in users %} <li><a href="{{ user.url }}">{{ user.username }}</a></li>{% endfor %}</ul> Features: sandboxed executionpowerful automatic HTML escaping system for XSS preventiontemplate inheritancecompiles down to the optimal python code just in timeoptional ahead of time template compilationeasy to debug. Line numbers of exceptions directly point to the correct line in the template.configurable syntax Additional Information If you can’t find the information you’re looking for, have a look at the index or try to find it using the search function: FAPWS - The kick ass webserver for Python. Dojango-datable - Create Dojo's DataGrids with dojango and django easily. What is it?

dojango-datable - Create Dojo's DataGrids with dojango and django easily

Dojango Data Tables allows you to define table layout and column types in Python instead of JS or HTML. It also includes a few template tags to create HTML required for the dojo.DataGrid in a configurable manner. It can also be used to generate a XLS file or CSV file out of displayed information, so you can either use it as a web UI widget or a XLS generator with Django and Dojango, or both. First, show a nice, scrollable table to the user, then let him/her download the data in preferred format. dojango-datable requires dojango and xlwt. News. Hmarr/mongoengine - GitHub. Django-reversion. Stdbrouw/django-locking - GitHub. Django Packages : django reusable apps, sites and tools directory. Q / django-simple-history / source – Bitbucket.

Package Index : django-anonymizer 0.2. App to anonymize data in Django models.

Package Index : django-anonymizer 0.2

This app helps you anonymize data in a database used for development of a Django project. It is common practice in develpment to use a database that is very similar in content to the real data. The problem is that this can lead to having copies of sensitive customer data on development machines. This Django app helps by providing an easy and customizable way to anonymize data in your models. The basic method is to go through all the models that you specify, and generate fake data for all the fields specified.

Please note that the methods provided may not be able to give full anonymity. Graphite - Enterprise Scalable Realtime Graphing - Graphite. Graphite 0.9.10 has been released and is now available.

Graphite - Enterprise Scalable Realtime Graphing - Graphite

The packages for Whisper, Carbon, and Graphite-web are available via several sources: This release contains a fabulous amount of incremental improvement over 0.9.9. Faster pagination / model object seeking (10x faster infact :o) for larger datasets (500k +) #13643 (Admin changelist page very slow with postgresql and a huge table) - Django - Trac. Postgresql count(*) is a slooow operation because it forces a full table scan.

#13643 (Admin changelist page very slow with postgresql and a huge table) - Django - Trac

It would be nice to have an admin option to disable full counts and only provide previous/next-based navigation. As a workaround you could get this LazyPaginator ​ and write a bit of (ugly) monkey patching: Django Packages : django reusable apps, sites and tools directory. Evaluating Django Caching Options. Caching is one of the first things you can do when you need to start thinking about scaling.

Evaluating Django Caching Options

Among efforts such as query minimization, denormalization, code optimizations, compression, database tuning, indexing, and load balancing, caching remains one of the lowest hanging fruits in methods to lighten your server load and handle huge amounts of traffic. There are many options, and I chose to evaluate a few of the most interesting setups. This is not intended to be a rigoriously scientific test, but more of a first impression of the different caching systems. For all the tests I'm describing, I'm using a single VPS on Rackspace Cloud with 320MB of RAM, a quad-core AMD Opteron 2350HE, and a bleeding edge server stack using Ubuntu Server 9.10, NGINX with UWSGI, Python 2.6, Django 1.1, and PostgreSQL 8.4.

I'm serving the home page view of Django-Mingus, which provides a realistic amount of complexity to the Python side of things and gives us a 9387 byte response. Replacing Django's View function by re-usable Objects. Abstract Never been frustrated doing functional programming in your django views ?

Replacing Django's View function by re-usable Objects

This little module is intended to help you use objects for your views : Replace urls parameters and template context by class attributes.Use inheritance to group common task, do specializations, common decorators...Define template tags in your objects, call instance methods.Define your re-usable library. This code is now quite complete and we use it in production environment. Hello World comparison Consider this example (classic way): urls.py. Celery - The Distributed Task Queue. Cache Machine: Automatic caching for your Django models. Cache Machine hooks into Django’s ORM to provide easy object caching and invalidation.

Cache Machine: Automatic caching for your Django models

One of our primary goals with the rewrite of addons.mozilla.org was to improve our cache management. Large sites like AMO rely on layers of caching to stay afloat, and caching database queries in memcached is one of our favorite tools. AMO heavily favors reads over writes, so we have great cache performance; the hit rate ranges from 90%-98%. However, once something is in the cache, it’s stuck there until timeout (60 minutes). Dziegler's django-cachebot at master - GitHub. Johnny Cache — Johnny Cache v0.1 documentation.

Johnny Cache is a caching framework for django applications.

Johnny Cache — Johnny Cache v0.1 documentation

It works with the django caching abstraction, but was developed specifically with the use of memcached in mind. Dcramer's django-devserver at master - GitHub. Django-history-tables - Project Hosting on Google Code. This app allow you keep a history (aka copies of previous records in the database) for Django Models.

django-history-tables - Project Hosting on Google Code

You should be able to plug this into your project, register models on which you want history to be kept and the rest should just work(tm). Currently this is a proof of concept. Which proofs we can automatically creating normally behaving extra Django models in-place besides your existing models. Therefor we don't need to pickle objects, and we can use every bit of the mighty queryset power directly on it. Pro's: No pickling!! Con's: Double the trouble of schema changes. Django-mssql - Project Hosting on Google Code. Uswaretech's django-design-patterns at master - GitHub. Django Dose - Home. Django-grappelli - Google Code. Celery - Distributed Task Queue for Django. — Celery v0.4.1 (stable) documentation.

The EveryBlock source code. LFS - Lightning Fast Shop: Features. Django tip: Caching and two-phased template rendering. We've launched user accounts at EveryBlock, and we faced the interesting problem of needing to cache entire pages except for the "You're logged in as [username]" bit at the top of the page. For example, the Chicago homepage takes a nontrivial amount of time to generate and doesn't change often -- which means we want to cache it -- but at the same time, we need to display the dynamic bit in the upper right: One solution would be to pull in the username info dynamically via Ajax. This way, you could cache the entire page and rely on the client to pull in the username bits. The downsides are that it relies on JavaScript and it requires two hits to the application for each page view. Haystack - Search for Django.