I'm in the middle of developing an app on Google's App Engine, and one of the features is auth via Facebook Connect. I've got everything set up and working up to a certain level, but in order to test it against my dev machine, I've created a reverse proxy on one of my public facing servers that proxies through to the dev machine.
It all...
Given the following django URL conf. entry:
url(r'^(?P<obj_ctype_name>\w+)/(?P<obj_id>\d+)/$',
views.obj_view,
name='obj_view')
How would I rewrite the parameter (?P<obj_ctype_name>\w+) to enforce that
it may only be one of "foo" "bar" or "baz" and still keep it as a named
parameter?
...
I'm working on a Django AppEngine application using the AppEngine Django helper (google-app-engine-django), and I'm trying to create some initial data to load into my datastore. Here's my directory structure:
.
./__init__.pyc
./index.yaml
./api
./api/__init__.py
./api/models.py
./api/views.py
./api/urls.py
./appengine_django
./manage.p...
Hi guys, i have this error:
Truncated incorrect DOUBLE value: 'asinox'
this error come from my SEO url:
http://127.0.0.1:8000/user/asinox/2010/dec/30/1/este-pantalon-lo-compre-en-plaza-lama-una-aperidad/
"asinox" is the username (usuario), and routing the URL in this way:
(r'^(?P<usuario>[-\w]+)/(?P<year>\d{4})/(?P<month>\w{3})/(?...
I'm curious as to the best-practise way to handle having something appear on every page, or on a number of pages without having to assign the data manually to every page like so:
# views.py
def page0(request):
return render_to_response(
"core/index.html",
{
"locality": getCityForm(request.user),
...
Is there a simple way I can add a "WikiField" to a model I have in my application?
I think the most important requirements are:
A text field that can be added to any model.
simple wiki markup or editor widget that enables text formatting and easy insertion of links and images.
saves revision history with author information, and easily...
Hi all,
I asked this question before, but had no replies, maybe I wasn't so clear.
I'm trying to debug a django project using MySQL database. If I run the admin or trying to use the shell to communicate to the data base every thing is well and I can do every thing. I installed MySQLdb for Python 2.6.
I installed PyDev on my Apatana stu...
I have an AppEngine app that I'm migrating to run in Django, using app-engine-patch to get all the goodness of Django - particularly the Admin interface.
One of my models looks like (partially) this:
class Request(db.Model):
requestor = db.UserProperty(auto_current_user_add=True)
When I display a form based on this model I don't di...
how to convert query list into csv using django thaks before
...
This Is my models.py
class Customer(models.Model):
def __unicode__(self):
return self.name
name = models.CharField(max_length=200)
type = models.ForeignKey(Customer_Type)
active = models.BooleanField(default=True)
class Sale(models.Model):
def __unicode__(self):
return "Sale %s (%i)" % (self.type, se...
"query" = джазовыми
For some reason...when I display it via:
{{ query|safe }}
I get this:
%u0434%u0436%u0430%u0437%u043E%u0432%u044B%u043C%u0438
...
The user entered the word
éclair
into the search box.
Showing results 1 - 10 of about 140 for �air.
Why does it show the weird question mark?
I'm using Django to display it:
Showing results 1 - 10 of about 140 for {{query|safe}}
...
When I do:
return render_to_response()
in Django. How do I set the content-type to UTF-8? So that everything displayed is UTF-8?
...
I'm working on a system which has to handle a number of race-conditions when serving jobs to a number of worker-machines.
The clients would query the system for jobs with status='0' (ToDo), then, in an atomic way, update the 'oldest' row with status='1' (Locked) and retrieve the id for that row (for updating the job with worker informat...
I'm working on a project that has several apps, and want to include a news app for news stories.
However, I'd like to link news stories to objects in my custom app, but use an open source news app to run the news.
At the moment I've simply hacked the chosen news app to add in a ForeignKey relationship with my model.
i.e. a widgets app...
How can I print or iterate over all the variables available in the context from the template code?
I know about {% debug %} but it contains too much information. I'd just like to print variable names available in the current context.
Is there a way to do this without writing custom tag?
...
Hi:
In rails, if I import a css file or javascript file, the url will be like this
<script type="text/javascript" src="some.js?<ETag here>"></script>
if I upgrade the some.js the etag will be changed, so my browser can cache the static resource smartly and update the cache when necessary.
Is there a way to do it in django?
...
My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing currently in your ...
I am trying to de-couple two apps:
Locations - app containing details about some location (town, country, place etc)
Directory - app containing details of places of interest (shop, railway station, pub, etc) - all categorised.
Both locations.Location and directory.Item contain lat/lng coords and I can find items within a certain dist...
I am using a one to one relationship between two models and I need to be able to clear that relationship. However, I cannot find a way to clear(clear(), remove(), etc...) it to remove that relationship, and the Django admin will not perform that operation. Does anyone have experience with this problem? I think I may have to skip the o...