I'm building a very simple page that is a to-do list. It accepts input from a user via a form for new to-dos, POSTs the to-do to the server, then receives (almost) the same data back and adds it to a list. However, every time data is supposed to be sent to the server, the $.ajax function is called twice.
My js:
// todo.js
function onlo...
Using instruction I try to connect Python + uWSGI.
I made default project in a folder /home/sanya/django/pasteurl.
However, have opened it in a browser I get
uWSGI Error
wsgi application not found
Logs contain the following:
binding on TCP port: 9001
your server socket listen backlog is limited to 64 connections
added /home/sanya/dj...
I have a problem with CSRF validation failing on iframes in IE.
I've learned I can fix it if i had access to parent page server
by adding certain headers to my headers according to post http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer, but I have no access to the parent page (third party...
Hi.
I am trying to use django-friends in my app, with no luck.
This app is not well documented and I cannot seem to find any real information about it out there.
Has anyone used this app in their project before? Something that is not a PINAX project.
Any links or ideas will be appreciated.
...
Dear all,
I am new to the world of IT business (serious) development but I have in mind a business idea and still trying to vizualize how the overall infrastructure should work.
I have done some few research for a good technology to deliver the solution. I am very inclined to use Python, MySql, Django (Apache) on the server side and so...
I am considering doing this via a REST API, since I might be needing it further on in the project. But perhaps there's a better way of doing this?
...
I want to refresh a in django that contains temperature data. The data is fetched every 20 seconds. So far I have achieved this using these functions:
function refresh() {
$.ajax({
url: '{% url monitor-test %}',
success: function(data) {
$('#test').html(data);
}
});
};
$(function(){
refresh();
var int = setInterval("ref...
Having a code inspired from http://code.djangoproject.com/wiki/XML-RPC :
from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
from django.http import HttpResponse
dispatcher = SimpleXMLRPCDispatcher(allow_none=False, encoding=None) # Python 2.5
def rpc_handler(request):
"""
the actual handler:
if you setup your urls.py pr...
I want a table which can only have one record. My current solution is:
class HitchingPost(models.Model):
SINGLETON_CHOICES = (('S', 'Singleton'),)
singleton = models.CharField(max_length=1, choices=SINGLETON_CHOICES, unique=True, null=False, default='S');
value = models.IntegerField()
def __unicode__(self):
ret...
I have install python 26, Apache 2.2, modwsgi ap2.2 py26 On windows XP.
and apache loads modwsgi fine.
when I check localhost: apache says - It works!
but when i try to open the Django directory mysite: localhost/mysite i
get :
Forbidden
You don't have permission to access /mysite on this server.
I have re-installed and installed this ma...
The use case I am try to address is a requirement for a user to have downloaded a file before being permitted to proceed to the next stage in a form process.
In order to achieve this, I have a Django Form to capture the user's general information which POSTS to Django view 'A'. The Form is displayed using a template which also includes ...
Hi,
I want to used select box on my admin filter on django.
FOr now django used list_filter on the admin model, and add a list of all data
list_filter = ('data')
and show :
filter
data
- data1
- data2
- ...
but if i v thousand data, i see a big list drop down my admin page...
Is it possible to show a select box with the lis...
Hello,
I have a page where it displays a filtered model instance list and allows users to update some fields of it or add new fields as a form.
I am curious what wpuld be a clever way of doing this, to delete and resave all the input data or make comparison for each data and save edited / new fields& entities.
I would like to mind you ...
I want to add an templatetag to the django admin, how can I go around extending the existing tags without needing to fudge in django.contrib.admin.templatetags?
Update:
Using {% load mytemplatetags %} in the admin templates breaks my server for some reason (im using nginx and throws me a bad gateway for that page). But the file mytempl...
I deploy Django apps using a fabric script that checks out a copy of my project and when everything is in place the source is symlinked and the web server is reloaded (guessing this is a typical approach).
My concern is that the first time the site gets hit after deployment all the python scripts need to be re-interpreted.
I have some ...
I am using a post_save signal on an instance.
In the callback I would like to add elements to the ManyToManyField of this very instance (named 'locales').
Here is my code:
def after_insertion(sender, instance, **kwargs):
locale = Locale(locale='en')
locale.save()
instance.locales.add(locale)
Locale instance is created but...
Hi,
I have an application in Django with a routine which would be available only to the admin. I'm quite new to the python/django world, so maybe my question is trivial. What I want to do is add a button to perform the routine in this application's section of the admin app.
I'm quite confused from there, am I suppose to make a template ...
Hi!
I'm trying to do a form, with gender choices. The user could choice between male or female.
What I have now in forms.py:
class GenderForm(forms.Form):
demo = DemoData.objects.all()
GENDER_CHOICES = [
('Male', 'Masculino'),
('Female', 'Feminino')]
gender = forms.ModelChoiceField(demo, widget=Select(), r...
I've been using south but I really hate having to manually migrate data all over again even if I make one small itty bitty update to a class. If I'm not using django I can easily just alter the table schema and make an adjustment in a class and I'm good.
I know that most people would probably tell me to properly think out the schema way...
Hello everybody.
This may seem like a subjective question. But it is not (that's not the idea, at least).
I'm developing an Advertising software (like AdWords, AdBrite, etc) and i've decide to use Python. And would like to use one of those well known web frameworks (Django, Cherrypy, pylons, etc).
The question is:
Given that it will ...