django

Django authentication middleware denies login consistently

Preface: I taught myself how to use Django a couple of years ago, developed a webapp, handed the keys to my clients, and haven't had to do much with the app since then, nor have I developed with Django since then. The Problem A lot of users cannot log in successfully, and this appears to be a persistent problem for those it affects. Ho...

When should I use escape and safe in Django's template system?

If I have a box where people put comments, and then I display that comment like this...should I escape? {{ c.title }} ...

Django Double Slash in URLS Issue (Multiple Webservers, Apache and Nginx)

To see an example: load up a example.com, click on a link that's linking to /test and instead of going to http:// example.com/test/ it goes to http:// www.example.net//test/ Or if you login, the login form for the auto-generated django admin section posts to //admin instead of admin. Seems like this is a django issue, but the only thin...

Loading a fixture before a south migration run

Hi, I've made a mistake of creating my own User model and am trying to recover. I've created a south migration that copies my old user models and creates django.contrib.auth.models.User models. To ensure my current users don't get left in the dark, I created a bunch of unittests to ensure everything gets converted appropriately. So, I...

Django Admin Interface - Custom App Name

Using the 'app_label' in the 'Class Meta' will solve this problem. But it won't create tables while issuing 'syncdb' command. Because the app name won't match with INSTALLED_APPS entry. Is there any way to achieve both (custom app name and creating tables with syncdb) ...

generate link on the same page + 1 variable

Tell me plz, how i can generate link on the same page with the same variables. In my case i have some url with (?P\w+) and **kwargs and on getting page is GET form. And in one moment I want to use link, which add variable to my view (in my case, for {% regroup %}), how i can generate this link. If i use {% url %} i can lost request.GET d...

Nested dictionaries and Django template.

When there is a dictionary: menu = {'title': 'Link1', 'children': {'title': 'Child of Link1', 'children': #etc..} } How would one iterate over it so that the output becomes: <ul> <li>Link1 <ul> <li>Child of Link 1 <ul> <li>Grandchild of Link 1 ...

django admin inlines (and nested inlines) : how can I get this functionality?

I'm a little confused as to why this sort of functionality isn't default in the admin, but maybe someone can give me a few hinters to how to go about it. I have a projects application which keeps track of projects and is to be edited through the admin. Each project has numerous ForeignKey related models (links, flatpages, video, image ...

Custom django template tag issue on AppEngine

So I have beating my head against the wall on this. I feel like I have interpretted the docs and examples I found, but this just won't seem to go away. Here is the tag code: from google.appengine.ext import webapp register = webapp.template.create_template_register() def test_tag(): return "TEST!" register.simple_tag(test_tag...

How to create custom permission (user role) in Django ?

I have simple question. How to create user role in Django without creating it in DB manually ? EDIT: I need to create specific permission. So only users with this permission can change specific field of model. I just need make one field 'readonly' for some users. Is it possible in django? ...

Python/Django: Have DB TimeZoneField for user, how do I use that with datetime and time to get strftime() like '%Y-%m-%dT%H:%M:%S.000Z'?

I have a DB "TimeZoneField" type for users, how do I use that with the "datetime.datetime()" object to get a strftime() string like '%Y-%m-%dT%H:%M:%S.000Z'? ...

Django Admin: How do I filter on an integer field for a specific range of values

How do I create a filter in Django Admin to only display records where an integer value lies between two values? For example, if I have a model Person, which has an age attribute, and I only want to display Person records where age is between 45 and 65. ...

What sites using geodjango?

I look in http://www.djangosites.org/tag/geodjango/ but i wish know about more sites using geodjango. ...

get Django model class name into a field

I have tried multiple aproaches, but as I cannot use self in the class body, self.__class__.__name__ is not available. Would I need to override the save method to do this? Thanks for your help. ...

Django Not Permitting POSTs From Google Web Toolkit

I'm trying to get Google Web Toolkit to work with Django through GETs and POSTs, following the examples here. When GWT sends a POST, however, Django sends back an HTTP 403. My question is then, is Django set up to not receive POSTs? Is there some setting I need to change? Or is there something wrong with the way GWT is sending the POST?...

Django code or MySQL triggers

Hi. I'm making a web service with Django that uses MySQL database. Clients interface with our database through URLs, handled by Django. Right now I'm trying to create a behavior that automatically does some checking/logging whenever a certain table is modified, which naturally means MySQL triggers. However I can also do this in Django, i...

django extends problem - the child template is not showing

hi, I've already configured the necessary things to work the extends template function in django. here's my codes: in settings.py def my_dir(): import os.path return os.path.abspath(os.path.dirname(__file__)) TEMPLATE_DIRS = ( my_dir() + '/app/templates', ) #dynamic template directory in base.html - located in app/templates/s...

Getting a 'Segmentation Fault' when executing a particular Django query

I've never come across this before, but for some strange reason i am getting a Segmentation Fault when running a specific query in Django. On reading up about Segmentation Faults, it seems it might have something to do with the version of Expat that Apache and Python use (and that they are different), what i am unsure about though, is wh...

jQuery FlexBox: how to retrieve user's query & process submitted form?

I'm trying to learn how to use jQuery FlexBox. Getting confused: My understanding is that as the user is typing into the FlexBox, what he types will be sent to the server through ajax. I'm using Django on the server side to do autocomplete, but how do I actually retrieve what the user has typed? Is the query being sent as a parameter? ...

Django - CurrentUserField

I was just exploring http://code.djangoproject.com/ticket/1132 I am receiving 'undefined' error while using 'models.CurrentUserField' . Is this supported by Django 1.2.3? ...