hello,
I don't know if it's possible but I'd like to add few parameters at the end of the URL using middleware. Can it be done without redirect after modyfing requested URL?
ie.
user clicks: .../some_link
and middleware rewrites it to: .../some_link?par1=1&par2=2
Other way is to modify reponse and replace every HTML link but it's not ...
First we upload the video file and try to convert in .flv video file if convert the video file in .flv file then no problem and if not able to convert in .flv file then show messages like this video format is not supported..bcz some video file not converted in .flv like(swf)
...
The Django Book has a neat content publishing template. Anyone knows if it's available for public use?
Alternatively, what Django sources would you recommend as an easy to use, out of the box CMS?
...
I am trying to use django-multilingual and setup it properly. But what I found is that everything is clear for django-multilingual except a template usage example.
I just started to use django and I don't know, maybe because of this reason, I cannot figure out how to switch between languages on template side.
Is there any example that ...
Hi, please excuse me for my ugly english :p
I've created this simple model class, with a Preprocessor to reduce my
photos'quality (the photos'extension is .JPG):
from django.db import models
from imagekit.models import ImageModel
from imagekit.specs import ImageSpec
from imagekit import processors
class Preprocessor(ImageSpec):
qu...
I'm adding search to an existing Django site, using Haystack with a Solr backend. I want my search to work across several different models, and return a single set of of results.
When iterating through the results, I would like to format each result based on what model type it is -- e.g. if the result is an Apple, use one result templa...
I'm using Django's render_to_response to write data out to an html page, but I'd also like that render_ to _response call to load a python dictionary into a javascript associative array. What's the best way to do this?
...
I have a problem about markdown and django integration. After I installed markdown and change my model class to:
class Page(models.Model):
class Translation(multilingual.Translation):
title = models.CharField(verbose_name="Title", max_length=30,
help_text="Put a title (max. 30 chars) of your page -e.g. About, CEO, ...
Hi,
This might be a very dumb question but I can't find an answer anywhere. I was wondering how do you handle events in Django. I've read the tutorial in their webpage and I cant find a sign of explanation or I'm missing it.
I work in ASP.NET webforms and the way to do that, as you probably know, is putting the event name in the ASP.NE...
If there is a painless way of runtime urlconf modifications? e.g. based on database records?
Bruteforce soluttion:
r('^(.*)/', handmade_router_function)
is too brutal for me :)
Thanks in advance!
UPD:
I understand that i can directly modify urlpatterns from my code, but it is requires a lot of hand-coding (custom admin-save actions...
Hello (please excuse me for my bad english ;) ),
Imagine the classes bellow:
models.py
from django import models
class MyModel(models.Model):
content_type = models.ForeignKey(ContentType, verbose_name=_('content type'))
object_id = models.PositiveIntegerField(_('object id'))
content_object = generic.GenericForeignKey('con...
I have a tree like structure created out of models using ForeignKey
linkages. As an example:
Model Person:
name = CharField
Model Book:
name = CharField
author = FK(Person)
Model Movie:
name = CharField
director = FK(Person)
Model Album:
name = CharField
director = FK(Person)
Model Chapter...
I am developing an issue tracking application in Django, mostly for a learning exercise but also for my own projects - and I am looking into using some AJAX for "enhanced" usability. For example, allowing users to "star" particular issues, which would add them to their watch list. This is implemented in a lot of sites, and is often AJAX ...
I want to be able to show if an Image has been associated with each Product from the list_display view.
I seem to be having trouble because I'm dealing with an associated object.
models.py
class ImageMain(models.Model):
"""This is the Main Image of the product"""
product = models.ForeignKey(Product)
photo = models.ImageFiel...
Actually, somewhere in the view:
dif = datetime.timedelta(days=1)
today = datetime.date.today()
yesterday = today - dif
ex = Fact.objects.filter(fecha_fact__lte=today ,fecha_fact__gte=yesterday )
It results to this SQL Query:
SELECT `facts_fact`.`id` ...
FROM `facts_fact`
WHERE (`facts_fact`.`fecha_fact` >= 2009-09-21 AND `facts_fac...
I'm planning to create a website using django that will have a common header throughout the entire website. I've read django's documentation on templating inheritance, but I can't seem to find an elegant solution for the "dynamic" elements in my header.
For example, the header in the website will include tabs, say similar to http://www...
Ok, I am working on a Django application with several different models, namely Accounts, Contacts, etc, each with a different set of fields. I need to be able to allow each of my users to define their own fields in addition to the existing fields. I have seen several different ways to implement this, from having a large number of Custo...
I'm attempting to extend django's contrib.auth User model, using an inline 'Profile' model to include extra fields.
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
class Profile(models.Model):
user = models.ForeignKey(User, unique=True, related_name='profil...
I have a form that redirects to the same page after a user enters information (so that they can continue entering information). If the form submission is successful, I'm returning
HttpResponseRedirect(request.path)
which works fine. However, I'd also like to display some messages to the user in this case (e.g., "Your data has been s...
I'm using PyWin32 to make WMI calls to the system in python from my django web application. My goal is to allow users to add printers to the system via a web interface. To do this, I'm using win32print.AddPrinterConnection.
This works well running the development server under my user account. I can add all the printers I want. However, ...