Re: Geo support with Django Rest Framework

2013-10-21 Thread Tom Christie
Hi Sanjay, I would take a look at these two repos: https://github.com/dmeehan/django-rest-framework-gis https://github.com/mjumbewu/django-rest-framework-gis You might also try searching the REST framework issue list as it's likely either or both of these were at some point discussed there. Als

Re: User Created Objects (models)

2013-10-21 Thread Daniel Roseman
On Monday, 21 October 2013 01:24:22 UTC+1, Ideo Rex wrote: > Hello, > I'm relatively new to Django. So I have a working (local) web application. > I can create new model objects from the admin site, but I would like my > users to be able to create their own objects and save them to the database.

How to call url and get json data

2013-10-21 Thread Mahantesh U
Hi, How to call the below url in django in views file: http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=O-lzp4Hyqp8&format=json The above api returns json data which further i need to use and fill those in html file. HttpResponse('http://www.youtube.com/oembed?u

GeoDjango PointField admin visualization

2013-10-21 Thread rok
I was wondering how I could change the default PointField visualization (the Openstreetmap) in admin so that I could enter simple latitude/longitude numbers instead of selecting a point on the map? I looked at this one Latitude/longitude widget for pointfield?

Re: Geo support with Django Rest Framework

2013-10-21 Thread rok
I'm using tastypie for the REST functionality which I have extended so that geolocation can be used as a filter, e.g.: class TestResource(ModelResource): class Meta: queryset = Event.objects.all() resource_name='test' ordering = ['date_from'] def get_

Re: Geo support with Django Rest Framework

2013-10-21 Thread Sanjay Bhangar
Hey Tom, On Mon, Oct 21, 2013 at 1:50 PM, Tom Christie wrote: > Hi Sanjay, > > I would take a look at these two repos: > > https://github.com/dmeehan/django-rest-framework-gis > https://github.com/mjumbewu/django-rest-framework-gis > This is EXACTLY what I was looking for. Obviously, I need to w

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-21 Thread Hanne Moa
Turns out: the auth backend that worked in 1.3 but not in 1.4+ was missing a get_user()-method. I added it in and that was that. HM -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from i

Re: Geo support with Django Rest Framework

2013-10-21 Thread Sanjay Bhangar
Hi Rok, Thank you so much for the reply and code snippets. I think I managed to implement the stuff I needed using the hooks provided by Django-Rest-Framework -- not 100% sure why I picked that over Tastypie for this, but its treating me well, so I'll stick to it .. Since we're sharing code :), t

Re: How to call url and get json data

2013-10-21 Thread Sanjay Bhangar
Mahantesh, On Mon, Oct 21, 2013 at 3:48 PM, Mahantesh U wrote: > Hi, > >How to call the below url in django in views file: > > > > http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=O-lzp4Hyqp8&format=json > > The above api returns json data which further i need to use and fil

Customizing your project's templates

2013-10-21 Thread Sheharyar Hamayun
Ok, so i've copied the *base_site html* to*lotus/pollapp/mysite/polls/templates/admin * . I've opened the html file in a text editor and changed * {% trans 'Django administration' %}* to *{% trans 'Pollapp' %}* However this change doesn't show on the website. My *Template DIRS* is: TEMPLATE_

Japanese named File - FileUpload django admin throws error

