I'm using the Django manage.py runserver for developing my application (obviously), but it takes 10 seconds to completely load a page because the development server is very, very slow at serving static media.
Is there any way to speed it up or some kind of workaround? I'm using Windows 7.
...
Is there a recommended best-practice for storing content that has a complex structure. For example, suppose a typical "article" I am trying to serve may have the following hierarchy:
Header #1
Subheader #1.a)
Text content
Image content
Text Content
Subheader #1.b)
Text Content
Other complex content ty...
I'm developing Django apps on my local windows machine then deploying to a hosted linux server. The format for paths is different between the two and manually replacing before deployment is consuming more time than it should. I could code based on a variable in my settings file and if statements but I was wondering if anyone had best pra...
What are the pros and cons of using open id vs auth? Shoud I do both?
...
Hello
I am curious about the security of default admin panel of Django. For a live Django website, I will be using Django admin for all management and it feels like simply asking username and password at the mysite.com/admin/ url is kinda weak against brute force attemps (or maybe dictionary based attempts. I have very little knowledge ...
I need some help putting together this query in Django. I've simplified the example here to just cut right to the point.
MyModel(models.Model):
created = models.DateTimeField()
user = models.ForeignKey(User)
data = models.BooleanField()
The query I'd like to create in English would sound like:
Give me every record that w...
Hi all,
I need to implement a structure similar to this: example.com/folder1/folder2/folder3/../view (there can be other things at the end instead of "view")
The depth of this structure is not known, and there can be a folder buried deep inside the tree. It is essential to get this exact URL pattern, i.e. I cannot just go for example.c...
I'm getting this error when I use 'startmigration' in South.
My guess is that I have data that is not serializable.
What is the best way for me to determine the offending model?
...
I have the following Model and ModelAdmin classes. However when I view the posts in the admin list page, the created fields are rendered as 2010-03-01 22:15:18.494594. I've tried setting the DATETIME_FORMAT variable in settings.py, but that didn't help. Any ideas how to control the formatting of datetime fields in the admin forms.
PS...
I'm trying to display poll results using lytebox but can't work out how to pass either GET/POST variables to the page I'm calling.
Lytebox is working fine as this loads the page ok:
<a href="/polls/1/results" rel="lyteframe" title="Example Poll" rev="width: 400px; height: 450px; scrolling: yes;">Results</a>
But I want to get the val...
Nearly every kind of lookup in Django has a case-insensitive version, EXCEPT in, it appears.
This is a problem because sometimes I need to do a lookup where I am certain the case will be incorrect.
Products.objects.filter(code__in=[user_entered_data_as_list])
Is there anything I can do to deal with this? Have people come up with a ha...
Template:
<form method="POST" action="/customer/delete/">
<div style="float: right;
margin: 0px; padding: 05px; ">
Name:<select name="customer">
{% for customer in customer %}
<option value="{{ customer.name|escape }}" ></option><br />
{% endfor %}
</select>
<input type=submit value="delete">
</div>
</form>
Views:
d...
<form method="POST" action="/customer/{{ action }}/">
<div style="float: right;
margin: 0px; padding: 05px; ">
Name:<select for="customer" >
<option value="{{ customer.name|escape }}" name="customer"></option><br />
</select>
<input type=submit value="delete">
</div>
</form>
Customer is a model,name is attribute it sho...
TemplateSyntaxError at /tribes/
Caught an exception while rendering: (1146, "Table 'basic_project.topics_topic' doesn't exist")
why ??
thanks
...
Did a few searches but couldn't find anything good about this problem.
I've got the following setup. / (index), /blog/ and /about/. The way I do want it to be displayed, running only one Django instance is blog.domain.com (for my blog app) and all the other urls to run under (www.)domain.com/.
I could surely hardcode the links, forcing...
The setup is a Django based website on an Ubuntu server system with lots of useful information in /usr/share/i18n/locales.
The question: Can I access this pool of wisdom without using Python's locale.setlocale() afore?
The reason: The docs say, that it is
very expensive to call setlocale(), and
affects the whole application.
But in...
My django application has become painfully slow on the production. Prolly it is due to some complex or unindexed queries.
Is there any django-ish way to profile my application?
...
I have models like this:
class IdfPracownicy(models.Model):
nazwa = models.CharField(max_length=100)
class IdfPracaOpinie(models.Model):
nazwa = models.CharField(max_length=30)
class IdfPraca(models.Model):
numer_idf = models.ForeignKey(IdfPracownicy)
[...]
opinia = models.ForeignKey(IdfPracaOpinie)
uwagi = model...
How to print the test field in the following query in django
res=Resources.objects.filter(test=request.profile)
logging.debug(test) # won't work
I wanted to check what this value is compared with..
...
I have a Django project that employs modeltranslation. On the development box, it registers 10 models and works flawlessly.
On the production server, when started it notifies that it has registered "0" models (instead of 10) and doesn't throw any exceptions. However when any admin page that shows a should-be-registered model is visited...