Is there any way to add template tags into javascript and css files? I would use it for anything from passing in urls to media url links (image paths, etc) to conditional javascript based on user permissions.
I just had a thought that maybe I can serve it up as if it were a template but have the url as my javascript file. Is that the o...
This is something I've wondered about in a couple of frameworks that I've messed around with. Assuming I don't want to automatically log a user in when they register (I want them to activate) how can I make it so a user can't just visit the "register-success" page? Right now, here's what I have:
def register(request):
if request....
We are developing our website in django framework and with python. currently we are looking for an api/a tool to validate the physical addres the user enters. It doesn't need to be vey sophisticated. We just need to avoid spam registrations. For this step, we need to verify if country, state, city, and zipcode are belong to each other. F...
I am using jquery ui dialog to display form. Unfortunately, this function clears hidden input with csrf token inside my form. Can I somehow force dialog not to clear this field or do I have to store this token somewhere and set the proper field myself?
...
I maintain a Django project with a database that has several model constraints that have fallen out of sync with the actual database. So, for example, some model fields have null=False set, but the database permits NULLs for the corresponding database column.
I'm curious if there is a utility, either in Django or a third-party Python sc...
I was wondering about how to control transitions in model data. I found the solution at http://stackoverflow.com/questions/867120/how-to-check-value-transition-in-django-django-admin but when I tried to implement it within my code, something went wrong (I am able to change the status with impunity):
Here is the relevant portion of my ...
Hi, I am trying to get Protovis working in my Django site. Here is my sample code:
<html>
<head>
<script type="text/javascript" src="protovis-r3.2.js"></script>
</head>
<body>
<script type="text/javascript+protovis">
new pv.Panel().width(150).height(150).anchor("center")
.add(pv.Label)
...
Hi everyone,
i just can't seem to find a definitive answer to this issue, and django's irc needs auth to services...
So my question is : how can you force some kind of formatting for FloatFields in template when you're using Django ?
The problem is simple i need simple dot separated numbers like this : 42547.34
And i end up with comma ...
So in my application, users can assign basic privs to other users who don't have privs and also make take them away. However, anybody who has these basic privs may not grant or revoke admin privs. So, in my template where I iterate over the list of site_users (for site_user in site_users), how do I get the privs of site_user?
I can only...
I am running Django under Apache+mod_wsgi in daemon mode with the following config:
WSGIDaemonProcess myserver processes=2 threads=15
My application does some IO on the backend, which could take several seconds.
def my_django_view:
content=... # Do some processing on backend file
return HttpResponse(content)
It appears tha...
Hello,
We are having problems getting the filtering in the admin interface working the way we would like it to.
We have the following:
models.py:
class Person(models.Model):
first_name = models.CharField(blank=True)
last_name = models.CharField(blank=True)
class Affiliation(models.Model):
person = models.ForeignKey(Person)
a...
I'm kind of confused by this because it seems that Django templates have optional HTML filters but this seems to be happening automatically.. I am making this demo app where the user will do an action that calls a python script which retrieves a url, I then want to display this in a new window.. its all fine except when the display comes...
Without using Ajax is there a way to get the value of a selected item. So for example, if I have the below drop down list:
<select name="controllers" id="id_controllers">
<option value="" selected="selected">---------</option>
<option value="1">http://przemeklach.com/api/firstOrder/przemeksController</option>
<option value="5">ht...
I want to be able to create a back link to the referring URL, if the referrer was a view, and if it was not a view, a back link to a default page (Don't ask... it's kind of a weird requirement).
Basically, if the user came to the page in question from another view on the same django site, the back link should be a return to that view.
...
First off, if there is a true, official way of having flash/flex's NetConnections usurp the session/cookie state of the surrounding web page, so that if the user has already logged in, they don't need to provide credentials again just to set up an AMF connection, please stop me now and post the official answer.
Barring that, I'm assumin...
Hi. I have a view like this:
def form1(request):
if request.method == 'POST':
form = SyncJobForm(request.POST)
if form.is_valid():
# do something
in_progress = True
return render_to_response('form1.html', {'in_progress': in_progress})
I would like to know how to set it to refresh the templat...
I'm confused on how to do this, I'm passing in a dictionary with different values, such as "app" which is the name of the app (so that I can better decouple code for easier modularization).. so this is just a simplified example and its not working so I'm wondering how to use the variable "app" within the string that is calling the models...
I've just inherited a Django project for maintenance and continuous development. While I'm a fairly proficient programmer (also Python) I have next to no experience with Django, therefore I need a bit of saneness-checking for my ideas ;)
The current problem is this: the project contains a custom install.sh file, which does three things:...
I want to select all checkbox when i click the top check,
below is my code:
run.html
<script language="JavaScript" src="media/js/jquery-1.4.2.min.js"></script>
<script language="javascript">
$("#selectAll").change(function() {
$(".xxx:checkbox").attr('checked', this.checked);
});
</script>
Select All: <input type="checkbox" id="sele...
Is it possible to enter {{ variable }} into a django flatpage and if so, how?
Thanks!
...