Hi, after running: "python manage.py runserver", I'm getting the error:
Validating models...
Unhandled exception in thread started by <function inner_run at 0xc942a8>
File "/home4/usr/.local/lib/python/Django-1.2.1-py2.4.egg/django/core/management/commands/runserver.py", line 48, in inner_run
self.validate(display_num_errors=True)
File...
I'm new to web development was looking into getting into it for the first time. A friend recommended Django which apparently semirecently released version 1.2. Are there any good books out yet for 1.2?
...
Please see the folder structure image in the above url mentioned please advice which structure would be best suited for better code managibility. If the above image is not gettign please use this url http://www.freeimagehosting.net/image.php?387990357b.jpg
...
I have a webapp built with Django. I'm currently running it off a laptop at home behind a router.
I have the router configured to route all traffic sent to a specific port to that laptop.
I have Nginx as a reverse proxy for Apache, using mod_wsgi to run Django.
My problem is this: when I try to submit any POST form, the port # gets r...
I have a Django application which edits a database table, which another application polls and uses to update a downstream system. In order to minimize processing when the database has not been altered in between polls, I would like to use a global modification time for a model, which is updated every time a row is created/deleted/modifi...
Hi,
I know how to do this:
class CalendarWidget(forms.TextInput):
class Media:
js = ('animations.js', 'actions.js')
But then i get something like: "<script type="text/javascript" src="http://media.example.com/animations.js">"
What I want is something like this:
<script>callMYFunction(sdf); </script>
By doing something ...
I'm filtering a big number of users based on attributes. For example, they can be filtered by minimum gpa.
So far I've been doing the following to construct my queryset-
('gpa_gt' just means that the gpa property has to be greater than whatever is the query param)
if len(request.GET) != 0:
kwargs = {}
if request.GE...
I have set up nginx to handle SSL requests and send them to Apache/mod_python as described in http://code.google.com/p/mango-py/wiki/SSLRedirect. I added the django Middleware. I do proxy_set_header in nginx as described in http://yuji.wordpress.com/2008/08/15/django-nginx-making-ssl-work-on-django-behind-a-reverse-proxy/. This is intend...
Hello!
I have such model:
class Place(models.Model):
name = models.CharField(max_length=80, db_index=True)
city = models.ForeignKey(City)
address = models.CharField(max_length=255, db_index=True)
# and so on
Since I'm importing them from many sources, and users of my website are able to add new Places, I need a way to...
Howdy,
I'm using the admin site in django. By default there are the user and group models. I enabled to select the groups when creating a new user and I now want to filter the set of assignable groups depending on the current user. E.g. if the user is a superuser he is able to assign all groups. If he's within a subgroup, he can only as...
I'm using Django with an sqlite backend, and write performance is a problem. I may graduate to a "proper" db at some stage, but for the moment I'm stuck with sqlite. I think that my write performance problems are probably related to the fact that I'm creating a large number of rows, and presumably each time I save() one it's locking, u...
Hello. I wonder if you could help me.
I have a list of data that will be displayed on one page. There is a simple search box, a list of categories and a list of tags that can all be used to filter the list of data. I'm trying to built it from the ground up (so it doesn't require JavaScript) but eventually it will submit the search crite...
I am using the Django GZip middleware (django.middleware.gzip.GZipMiddleware) to compress content if the browser allows compression.
If the browser is Internet Explorer (MSIE) and the content is a Javascript file, then the middleware does not gzip the content. My understanding is that the middleware avoids compressing in this case beca...
I'm my Django application I'm fetching all the objects for a particular model like so:
secs = Sections.objects.filter(order__gt = 5)
I pass this varbiles to my templates and i can access all the properties of the Model like section.name, section.id, etc.
There is a model called Books which has a FK to the Sections model. When i iter...
I am using django with apache2 and mod_wsgi with djapian as my search engine.
I have noticed one issues so far:
When i use djapian im stuck in a deadlock when i
call any Xapian method or function (this is explained in this ticket
http://trac.xapian.org/ticket/185)
I used the solution posted there for mod_wsgi. I added WSGIApplicati...
It works perfectly from the admin site. But the code below doesn't work properly(some characters are missing, like Turkish "ı") in some languages.
class Foo(models.Model):
name = models.CharField(max_length=50, unique=True, db_index=True)
slug = models.SlugField(max_length=100, unique=True, db_index=True)
def save(self, *ar...
I have a list of data. This data model has many-to-many fields to both a categories model and a keywords model. The data model itself has a name and description. The data can have multiple categories and keywords.
On the front end, the user can select a number of categories to filter down the data or do a search... So the data shown sho...
How do I submit a javascript object via jQuery to django?
$.ajax({
type: 'POST',
url: '/fetch-items/',
data: {'foo': 'bar', 'foobar': {'spam': 'eggs'} },
success: function(){
alert('yey');
}
});
django part:
def fetch_items(request):
if request.is_ajax():
print request.POST
#output
>>> <QueryDict: {u'foo': [u'b...
The title might not be clear, but I don't know how else to put it..
In the Django documentation it's pretty clear how to mark a text block for translation .. Take this example:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec quam sem, sodales in fringilla nec, lacinia a lorem.
Vivamus vel molestie ante.
So far so go...
I want to store a variable-length list of floats in Django. There is the CommaSeparatedIntegerField, but is there anything like this that I could use? Would it be best to just implement my own CommaSeparetedFloatField or is there something that I am missing completely? Thanks.
...