Relative Content

Tag Archive for django

Restrict access to backend

This might be one of those “not answerable” or “just opinions”-questions but I thought I’d give it a shot.

Handling table name collisions in Django

Django creates a table name by joining the app label with the model name. A project can have many apps. If two have the same label, how can both be used in the same database?

How to dynamically add new posts once they are created

I am trying to design an application where users can make posts with Django on the backend. Right now I have to refresh the page with JavaScript every 20 or 30 seconds to check for new posts that might be available for that page. I was wondering if there are more effective ways to do this? Maybe with a JSON response? I am looking for a solution like Twitter, where they show how many new posts are available that are not on the page or even like on Facebook where they update the wall posts automatically.

Does it violate the DRY principle to use an MVC server-side framework and a client-side MVC framework

When using a MVC pattern for server side code (in my case django), the model definition is defined once in the model component. When using a client side MVC based library(in my case backbone) the model definition or some subset is redefined. If I were to make a change to my server side model definition, let’s say add a field to a model, then I would have to make a similar model change to my client side model definition to include that new field.

Unit testing in Django

I’m really struggling to write effective unit tests for a large Django project. I have reasonably good test coverage, but I’ve come to realize that the tests I’ve been writing are definitely integration/acceptance tests, not unit tests at all, and I have critical portions of my application that are not being tested effectively. I want to fix this ASAP.