django

Baby steps to a solution with django and mod-wsgi on os x

I'm running apache / os x and serving up localhost pages to test django on my laptop. I've already verified all the following • python is working fine and up to date (2.5.1) • django available to python and up to date (1,1,0, 'final', 0) • mod_wsgi module is loaded among apache modules in my apache config - Check! • path to django ...

Is Django's admin panel intended to just be temporary scaffolding?

I've been successfully using Django's admin panel for internal users for a while but I recently hit a brick wall while trying to customize it and I'm curious if I'm spending too much time on it. So, my question is: Is Django's admin panel intended to just be temporary scaffolding, that is, to be used only during the initial development ...

jquery-autocomplete does not work with my django app.

Hi everybody, I have a problem with the jquery-autocomplete pluging and my django script. I want an easy to use autocomplete plugin. And for what I see this (http://code.google.com/p/jquery-autocomplete/) one seems very usefull and easy. For the django part I use this (http://code.google.com/p/django-ajax-selects/) I modified it a littl...

set language within a django view

Hi, background: The view is called when a payment service pings back a payment outcome behind the scenes - afterwhich I need to send an email in the right language to confirm payment and so on. I can get the language code back in the request from the payment server and would like to use that along with Django's i18n systems to determine...

(How) Can I use string substitution for working w/ Django’s i18n {% trans %} tag?

I'm looking for something like this: {% trans "There are %{flowers}n flowers in the vase" < flowers:3 %} Now obviously syntax is fake, but it should be sufficient to demonstrate what I'm looking for. Should I cook something of my own? It looks like a common usecase, so I was quite surprised that quick web search didn't return anythi...

Is it a bad idea to change the app_label assignment on existing Django models?

I have the hair-brained idea of grouping models from different existing apps into one big new shiny app. There's not a super important reason I need to do this, but it would be nice to consolidate all of the code in one subdirectory and it would improve the site to group all the models together in the admin_index under the same module he...

Convert SQL query to Django friendly format for application

I have an SQL query thats runs on the Postgres database of my Django based webapp. The query runs against the data stored by Django-Notifications (a reusable app) and returns a list of email addresses that have not opted out of a specific notice type. What I would really like to be able to do is to build an application that does this o...

python, hash function selection

Hello Using Python and Django, I will let my users to give pdf based gifts to their friends, which the said friend will be able to claim pdf by entering to my site from the emailed link. Here is the plan User gives a gives to his friend, enters friends email In the background, a gift model is saved which will contain a uniquely gener...

Python/Django polling of database has memory leak

I've got a Python script running Django for database and memcache, but it's notably runnning as a standalone daemon (i.e. not responding to webserver requests). The daemon checks a Django model Requisition for objects with a status=STATUS_NEW, then marks them STATUS_WORKING and puts them into a queue. A number of processes (created usin...

There is a django option for moodle?

There is a plataform like moodle made in django or some kind of interface django/moodle? ...

InlineFormSet - Get a User ModelForm when the relationship is in the User.Profile model

My end result is to provide a User Permissions Matrix. (django.contrib.auth.models.Permission) Working with three models in this scenario: Office, User, and UserProfile. Users are related to an Office model through the UserProfile model. See below for my model setup: class User(models.Model): # the included django User model class Use...

How can I order elements in this case? - Django

So I have a list of models, don't think the structure of these models is important. In this case Articles. So these Articles are ordered by popularity between a rank of 1 to 100, all the other articles have no ranks. Whenever I update the rank of a model the model with equivalent rank must loose its rank. Any ideas? ...

How can I override the django AuthenticationForm input css class?

I have a django site using the basic django registration framework. I have my login page working fine, but I want to change the css class on the inputs. The form passed to the login page looks to be an AuthenticationForm class. What would be a good way to add a css class to the username, and password fields? ...

How can I make URLs in Django similar to stackoverflow?

I'm creating a video site. I want my direct urls to a video to look like example.com/watch/this-is-a-slug-1 where 1 is the video id. I don't want the slug to matter though. example.com/watch/this-is-another-slug-1 should point to the same page. On SO, /questions/id is the only part of the url that matters. How can I do that? ...

Creating a Cron Job - Linux / Python

Hi I have a Django script that I need to run, I think the commands could be called through bash. Thing is the script causes memory leaks after a long a period of time, so I would like to create an external cron job which calls the Python script. So the script would terminate and restart while retaking the lost memory. Can someone po...

Why is post data copied in Django?

Django code samples involving post data often shows code similar to this: if request.method == "POST": post = request.POST.copy() #do stuff with post data Is there a reason for copying the post data instead of working with it directly? ...

Logout functionality in django

All In django project if 2 template windows are opened and if logout is triggered in 1 window the other window cookies are not cleared.How to delete the cookies also so that the logout will be triggered. def logout(request): //request = redirect('webbie.home.views.loginpage') //request.delete_cookie('user_location') return...

Django url address n't saving into db

I have many fields in my template so,from the front end,when i omit URL field and enter data in to the other field ,the data is getting saved into my db,but when i enter URL field with all other field ,it is not getting to db. Where might ,be i m doing mistake? ...

Django - Two templates inheriting same parent, but nesting one another too?

I'm having some trouble with template inheritance. What I'm trying to achieve is a threaded comment system (using Django's comment framework). This requires comments who's DOM structure virtually identical to be nested. Here's the general layout of the issue: B and C inherit A C is nested inside of B (with include) Template D includes ...

Django South data migration is running twice

I have a migration: ... def forwards(self, orm): for p in products.models.Product.objects.all(): new = cart.models.Product(title = p.title) new.save() def backwards(): ... But when I run migrate it runs through the loop twice. ...