2013-10-21 Thread Raaj Supramanian
*class FileUpload(models.Model): cstr = models.CharField(max_length=50) file_nm = models.CharField(max_length=250,editable=False,verbose_name='Name') file_type_cd = models.CharField(max_length=10,editable=False, verbose_name='Type') file_size_val = models.CharField(max_length=25,e

Problem with date field formatting and validation

2013-10-21 Thread Kathy Adamska
I have a custom form displaying ModelForm instance values like so: It works fine displaying the value the first time the form is loaded and saving it in the database. The problem arises when the form fails validation on any field - the field becomes blank. Other fields are not affected. This is

Re: Japanese named File - FileUpload django admin throws error

2013-10-21 Thread François Schiettecatte
Hi I suspect there is a disconnect somewhere between the encoding used by the browser and the encoding used by django to decode the file name. François On Oct 21, 2013, at 2:42 AM, Raaj Supramanian wrote: > class FileUpload(models.Model): > cstr = models.CharField(max_length=50) > fi

supervisor

2013-10-21 Thread Diogene Laerce
Hi, Anyone could share a good process control system software name to use with uwsgi ? Apart from supervisor, I couldn't make it work : - can't stop it only kill it - bug on supervisorctl reload.. Even when using the last version. Thank you -- “One original thought is worth a thousand mindless

Re: Customizing your project's templates

2013-10-21 Thread Leonardo Giordani
I think that you are missing the absolute path part of the code comment *# Don't forget to use absolute paths, not relative paths. * This means that you cannot use 'lotus/...' Usually you use code like ABSOLUTE_PATH = '%s/' %(os.path.abspath(os.path.dirname(locals()['__file__'])).replace('\\

Re: supervisor

2013-10-21 Thread Lukas Nemec
On 10/21/2013 02:35 PM, Diogene Laerce wrote: Hi, Anyone could share a good process control system software name to use with uwsgi ? Apart from supervisor, I couldn't make it work : - can't stop it only kill it - bug on supervisorctl reload.. Even when using the last version. Thank you Hi, I

Re: Japanese named File - FileUpload django admin throws error

2013-10-21 Thread Xavier Ordoquy
Hi, I've run into similar issues while saving files with non ascii file names. In my case, it turns out that supervisor was removing the environment variables leave Django left with a C locale (ie, ascii only filenames). It worked once I added - for example - LANG="en_US.UTF-8", LC_ALL="en_US.UT

Re: supervisor

2013-10-21 Thread Diogene Laerce
Thanks for reply. the trick is to add supervisor command that specifically tells the program to NOT daemonize [program:my_uwsgi] command = /usr/local/bin/uwsgi -i /path/to/config.ini autorestart = True user = your_user config.ini: your standard uwsgi config, but NO daemonize=logfile path tha

Re: supervisor

2013-10-21 Thread Lukas Nemec
On 10/21/2013 02:51 PM, Diogene Laerce wrote: Thanks for reply. the trick is to add supervisor command that specifically tells the program to NOT daemonize [program:my_uwsgi] command = /usr/local/bin/uwsgi -i /path/to/config.ini autorestart = True user = your_user config.ini: your standard u

Re: supervisor

2013-10-21 Thread Roberto De Ioris
> Hi, > > Anyone could share a good process control system software name to use > with uwsgi ? Apart from supervisor, I couldn't make it work : > - can't stop it only kill it > - bug on supervisorctl reload.. Even when using the last version. > > Thank you > Are you sure you need one ? uWSGI Em

Re: admin template customization

2013-10-21 Thread Gavin Lowry
I had, but my path was wrong. Thanks for pointing me in the right direction. On Friday, October 18, 2013 9:20:38 PM UTC-6, Timothy W. Cook wrote: > > Did you add: > TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] > > to settings.py ? > > > On Fri, Oct 18, 2013 at 6:47 PM, Gavin Lowry > > w

Djangocon videos

2013-10-21 Thread cool-RR
Hi guys, I want to watch videos of talks from the recent Djangocon. But, I don't want to weed through all of them manually looking for the best ones. Did anyone make a "best of" list? Is there a way to sort by popularity or rating or something? Thanks, Ram. -- You received this message beca

Re: Djangocon videos

2013-10-21 Thread Víðir Valberg Guðmundsson
On 10/21/2013 03:50 PM, cool-RR wrote: > Hi guys, > > I want to watch videos of talks from the recent Djangocon. But, I don't > want to weed through all of them manually looking for the best ones. Did > anyone make a "best of" list? Is there a way to sort by popularity or > rating or something? A

Re: Djangocon videos

2013-10-21 Thread Keith Edmiston
http://www.youtube.com/playlist?list=PLtqtTJ4wP09YOFqm_lBCoQtmS6S0omW3J On Mon, Oct 21, 2013 at 8:54 AM, Víðir Valberg Guðmundsson wrote: > On 10/21/2013 03:50 PM, cool-RR wrote: > > Hi guys, > > > > I want to watch videos of talks from the recent Djangocon. But, I don't > > want to weed through

