What can I do to prevent slugify filter from stripping out non-ASCII alphanumeric characters? (I'm using Django 1.0.2)
cnprog.com has Chinese characters in question URLs, so I looked in their code. They are not using slugify in templates, instead they're calling this method in Question model to get permalinks
def get_absolute_url(self)...
Hi!
I've enabled the django request processor
TEMPLATE_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
)
Still i don't have to request variable available in templates.
I've...
Hi,
I've got a set of models that look like this:
class Page(models.Model):
title = models.CharField(max_length=255)
class LinkSection(models.Model):
page = models.ForeignKey(Page)
title = models.CharField(max_length=255)
class Link(models.Model):
linksection = models.ForeignKey(LinkSection)
text = models.CharFiel...
The authentication model provided along with Django is based on
username.
What to do to change the authentication based on email instead of
username?
To be more specific:
With username authentication, to login user we do the following:
user = authenticate(name,password)
.......
login(request,user)
What to write for the above sta...
Hi all,
has someone a detailed description (if any) of a working installation of Django on Windows under IIS7? Already looked at PyISAPIe, etc. (and relative sites, groups, forums) but all description are somewhat inaccurate and until now I've been unsuccesful. The apparently fastest solution(PyISAPIe) seems to have some bugs as from the...
I'm working with the basic_project of Pinax and I need to change the default language of the application from english to french or to spanish
I'd tried changing the variable
LANGUAGE_CODE = 'es',
but it remains in english, even the admin, so Im guessing this change does not have any effect at all.
where can I continue looking for m...
I'm searching for a workflow library/framework for Python. I'm astonished that there I cannot find anything which is simple and not attached to Zope/Plone.
Does anyone know of an open-source, simple workflow library/framework. It's preferred to support Django, but not required.
...
Hi, I encounter a problem.
In my user models there is an atrrbution: user.avatar = ImageField
('avatar', upload_to=AVATAR_TEMP_DIR, blank=True, null=True)
then i use a modelform as an create user form. And the avatar is
uploaded corrcet. Which upload to AVATAR_TEMP_DIR, then I move the
avatar into AVATAR_ORIGINAL_PATH and make user.avata...
Suppose I have a simple view which needs to parse data from an external website.
Right now it looks something like this:
def index(request):
source = urllib2.urlopen(EXTERNAL_WEBSITE_URL)
bs = BeautifulSoup.BeautifulSoup(source.read())
finalList = [] # do whatever with bs to populate the list
return render_to_response('...
I'm looking for a web framework or an application in Java that does what Django admin does - provides a friendly user interface for editing data in a relational database. I know it's possible to run Django on Jython and that way achieve a somewhat Java-based solution, but I'd prefer something pure-Java to keep the higher-ups happy.
...
I have a two models:
class Category(models.Model):
pass
class Item(models.Model):
cat = models.ForeignKey(Category)
I am trying to return all Categories for which all of that category's items belong to a given subset of item ids (fixed thanks). For example, all categories for which all of the items associated with that catego...
How do I use Dojo in my Django application? Please show me comprehensive examples on how to do this.
Any links to sample code for this combination will be appreciated
NB: I also don't mind examples using Dojango.
...
I currently have three models:
class Request(models.Model):
requester=models.CharField()
dateRequested = models.DateField(auto_now=True)
title= models.CharField(max_length=255)
description = models.TextField()
class RequestType(models.Model):
requestType=models.CharField('Request Type', max_length=256)
class Reques...
I have Django deployed with mod_wsgi in daemon mode for apache2.2. So after Django churns out the content, does it hand off everything to apache from there to have it served in its optimised glory or is Django still somehow taxed in this serving step?
...
Here is the question how do I use reverse for the generic view object_detail?
If I use it like the following, the error message will be:
NoReverseMatch at /comment/add/
Reverse for '' with arguments '()' and keyword arguments '{}' not found.
in views.py:
urlresolvers.reverse('django.views.generic.list_detail.object_detail')
...
I use a snippet in http://www.djangosnippets.org/snippets/1034/ for my Model inheritance. It works fine at the first. However, after I delete some elements in database, the code works wrong.
As I debug, I found that the problem is reside in the method: as_leaf_class.
In the following code:
if (model == Meal):
return self
return mode...
I am looking into using the paypal NVP API to allow users to pay on my website for a recurring subscription.
I have a few questions about the requirements. Will my site have to meet the "PCI Compliance" stuff. I guess I will have to get an SSL certificate and is there anything else that is required or that I need to know about?
...
What is the optimal query to obtain all the records for one specific day?
In my Weather model, 'timestamp' is a standard DateTimeField.
I'm currently using
start = datetime.datetime(2009, 1, 31)
end = start + datetime.timedelta(hours=23, minutes=59, seconds=59)
Weather.objects.filter(timestamp__range=(start, end))
but wonder if there...
Let me preface by I am just starting Python so if this is really a simple question ^_^
I have a html file with the following content:
{%for d in results%}
<div class="twt">
<img src="{{ d.profile_image_url }}" width="48px" height="48px" /> <span> {{ d.text }} </span>
<span class="date">{{ d.created_at }}</span>
</div>
{...
How to specify custom constraint for Django model?
Like that
create table t
(
login varchar(10),
unique ( upper(login) )
);
...