Re: Django image upload not saving

2014-06-26 Thread Darren Spruell
On Thu, Jun 26, 2014 at 10:58 AM, Bobby Gulshan wrote: > No errors when hitting upload. But the image doesn't appear where I have > indicated it ought to. Put an absolute path in MEDIA_ROOT and referenced the > same in (upload_to) param ImageField. Not sure what I am missing.

django user authenication form in modal form twitter bootstrap

2014-06-26 Thread sarfaraz ahmed
Hello I am new to django I am trying to use modal (bootstrap) for embed by login form. I am using the following error. I have mentioned my code below and tried lot of googling... still no use. Help Reason given for failure: CSRF token missing or incorrect. Here is code in view.py

[ANNOUNCE] Django 1.7 release candidate 1

2014-06-26 Thread James Bennett
We're closing in on the final Django 1.7 release, so it's release-candidate time! Details are up on the Django project blog: https://www.djangoproject.com/weblog/2014/jun/26/17rc1/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: interesting project: django-crucrudile

2014-06-26 Thread Michael Lind Hjulskov
aggree Den torsdag den 26. juni 2014 17.08.32 UTC+2 skrev Fabio Caritas Barrionuevo da Luz: > > > https://github.com/pstch/django-crucrudile > > > > -- > Fábio C. Barrionuevo da Luz > Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins - > FACTO > Palmas - Tocantins - Brasil

using AWS cloudfront with Django - CSRF failures

2014-06-26 Thread John Briere
I'm sure there's simple solution for this but I haven't found it. AWS Cloudfront strips out the referer header: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#RequestCustomRemovedHeaders Django requires a referer to exist and to

Re: Django image upload not saving

2014-06-26 Thread Mario Gudelj
I always follow a similar pattern for media uploads and it works, so here it is: in settings.py PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') in your model: file = models.ImageField(upload_to='wiki') say you

Combining use of template tag + filter in same expression

2014-06-26 Thread Darren Spruell
I have a template in which I'm trying to achieve the use of the 'firstof' tag to display whichever of two variables is present, and the resulting variable filtered through 'truncatewords'. Is there a way this can be accomplished? Have tried the following: {% first of

Re: Unable to add CSRF token to the header

2014-06-26 Thread Roman Klesel
Hello, I'm not quite sure what you are trying to do, but with type: "GET" there is no need to worry about crfs_token. >From the link you posted: """ function csrfSafeMethod(method) { // these HTTP methods do not require CSRF protection return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));

Re: Handling checkbox inputs

2014-06-26 Thread Saloni Baweja
On Thursday, June 26, 2014 1:03:47 PM UTC+5:30, roman wrote: > > Hello, > > the {{j.i}} can not work as you expect. If i understand you correctly > you would like to do something like getattr(list, i) in the template. > > In order to do this you have 2 possibilities: > > 1) Write a custom

Login without database

2014-06-26 Thread Hernani Fernandes
Hello, i´d like to use the django to login but without connection on database. I´ll consume webservices in another language to do this. I made using the remote_user but i don´t know how to do this. from django.contrib.auth import authenticate, logout, login def sessao_login(request, _dados):

Django image upload not saving

2014-06-26 Thread Bobby Gulshan
No errors when hitting upload. But the image doesn't appear where I have indicated it ought to. Put an absolute path in MEDIA_ROOT and referenced the same in (upload_to) param ImageField. Not sure what I am missing. Model: class FileUploadHandler(models.Model): title =

interesting project: django-crucrudile

2014-06-26 Thread Fabio C. Barrionuevo da Luz
https://github.com/pstch/django-crucrudile -- Fábio C. Barrionuevo da Luz Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins - FACTO Palmas - Tocantins - Brasil - América do Sul http://pythonclub.com.br/ Blog colaborativo sobre Python e tecnologias Relacionadas, mantido

Re: page not found errors for most urls but main landing page displaying okay

2014-06-26 Thread Vijay Khemlani
Is it possible that the app is getting confused because it is not running at the root of the domain (/) but instead on a subdirectory (/project/)? On Wed, Jun 25, 2014 at 11:51 PM, Kelvin Wong wrote: > If you have access to your logs, check your logs to figure out where

Re: one form, many submits

2014-06-26 Thread Roman Klesel
>From your code: """ if request.method=='GET': if request.POST.get('accept'): bid = QuotedItem.objects.get(id=2) return render(request, 'bills/p_bill.html', {'bid' : bid}) """ if the method is "GET", you will never have any POST parameters. If you want POST

Re: one form, many submits

2014-06-26 Thread Gunpreet Ahuja
On Tuesday, June 24, 2014 11:21:23 PM UTC+5:30, Gunpreet Ahuja wrote: > > > > On Saturday, February 20, 2010 9:07:57 PM UTC+5:30, David De La Harpe > Golden wrote: >> >> On Sat, Feb 20, 2010 at 06:42:11AM -0800, Tom wrote: >> >> > >> Check request.POST.get('cancel') to see if cancel was

Re: testing equality in template tag

2014-06-26 Thread Tom Evans
On Wed, Jun 25, 2014 at 7:34 PM, Lee Hinde wrote: > with view code like so: > > import calendar > months_choices = [] > for i in range(1,13): > months_choices.append((i, calendar.month_name[i])) > context['months'] = months_choices >

Re: WANTED: Photo Contest Package

2014-06-26 Thread André Meyer-Vitali
Brilliant, thanks tinkert! I'll definitely check it out. cheers André On Wednesday, 25 June 2014 15:08:04 UTC+2, tinkert wrote: > > Photologue might be useful as part of the solution - I used it on a > previous project some time ago, but it looks like it's still actively > maintained: > >

Re: testing equality in template tag

2014-06-26 Thread Roman Klesel
Ugh , sorry of course we know ... forget what i said ... 2014-06-26 9:48 GMT+02:00 Roman Klesel : > hard to tell since we do not know what values default_month and month.0 have > ... > try to print in the view and examine: > print type(month[0]), month[0],

Re: testing equality in template tag

2014-06-26 Thread Roman Klesel
hard to tell since we do not know what values default_month and month.0 have ... try to print in the view and examine: print type(month[0]), month[0], type(today.month), today.month 2014-06-25 20:34 GMT+02:00 Lee Hinde : > with view code like so: > > import calendar >

Re: Handling checkbox inputs

2014-06-26 Thread Roman Klesel
Hello, the {{j.i}} can not work as you expect. If i understand you correctly you would like to do something like getattr(list, i) in the template. In order to do this you have 2 possibilities: 1) Write a custom template tag like this