Re: Djangocon videos

2013-10-21 Thread Ram Rachum
Thanks Keith. But I don't see how to sort there! On Mon, Oct 21, 2013 at 5:45 PM, Keith Edmiston wrote: > http://www.youtube.com/playlist?list=PLtqtTJ4wP09YOFqm_lBCoQtmS6S0omW3J > > > On Mon, Oct 21, 2013 at 8:54 AM, Víðir Valberg Guðmundsson > wrote: > >> On 10/21/2013 03:50 PM, cool-RR wrot

Re: Djangocon videos

2013-10-21 Thread Keith Edmiston
I don't believe the link I gave was meant to serve as the permanent location of the videos, so advanced features such as sorting are probably not supported. On Mon, Oct 21, 2013 at 9:54 AM, Ram Rachum wrote: > Thanks Keith. But I don't see how to sort there! > > > On Mon, Oct 21, 2013 at 5:45 P

needs_autoescape in custom template filter vs model method

2013-10-21 Thread fchow
My question is about returning HTML markup in a model method vs. a custom template filter. In the initial_letter_filter example given in https://docs.djangoproject.com/en/1.5/howto/custom-template-tags/ The function takes in autoescape as an arg, so it knows whether to apply conditional_escape

source code of the Django Tutorial?

2013-10-21 Thread Yang Yang
the tutorial is extremely helpful: https://docs.djangoproject.com/en/dev/intro/tutorial01/ but the code samples there seems to be somehow out of sync with the text, for example some parts of the code uses the class "Poll" while some parts use "Question". is there a complete set of source file

Re: source code of the Django Tutorial?

2013-10-21 Thread Daniel Roseman
On Monday, 21 October 2013 20:47:51 UTC+1, Yang Yang wrote: > the tutorial is extremely helpful: > https://docs.djangoproject.com/en/dev/intro/tutorial01/ > > but the code samples there seems to be somehow out of sync with the text, > for example some parts of the code uses the class "Poll" whi

There are plans for a django direct connection to ibm i db2 (iseries)

2013-10-21 Thread Antonio Campos
Hi , I'me new to django and I know there are the db2 remote connection to ibm I (iseries), but it is not free. So my question is if there are plans to developer a driver to connect directly from django to IBM I.Django is great and IBM I is a great server too and have na option for IBM I like MY

Django send_mail Admin Action

2013-10-21 Thread Daniel Worth
I'm working on a simple mailing list app using Django 1.5 my admin.py looks like this: from django.contrib import admin from mailing_list.models import MailingList from django.core.mail import send_mail from django import forms from django.shortcuts import render from django.http import HttpRespo

Re: User Created Objects (models)

2013-10-21 Thread Ideo Rex
Thanks for the link. I'm spent a good part of the day trying to figure it out to no avail. My next approach was to describe how I walked through it and see where I went wrong. I went into my models.py from django.db import models from django.core.urlresolvers import reverse from datetime impo

Re: There are plans for a django direct connection to ibm i db2 (iseries)

2013-10-21 Thread Russell Keith-Magee
On Tue, Oct 22, 2013 at 4:45 AM, Antonio Campos wrote: > Hi , I'me new to django and I know there are the db2 remote connection to > ibm I (iseries), but it is not free. So my question is if there are plans > to developer a driver to connect directly from django to IBM I.Django is > great and IBM

Re: needs_autoescape in custom template filter vs model method

2013-10-21 Thread Mike Dewhirst
On 22/10/2013 4:56am, fchow wrote: My question is about returning HTML markup in a model method vs. a custom template filter. Personally, I prefer the custom template filter due to a nicer separation of model/display concerns. That said, I recently discovered Django's mark_safe() from djang

Re: django model(s) silently fails to sync to the DB ( for no apparent reason )

2013-10-21 Thread Doug S
Looks like I found the problem. I am using the pattern: I am using a pattern with multiple model files for a single app my dir structure is: >my_app > models - __init__.py - model_file1.py - model_file2.py and in my __init__.py I've got code to pu