django

south django migrate

I just did: python manage.py schemamigration TestDBapp1 --initial python manage.py schemamigration TestDBapp1 --auto Successfully. But if I: python manage.py migrate TestDBapp1 a lot... and I get sqlite3.OperationalError: table "TestDBapp1_xyz" already exists What could be the problem? ...

geodjango syncdb errors. From geodjango tutorial.

I have followed the geodjango installation(windows XP) and tutorial to perfection I am running django 1.2 When I get to syncdb and run I receive the following. raise ImproperlyConfigured(error_msg) django.core.exceptions.ImproperlyConfigured:'django.db.backends.postgis' isn an available database backend. Try using django.db.backend...

Problem with Django/Dajaxice and international characters

Hi, I am having a problem using Djajaxice with international characters... I have a django template...in that template is the following select: <select name="region" id="id" onchange="Dajaxice.crc.regions('my_callback',{'data':this.value});"> <option value="" selected="selected" ></option> {% for region in regions ...

how know where is the error?

Hi guys, im using a django app (django adzone), well, but im trying to add banners, and django zone tell me " please fix the errors" , but nothing more, i cant see where are the errors. any idea how ill know ? EDITED There's not trace about the error or something like that, is just a django admin message see the images thanks ...

Rails for Java Desktop MVC

I'm looking for a desktop application framework similar to Rails/Django but for Java desktop GUI's: Good ORM (xml, db, whatever) MVC Default directory structure View Helpers / CRUD support Open Source & Mature Basically, I want to define a large number of models for a desktop application either in Java or schemas and have a simplist...

manipulate a string in django to show past/future tense

I'm looking for a way to manipulate a string depending if it's in the past or the future, so I want to: Test to see if it's now or in the future add an "s" to the string Test to see if it's in the past add a "d" to the string I know this has come up before, but didn't find it in a search. Thanks! Wendy ...

Django count related objects

How can I count related objects in Django (in less than N queries, where N is number of object). To clarify, let's say I have tables A and B. Every B is connected to exactly one A. Approach I tried: A.objects.select_related().filter(attr=val) A[i].B_set.count() Of course, for every A[i] I want to find out number of B objects Django e...

Django admin action with file upload - process file content and put it in database

Hi, I want to add some functionality in admin that allows me to upload file and the process it. I already have a model that I can edit trough the admin, but I want to be able to "upload" multiple items with this file processing. How can I achieve this in the admin? ...

Django: POST form requires CSRF? GET doesn't?

Are forms that use the POST method required to have CSRF protection? I'm following a book and the code examples throw 403 errors. I did some searching and it seems as if I need to enable CSRF in all my forms. My questions are: Does Django now require that all POST forms be protected from CSRF? All I need to do to accomplish this is...

django forms with jquery

well ive been searching for the past 3 hours and I cant seem to find a good tutorial on this ... i`m looking for a tutorial on how to make a form "wizard" with jquery and django (I dont know javascript only basics) I need a 3 step wizard ... first step 2 inputs user password if user and password are in db then show 2nd step 2nd ...

Does deleting a Django Model object with a File field delete the storage used for the file?

Does deleting a Django Model object with a File field delete the storage used for the file? Does it delete the file on disk? ...

Django: Update Field Value Based on Other Fields

I am not sure this is even possible without modifying the Admin interface. I have a model called "Quote" that can contain multiple "Product" models. I connect the two using an intermediate model "QuoteIncludes". Here are the three models as they currently stand: class Product(models.Model): name = models.CharField(max_length=100) ...

Django: using intcomma with floatformat

Found out about using intcomma with floatformat here, but have not been able to get it working. Here's what I've done: 1) Add django.contrib.humanize to installed apps 2) Add {% load humanize %} to top of template 3) Using {{ feeditem.distance|floatformat(0)|intcomma }} in the code Interestingly, floatformat:0 and floatformat:"0" did...

Multilanguage support in my Javascript code

Hi, I'm using Django and I need to support multilanguage in my Javascript code. But my Javascript files are into site_media so they are not rendering by the template engine. I would like to learn what is the most common solution for this situation, how do you handle it generally? Thanks ...

'Invalid Syntax' error with two methods in Django views.py

I have two methods defined in views.py. the first one calls the second one: @login_required def form1(request): if request.method == 'POST': form = JobForm(request.POST) if form.is_valid(): obj = form.save(commit=False) obj.user = request.user obj.save() return HttpResponseRed...

Django - using sqlalchemy with a read-only database

I'm using Django to nicely display stats etc from an Oracle database that I only have/want read access to. Because the database has composite primary keys I'm not using Django's ORM layer and I'm using SQLAlchemy instead. The only installed apps I have are my own, and of the MIDDLEWARE_CLASSES I'm only using CommonMiddleware. Based on t...

Using application locale folders instead of the project's

Hi, I'm using javascript_catalog view to have multilanguage support into my Javascript code. But because of this bug: http://code.djangoproject.com/ticket/5494 I couldn't make it. Basically, Django doesn't support this feature for project's locale folder, it only supports for application folders. So I need to have a locale folder for e...

Django/mod_wsgi: First page loads up VERY slowly

Hi folks, I'm trying to deploy my first django site through mod_wsgi (on a VPS that also serves PHP pages). Once the first django page is loaded the site runs pretty quick, but loading up that first page is excruciating - at least 15 seconds, sometimes 30 seconds+. During the first page loadup memory (384MB) is maxed out & other tasks ...

Django can't find my non-python files!

I can't, for the life of me, get Django to find my JavaScript files! I am trying to plug in a custom widget to the admin page, like so: class MarkItUpWidget(forms.Textarea): class Media: js = ( 'js/jquery.js', 'js/markitup/jquery.markitup.js', 'js/markitup/sets/markdown/set.js', 'js/markitup.init.js',...

Jquery datatable pagination

In the below code ,the html loads up and will call group_map set python function.My question is that there is pagination enabled in the system so if a user in page 3 deletes a entry the page reloads and brings back to page 1.How to make the user stay on the same page after deleting an entry Datatable used is from http://www.datatables....