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...
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...
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...
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
...
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...
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...
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. ...
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...
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 ...
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 :
...
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...
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...
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...
MYTable.objects.filter( where id = 42, 55, 65, and 55)
and it returns a query set ?
...
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?
...
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)...
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 *> ...
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...
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...
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 ...