django

Django testing - InternalError: current transaction is aborted, commands ignored until end of transaction block

In my tests I do not only test for the perfect case, but especially for edge cases and error conditions. So I wanted to ensure some uniqueness constraints work. While my test and test fixtures are pretty complicated I was able to track the problem down to the following example, which does not use any custom models. To reproduce the beha...

Django - dumpdata truncate to last n lines.

Hi all, Does anyone have a simple solution to using (or modifying) dumpdata to trucate a simple table down to the last n lines. I like to use dump data for test fixtures but the data size has gotten so large this doesn't make sense. BTW - I didn't design the table I'm just the sucker which has to deal with it. For those who may ask h...

Apache with two urls and two different SSL certificates

I will ask this with an example - I have a setup, nginx, django, apache ( nginx forwards ssl requests to apache) I have website https://www.xyz.com which has a ssl certificate associated with it and clients use it when connecting. Lets say, I have another domain name www.abc.com, which I want to assign it to the same server as xyz.com ...

Attaching row-level signals in django?

I have two models, a definition: class Indicator(TimestampedModel): some_definition_data = models.IntegerField() and an instance: class IndicatorInstance(TimestampedModel): indicator = models.ForeignKey(Indicator) some_instance_data = models.TextField() I want to attach event code (signals) to Indicator definitions. I s...

jQuery countup timer not working properly

I'm trying to get a countup timer against some timed entries in my app using this jQuery plugin, but it seems the implementation I have works on only Opera...all other browsers give me NaN:NaN:NaN where the timer should be. I've used this code: {% for entry in today %} <tr> <td>{{ entry.description }}</td> <td>{{ entry.start_ti...

using a Django ModelForm doesn't want to work well with a ManyToManyField

Hi, I have a ManyToManyField in a model which uses the 'through' option. Using a Django ModelForm, this seems to be failing giving me a funny error about having to use the model's manager. I want to be able to edit this inline (i think the admin lets me do this) and looked up it on google, but everything to use this Django Inline Forms ...

Why are my forms not returning field errors?

Recently I upgraded my django server. Going from 1.2 to a new version. The forms exhibit a strange behavior. When a field is left blank the whole page simply refreshes, rather than showing errors like I remember. What could cause this? What ought I do to fix it? {%extends "baseAUTH.html" %} {% block title %} {{ title }} ...

Can't get GeoRSS to work

Hi, I need to create GeoRSS view in Django but only got error Exception Type: TypeError Exception Value: __init__() got an unexpected keyword argument 'feed_guid' Exception Location: /usr/lib/python2.6/site-packages/django/contrib/syndication/views.py in get_feed, line 117 I red GeoFeed and Syndication in Django docs many...

Is it possible for a Django template to test for existence of a row in a table without writing a custom tag/filter?

I have the following models: class Post(models.Model): message = models.TextField() (etc.) class UserProfile(models.Model): user = models.ForeignKey(User, unique=True) (etc.) class PostFollow(models.Model): post = models.ForeignKey(Post, related_name='follower_set') follower = models.ForeignKey(UserProfile, rel...

if you don't use scaffolding, is ruby on rails still good for rapid development?

If you take out the scaffolding feature where it creates the model/controller, and CRUD pages for you, is ruby on rails still any faster to market than say, django? It seems very similiar to be if you take away that step...(even though I believe django has similar auto-gen capabilities) I am reading the starting guide on the rails site...

Does django with mongodb make migrations a thing of the past?

Since mongo doesn't have a schema, does that mean that we won't have to do migrations when we change the models? What does the migration process look like with a non-relational db? ...

ASP MVC, Django or Rails?

I've to start my master thesis project and I've to choose a technology to work with. I've used Rails and ASP MVC, in two projects, but never used Django, only some play with it. But I've some experience with python and really like the admin interface. The objective of my master thesis is a creation of portal to a public hospital. I hav...

Django: How to create a complex admin action that requires additional information?

I'm interested in creating an action for the admin interface that requires some additional information beyond the items selected. My example is bulk adding comics to a series. (Yes I know the obvious answer is to create a schema with X-to-X relationships, but bare with me for the sake of a simple example). In this example, I've created ...

Multiple Problems with Django SocialAuth - logging in with facebook, yahoo, google

hello, I am having some problems with the app django socialauth. I am receiving the following errors: no such table: openid_consumer_association I got the above error whenever I click on the google or Yahoo icon for logging in. may I know how do i fix this problem? Another error I am receiving is related to facebook connect. Whenev...

Combining User and UserProfile in the admin

I have been reading up on Django's separation of Users and Profiles, and I have decided to go with a model called UserProfile that is located in an Accounts app as my Profile. The problem is, now I have two separate areas of the admin, one for modifying the User, and one for modifying the User Profile. Is it possible to view the two mo...

django access local testing url

I am running windows xp and django 1.2.1 locally. I was wondering if there is a way to allow outside applications to be able to access a url in my local app. For example I would like the url: http://www.127.0.0.1:8000/my-url to be able to receive push notifications from a webapp while I am working locally. It's a pain to have to upl...

Hide password when checking config file in git.

Possible Duplicates: What is the best practice for dealing with passwords in github? How can I track system-specific config files in a repo/project? Hi, I would like to hide DATABASE_NAME = '' DATABASE_USER = '' DATABASE_PASSWORD = '' DATABASE_HOST = '' Line 13 to 17 of the default Django settings.py file when checking...

How can I add a test method to a group of Django TestCase-derived classes?

Hi all, I have a group of test cases that all should have exactly the same test done, along the lines of "Does method x return the name of an existing file?" I thought that the best way to do it would be a base class deriving from TestCase that they all share, and simply add the test to that class. Unfortunately, the testing framework ...

Django "Duplicate" ModelForm

Hi I'm wondering if there is a simple way of creating a "duplicate" ModelForm in Django - i.e. a form that is prefilled with the content of an existing model instance (excepting certain fields, such as those that are unique), but creates a new instance when saved. I was thinking along the lines of supplying an instance to a ModelForm s...

django most efficient way to count same field values in a query

Lets say if I have a model that has lots of fields, but I only care about a charfield. Lets say that charfield can be anything so I don't know the possible values, but I know that the values frequently overlap. So I could have 20 objects with "abc" and 10 objects with "xyz" or I could have 50 objects with "def" and 80 with "stu" and i ha...