django

get_model equivalent for ModelForms?

I have a multiple ModelForm classes that each represent a different Model. I would like to have a generic 'create' function that loads the specified model form based on a URL parameter. It is possible to load a model dynamically with this: model_name = 'TestModel' m = get_model('AppLabel', model_name) Does anyone know how I can achiev...

Django error 'Signal' object has no attribute 'save'

I've been struggling with this problem for 5 hours and I have a feeling it's a simple solution that I'm just overlooking. I'm trying to tie in a third party module (Django Activity Stream) that uses a series of senders and receivers to post data about user activity to a database table. Everything is set up and installed correctly, but I...

Hours of attempting to install django and stuck on an urls.py error

I have spend the past 6 hours getting an ubuntu 10.04 server setup with django and mysql. I am using django 1.2.1, and maybe that's my problem. I have everything as I'd think it should be and am receiving this error when I hit http://localhost/admin Request URL: http://192.168.1.153/mydangoproject/admin Django Version: 1.2.1 Excep...

Populating a SQLite3 database from a .txt file with Python

Dear Python Experts, I am trying to setup a website in django which allows the user to send queries to a database containing information about their representatives in the European Parliament. I have the data in a comma seperated .txt file with the following format: Parliament, Name, Country, Party_Group, National_Party, Position ...

Converting WAV audio files to MP3 on a server automatically once uploaded?

I'm working on a project, using Python/Django running on a Virtual Private Server, which allows me a blank Linux server box that I can pretty much install whatever I need. The project must allow users to upload an uncompressed WAV file for others to download. These will most probably be served up using Amazon S3. I'm not expecting a mass...

Django's admin pages are missing their typical formatting/style, have I set it up wrong?

I finally got my django install working, however I'm noticing that the typical look and feel of the admin pages are missing, and it's as if there are no styles applied to the structure of the pages. Do I have some kind of setup issue or pathing issue that's preventing the style sheets from being found? Where are they stored? My pages loo...

Authenticate with OpenID when writing a comment

Hi, I am writing a system of comments in DJango and I want to authenticate my users with OpenID. I see a lot of solutions that integrate DJango and OpenID, but all of these consist on a login form. I don't want to provide a login form to my users (in fact, i don't want to have a users table). In my comment form there is a URL field. ...

in a brand-new django project, django auth tests fail

I make a brand-new django project and do literally nothing with it except give values to DATABASE_USER, DATABASE_ENGINE, DATABASE_NAME, and DATABASE_PASSWORD, and django auth test fail. How is this even possible? I also tried adding TEMPLATE_CONTEXT_PROCESSORS as suggested at http://stackoverflow.com/questions/2507210/django-failing-tes...

implementing dynamic in-game advertising inside flash games

I'm a django(python) web developer. I can also make 2D flash games. I'm planning to make : online flash games distribute them to various websites then use dynamic in-game ads inside these games( ad changes during game play). These ads will not annoy users because ads will be placed inside games elements( will look as if they ...

Add a new language to gtksourceview (Django's template language for gedit)

Edit: I found the problem : in another context, there was a % in a regexp, so the %} was not interpreted. Hello ! I got a problem to add a new language to gtksourceview (used by gedit). I want to add the Django's template language and something does not work : I am not able to make %} stop the syntactic coloring. Here is a snippet : ...

Using FFmpeg to encode audio once uploaded, using Django, VPS (Linux) and Amazon S3

My project will require users to upload uncompressed WAV audio files and once they do, the server will need to encode it in MP3 to serve it on the site. I'm using Django for this project and it'll be hosted on a Linux VPS (from Linode). Due to space and bandwidth, I want to use Amazon S3. I'm not an expert at this stuff, this project wi...

chain filter and exclude on django model with field lookups that span relationships

I have the following models: class Order_type(models.Model): description = models.CharField() class Order(models.Model): type= models.ForeignKey(Order_type) order_date = models.DateField(default=datetime.date.today) status = models.CharField() processed_time= models.TimeField() I want a list of the order types tha...

Customizing Django Admin Result List

How can I change the output result from Django Admin Result List? I've been looking into the change_result_list.html template file but all I can find is : {% for item in result %}{{ item }}{% endfor %} Which will be outputting something like : <tr> <td> <input type="checkbox" class="action-select" value="2" name="_selecte...

How do I do this with Django objects.filter?

MYTable.objects.filter( where id = 42, 55, 65, and 55) and it returns a query set ? ...

How would I determine zodiac / astrological star sign from a birthday in Python?

I am building a dating site in Django / Python. I have birthday dates and need to show what the person's Zodiac sign is based on their birthday. Anybody done this before? What would be the most efficient way of accomplishing this? ...

Django - How can I access model field validators from within form template?

Hi, In my generic form template, if a CharField has a max_length attribute, I display that beside the field. Form template: {% if field.field.max_length %} Max. {{ field.field.max_length }} char. {% endif %} I want to do this for TextFields, where max_length is not used, defined like that in the model: class Entry(models.Model)...

Django With Apache - Double Content In Response

hi there i use an apache to run my django instances. my apache doubles the django output. so in developement i get this: my response text but on apache "production", this: my response text my response text my vhost config look like this: <VirtualHost *> ...

Customising the admin site in django.

Hi, In my django app i have the admin site and I am trying to customise it so that i can keep adding people to the event attendance. My models look like this: class Talk(models.Model): title = models.CharField(max_length=200, primary_key=True) speaker = models.CharField(max_length=200) date_of_talk = models.DateField('date_of_talk') de...

How do I retroactively make AutoFields that don't break django-admin?

I created the models in a Django app using manage.py inspectdb on an existing postgres database. This seemed to work except that all the primary keys were described in the models as IntegerFields, which made them editable in the admin panel, and had to be hand-entered based on knowledge of the id of the previous record. I just learned ab...

Django Model subclass without changing database name

I am making a Django Model decorator which takes a Django model and gives it a few extra methods. Django creates the database name for this Model using: '%s_%s' % (app_name, class_name). When you decorate the Model the table name is suddenly derived from the app name and class name of the decorator rather than the original class (which ...