django

django-cart or Satchmo?

I'm looking to implement a very basic shopping cart. Satchmo seems to install a lot of applications and extra stuff that I don't need. I've heard others mention django-cart. Has anyone tried this Django app (django-cart)? Anything to watch for or any other experiences? ...

How can I include user profile's images/logos on django comments

Hi all, I've posted this on django-users but haven't received a reply! So I have my own profile objects for users (subclass of User). One of the fields is imagefield, which is (obviously) used for users to upload their logo/thumbnail. The question is how I can include this on their comments? Any ideas? Thanks in advance! ...

In Django, how do you retrieve data from extra fields on many-to-many relationships without an explicit query for it?

Given a situation in Django 1.0 where you have extra data on a Many-to-Many relationship: class Player(models.Model): name = models.CharField(max_length=80) class Team(models.Model): name = models.CharField(max_length=40) players = models.ManyToManyField(Player, through='TeamPlayer', related_name='teams') class TeamPlayer(models...

PHP/Django/Rails/Flex hybrid demo - need project idea

Let's say you were crazy enough to want to try to combine a number of different technologies just to show that you could do so - what kind of app would lend itself to this type of project as a demo for a potential employer? Specifically I'm thinking of combining the following technologies: PHP/Django/Rails/Flex Does this sound ridicu...

Refactor this Python code to iterate over a container

Surely there is a better way to do this? results = [] if not queryset is None: for obj in queryset: results.append((getattr(obj,field.attname),obj.pk)) The problem is that sometimes queryset is None which causes an exception when I try to iterate over it. In this case, I just want result to be set to an empty list. This co...

How do I create a null field or widget to present form field data as plain text?

Problem: A Modeformset needs to include a dictionary of foreign key values in the form to provide context for the user or at least each value as a field or widget. All the advanced formset usage posts don't cover ModelForms w/extra attributes. Is there a way to include an extra dictionary or show only field values and not the name/value ...

Django Admin app or roll my own?

I'm just starting to use Django for a personal project. What are the pros and cons of using the built-in Admin application versus integrating my administrative functions into the app itself (by checking request.user.is_staff)? This is a community wiki because it could be considered a poll. ...

Web application monitoring best practices

We are finishing up our web application and planning for deployment. Very important aspect of deployment to production is monitoring the health of the system. Having a small team of developers/support makes it very critical for us to get the early notifications of potential problems and resolve them before they have impact on users. Usi...

Django workflow when modifying models frequently?

Hi gents, as I usually don't do the up front design of my models in Django projects I end up modifying the models a lot and thus deleting my test database every time (because "syncdb" won't ever alter the tables automatically for you). Below lies my workflow and I'd like to hear about yours. Any thoughts welcome.. Modify the model. De...

Valid use case for django admin?

I want to build a django site where a certain group of trusted users can edit their profile information. Does it make sense to have each trusted user go through the django admin interface? I'd only want them to be able to see and edit their own information (obviously). It doesn't seem like this fits the way the django people define "trus...

Is Django a good choice for a security critical application?

Is Django a good choice for a security critical application? I am asking this because most of the online banking software is built using Java. Is there any real reason for this? ...

Trying to update a form it does an insertion!

I'm trying to update an object, but I'm getting: "primary key must be unique"... The model for Entry: class Entry(models.Model): title = models.CharField(max_length=250) author = models.ForeignKey(User, editable=False) status = models.IntegerField(choices=data_types.STATUS_CHOICES, default = data_types.STATUS...

How do you create python methods(signature and content) in code?

I've created a method that generates a new class and adds some methods into the class, but there is a strange bug, and I'm not sure what's happening: def make_image_form(image_fields): ''' Takes a list of image_fields to generate images ''' images = SortedDict() for image_name in image_fields: images[image_name] = fo...

Deploying django app on Apache mod_python

I've finished making a site in django called 'kazbah', and I'm trying to deploy. All the code for the kazbah site is in /home/git/DjangoProjects/kazbah and my httpd.conf looks like: <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE kazbah.settings Python...

using django-rest-interface with http put

I'm trying to figure out how to implement my first RESTful interface using Django and django-rest-interface. I'm having problems with the HTTP PUT requests. How do I access the parameters of the PUT request? I thought they would be in the request.POST array, as PUT is somewhat similar to POST in my understanding, but that array is alwa...

django model question ( newbie )

First of all,I'm not into web programming. I bumped into django and read a bit about models. I was intrigued by the following code ( from djangoproject.com ) : class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) def __str__(self): # Note use of django...

How to deploy Django with Spawning

There's no much documentation on how to deploy a Django project with Spawning and yet people are recommending it over apache/mod_wsgi. In another similar question, other SO user suggested me to open a new question specific to Spawning, so hopefully others can share their experiences too. ...

Dynamically adding a form to a Django formset with Ajax

I'd like to be able to automatically add new forms to a Django formset with an ajax function. I.e., the user clicks an "add" button and some javascript will add a new form (which is part of the formset) to the page. Thanks for the help in advance. :-) ...

Django: How to create a model dynamically just for testing

I have a Django app that requires a settings attribute in the form of: RELATED_MODELS = ('appname1.modelname1.attribute1', 'appname1.modelname2.attribute2', 'appname2.modelname3.attribute3', ...) Then hooks their post_save signal to update some other fixed model depending on the attributeN defined....

Query distinct list of choices for Django form with App Engine Datastore

I've been trying to figure this out for hours across a couple of days, and can not get it to work. I've been everywhere. I'll continue trying to figure it out, but was hoping for a quicker solution. I'm using App Engine datastore + Django. Using a query in a view and custom forms, I was able to get a list to the form but then I was not ...