django

Visual Editor for Django Templates?

Hello, Is there a tool out there for visually building Django templates? Thanks ...

No reverse error in Google App Engine Django patch?

I am using Google App Engine patch Django. When I try to go to the admin site, http://127.0.0.1:8080/admin/ , I keep getting this error: TemplateSyntaxError at /admin/ Caught an exception while rendering: Reverse for 'settings.django.contrib.auth.views.logout' with arguments '()' and keyword arguments '{}' not found. I...

Why use a web framework (like rails) over php?

This isn't a question about what framework to use. I've learned both Rails and Django, and I write all of my webapps in PHP. My question is why bother with the frameworks? It's always taken me longer to use a framework than to reuse old MySQL code and build "models" with phpMyAdmin. I also like writing everything myself, because I know w...

Converting to safe unicode in python

I'm dealing with unknown data and trying to insert into a MySQL database using Python/Django. I'm getting some errors that I don't quite understand and am looking for some help. Here is the error. Incorrect string value: '\xEF\xBF\xBDs m...' My guess is that the string is not being properly converted to unicode? Here is my code for...

Don't filter in CustomManager.get_query_set()! But what about all(), get(), filter(), exclude() ?

django's manager docs has a paragraph overwritten with DO NOT FILTER AWAY ANY RESULTS IN THIS TYPE OF MANAGER SUBCLASS, but in the following text only mentions get_query_set() Is it save to filter in all(), get(), filter(), exclude()? The reason why I want to do that: I want for the automatic Manager as it gives my the power to control...

can users who have used both Django and Ruby on Rails give a little comparison of using them?

Duplicate: Django or Ruby-On-Rails? I have been reading on Ruby on Rails, and it seems like on some threads, some users like Django a lot too? Can someone who have used both give some insight about using them, such as ease of use productivity fun factor deployment issues or any other framework you'd highly recommend? ...

Zlib in database - Django

When I try to put a zlibbed string in models.TextField >>> f = VCFile(head = 'blahblah'.encode('zlib')) >>> f.save() it fails: ... raise DjangoUnicodeDecodeError(s, *e.args) DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: unexpected code byte. You passed in 'x\x9cK\xcaI\xccH\x02b\x00\x0eP\x03/' (<type...

Naming convention for Django views?

I'm building a website (in Django) and am confused about the right naming convention to use for my functions. Trivial example: let's say I have a page that lets the user decide whether they want to see image A or image B. Once the user submits the decision, the site displays the image the user requested. Here are the two functions I wou...

How can I color certain things in emacs?

I program Django/Python in emacs, and I would like things like {% comment %} FOO {% endcomment %} to turn orange. How can I set up some colors for important Django template tags? ...

Developing Django projects using Git

Hi, I am wondering if anyone has experience working on Django projects in a small team (3 in my case), using Git source control management. The project is hosted on a development server, which is why I am having such a problem. Developers can't see if their code works until they commit their changes to their local repository, then push ...

how to use filter in django

hi, class Status(models.Model): someid = models.IntegerField() value = models.IntegerField() status_msg = models.CharField(max_length = 2000) so my database look like: 20 1234567890 'some mdg' 20 4597434534 'some msg2' 20 3453945934 'sdfgsdf' 10 4503485344 'ddfgg' so I have to fetch values contain a givin...

Django reusable app for like functionality as in friendfeed

I am looking to implement "like" functionallity a bit similar as they do in friendfeed. Is there a django reusable app that already does this? Thanks! Nick. ...

Inline Form Validation in Django

Newbie request that seems difficult to implement. I would like to make an entire inline formset within an admin change form compulsory.. so in my current scenario when I hit save on an Invoice form (in Admin) the inline Order form is blank. I'd like to stop people creating invoices with no orders associated. Anyone know an easy way to...

Model formsets and Date fields.

I have a model formset on a model with a couple of date fields - which again is a DateTimeField in the model. But when it displays in the template, it is shown as a text field. How can I show it as a drop down box ? WFormSet = inlineformset_factory(UserProfile, W, can_delete=False,exclude=[<list of fields to be excluded>], extra=3) T...

Passing variables to a Django generic view template using reverse()

I have a urlpatterns like this: urlpatterns = patterns('', ... (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict, 'poll_detail'), ... My html page template contains this: {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} My view code contains: return HttpRespo...

How to strip html/javascript from text input in django

What is the easiest way to strip all html/javascript from a string? ...

How to 'clear' the port when restarting django runserver

Often, when restarting Django runserver, if I use the same port number, I get a 'port is already in use' message. Subsequently, I need to increment the port number each time to avoid this. It's not the case on all servers, however, so I'm wondering how I might achieve this on the current system that I'm working on? BTW, the platform ...

In Django admin, how to filter users by group?

It gives you filter by staff status and superuser status, but what about groups? ...

Error when trying to migrate django application with south

Hi all, I am getting this error when running "./manage.py migrate app_name" While loading migration 'whatever.0001_initial': Traceback (most recent call last): File "manage.py", line 14, in <module> execute_manager(settings) ...tons of other stuff.. raise KeyError("The model '%s' from the app '%s' is not available in this migrat...

Auto-tab between fields on Django admin site

I have an inline on a model with data with a fixed length, that has to be entered very fast, so I was thinking about a way of "tabbing" through fields automatically when the field is filled... Could that be possible? ...