django

Django-registration, template

Hi, where can I find good templates for django-registration? I've found one, but the activation isn't work properly - when user click on activation link he gets: Hello ! Check your e-mail to confirm registration. 7 days left. Instead of ~"Activation succesfull/fail". ...

"dlopen: no suitable image found" in Mercurial

I've got a nasty feeling this is something to do with using 32-bit Python and/or 64-bit Mercurial, but I'm new to Macs and I don't fully understand the background. I'm running Django and I've got Mercurial and Python 2.6 installed (in both cases, the default versions from Macports). I've set 32-bit Python as an environment variable: ex...

weird problem with django templates

hi, while working on templates weird problem occured: when templates are being rendered (i guess), in code, right before the doctype, strange character is being placed. I call it "strange" because if I select it, copy it and try to paste nothing is pasted. This "dot" is seen only if I do "view source" in webkit browsers. now, layout br...

{% url admin:index %} generating wrong urls

Hi All, My django site is served up with the following in Apache's config: WSGIScriptAlias /studio /django/studio/bin/django.wsgi My urls.py looks like: urlpatterns += patterns( 'django.contrib', (r'^admin/', include(admin.site.urls)), (r'^accounts/login/$', 'auth.views.login'), (r'^accounts/logout/$', 'auth.views.lo...

Django. Problems with 'product_set' attribute

I have code c = get_object_or_404(Category, slug=category_slug) products = c.product_set.all() page_title = c.name Code doesn't work with error 'Category' object has no attribute 'product_set' What wrong? I can't found any description about "product_set" on django.org ...

Write to file as Json format?

I have A method for format the ouput as json. My keyword_filter will be pass in this this format: <QueryDict: {u'customer_type': [u'ABC'], u'tag': [u'2']}> <QueryDict: {u'customer_type': [u'TDO'], u'tag': [u'3']}> <QueryDict: {u'customer_type': [u'FRI'], u'tag': [u'2,3']}> In fact this I got from request.GET (keyword_filter=request.GE...

multiple filter parameters in a view

I have a basic search view. It currently queries the db for any objects from a particular client. The view code is as follows: def search_page(request): form = PrdSearchForm() prdlinks = [] show_results = True if request.GET.has_key('query'): show_results = True query ...

Django: How to auto-increment a field that can have multiple of the same value.

I have an app that lets people create tickets, and each Account owner using my app can create tickets. Firstly, should it be unique per account do you think? Or, should it be completely unique? Like this: class Ticket(models.Model): """ An ticket created by an Account holder. """ account = models.OneToOneField('Account...

Cannot Find Placeholder Element in SWFUpload

Hello everyone, I am trying to implement an SWFUpload on a form I have. However, it is not identifying the placeholder. My code is below, can someone help? I'm using jQuery if that helps. Header: <script type="text/javascript" src="{{ MEDIA_URL }}/js/SWFUpload-2.5.0/swfupload/swfupload.js"></script> <script type="text/javascript" src=...

What does '_' do in Django code?

Why does this Django code use _ in front of 'has favicon' has_favicon = models.BooleanField(_('has favicon')) ...

How can I get more intuitive feels about django relationships(like:Many-to-one,Many-to-many )

i use xampp(it has mysql) I was Confused on this django relationships, who can give me a code example(or text) to let me feel it intuitive .thanks (like:Einstein described the theory of relativity) ...

I've never seen 'class __proxy__' before, what does this mean(I only have seen that like def __str__)

this code is in the django.utils.functional.py class __proxy__(Promise): thanks ...

how can i get all of python Reserved Words which has 4 Underline(__str__),because django made many function with 4 '_'too

i can't Distinguish them for example in django: def __wrapper__ def __deepcopy__ def __mod__ def __cmp__ thanks ...

Getting my head around django model relationships, forms, and jquery

Hey all, I'm fairly new to both django and jquery, but have a couple years of general oo programming experience (mainly flash/flex/cf), and I'm trying to figure out the best way to implement a form for a sports tournament that manages a few model relationships and uses some simple jquery to improve usability. My models look like this: ...

Django File Upload: How do I handle the file?

Hi everyone, I have read the documentation several times, but I am still confused. When you specify a model in Django, you can specify the file's destination. However, in the documentation, they go on a great deal about handling the write to disk manually. My question is: Is it better to just say form.save() or to write a file handler w...

HTTP 411 error with J2ME -> nginx + apache + django

We have a web based application in production built using django. It is deployed on nginx proxied with apache which handles the django app via WSGI. OS is Ubuntu. In addition to the web based front-end, we recently developed a J2ME client for uploading files via mobile phone. The J2ME transfers the file with Transfer-Encoding set as "Ch...

How to give package names to django javascript_catalog view?

From django documentation: js_info_dict = { 'packages': ('your.app.package',), } urlpatterns = patterns('', (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), ) Each string in packages should be in Python dotted-package syntax (the same format as the strings in INSTALLED_APPS) and shou...

Django 1.1 FormWizard, Dynamically extend form

Hi, I am trying to create a multipage form, where the number of field elements on the second page is defined by the answers given on the first. I have a formWizard set up and my understanding is that I need to use process_step() to alter the setup for the next page. I can either extend an existing form definition to add more elements,...

Django sending email

In PHP I can send an email simply by calling mail(). In Django, I need to specify SMTP backends and other things. Is there a simpler way to send email from Django? ...

Django: which context belongs to which template

Hi all, I'm on the verge of testing attributes in response.context with django's own test client (in django.test.client). I get back 5 response.context's. As it seems one for each template part, because when I remove a nested template part (e.g: {% include "sometemplate.html" %}) from the base template the amount of returned context's ...