I'm playing around with Django on my website hosting service.
I found out that a simple Django page, which has only some static text, and is rendered from a very simple template I created takes a significant time to render. When compared to a static HTML page, I am getting ~2 seconds difference in the load times. Keep in mind this is a ...
In the same way that you can give fields and models verbose names that appear in the Django admin, can you give an app a custom name?
...
We are writing an application that requires users to have accounts with balances in dollars and points. Is there a pluggable django app already out there that will help us?
...
Does anyone have any simple code samples for Django + SWFUpload? I have it working perfectly in my PHP application but Django is giving me headaches.
...
The behavior was unrelated to the problem as presented immediately below. See the bottom of the post for an explanation. thanks.
Hello,
I am currently experiencing the behavior that the default Manager for a particular Model returns the objects for this Model only once per request or per shell session. Below is a PDB transcript fr...
Weird problem in Django with forms :
I have a Form.class defined like this ...
class MeetingForm(forms.Form):
owner = forms.ModelChoiceField(
queryset=Profile.objects.all(),
widget=forms.HiddenInput() )
date = forms.DateTimeField()
name = forms.CharField(max_length=30)
etc.
And I create new ins...
Lets say I have the following Django model:
class StandardLabel(models.Model):
id = models.AutoField(primary_key=True)
label = models.CharField(max_length=255)
abbreviation = models.CharField(max_length=255)
Each label has an ID number, the label text, and an abbreviation. Now, I want to have these labels translatable into...
As I'm developing unit tests for my django application I find myself running manage.py test over and over and over again. I'm using a MySQL backend and have many models in the project, so the ramp up time to create all of the test databases is about 30 seconds.
How can I use make each unit test faster by keeping the database tables c...
I will be frequently running testcases for my django project. But one
fine day it occured to me that django actually checks the
settings.DATABASE_NAME db actual existence while running testcases.
Why is this so. All I thought was django will be taking the
settings.DATABASE_NAME and creates a test db called 'test_' +
settings.DATABASE_NAM...
Hi,
Can you recommend any resources for learning Django? I have python experience but I've never used Django before. What did you use when you were first learning? I'm particularly interested in Tutorials, code examples and any books that you find particularly good.
Best,
Bruno
...
I'm using flatpages in a site that I'm developing in a locally server. I need to backup the flatpage's data for use it in the final server. Does anyone know how to do it?
...
I'm using something like this in my template
<select multiple="multiple" name="services" id="services" size="5">
{% for service in services %}
<option value="{{service.id}}">{{service}}</option>
{% endfor %}
</select>
When I view the POST data in Firebug or the Django debug, I see it only sends one value. Am I doing som...
Hopefully this is an easy one.
Problem: Django QueryDict wraps values in lists.
This:
data[u'test'] = [u'1', u'2']
Becomes:
<QueryDict: {u'test': [[u'1', u'2']]}>
How do I make it:
<QueryDict: {u'test': [u'1', u'2']}>
...
I often need to execute custom sql queries in django, and manually converting query results into objects every time is kinda painful. I wonder how fellow Slackers deal with this. Maybe someone had written some kind of a library to help dealing with custom SQL in Django?
...
I am writing a backup system in Python, with a Django front-end. I have decided to implement the scheduling in a slightly strange way - the client will poll the server (every 10 minutes or so), for a list of backups that need doing. The server will only respond when the time to backup is reached. This is to keep the system platform indep...
Here's how my university handles authentication: we redirect the user to a website, they enter in their username and password, then they get redirected back to us with the username and a login key passed in the query string. When we get the user back, we call a stored procedure in the university's database that takes the username, logi...
I am using django for running my project. And I am using postgresql_psycopg2 engine for my production db, but the test runner uses sqllite3 for running the tests. Keeping my production db(postgresql)in mind I tried building a query which uses "coalesce". But sqllite3 doesn't recognize this. How do I get pass this. I can use postgresql_ps...
I created a sub-directory of my Django project called bin where I want to put all command-line run Python scripts. Some of these scripts need to import my Django project settings.py file that is in a parent directory of bin.
How can I import the settings.py file from a sub-directory of the project?
The code that I use in my command-li...
Alright, I'm at a loss with the Django Forms, as the documentation just doesn't seem to quite cover what I'm looking for. At least it seems to come to a screeching halt once you get past the most rudimentary of forms. I'm more than willing to take a link to good documentation, or a link to a good book that covers this topic, as an answer...
Another Django Form question.
My form :
class PlanForm(forms.ModelForm):
owner = forms.ModelChoiceField(label="",
queryset=Profile.objects.all(),
widget=forms.HiddenInput())
etc...
class Meta:
model = Plan
Owner, in the model, is a ForeignKey...