I think the view function is wrong.
This should do:
from django.views.decorators.csrf import csrf_protect
from django.shortcuts impor render
@csrf_protect
def login(request):
return render(request, 'login.html')
2014-06-27 6:03 GMT+02:00 sarfaraz ahmed :
> Hello
>
> I am new to django I am
Hello everyone,
I have a problem with a variable in my Django template showing up. Somehow
it shows two different variable when it is mod_wsgi and it is runserver.
One possibility is that the cache keep the old html. So I use disable cache
mode in Chrome. F12 => setting => disable cache. This
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.
>
> Model:
>
> cl
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
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 unsubscribe
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
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 matc
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 upl
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 result.meta.summary|truncatew
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));
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 tem
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):
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 = models.CharF
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
to
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 those
> requests are goi
>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 para
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 clicke
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
>
>
> and
>
> context[
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:
>
> https
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], type(today.month), today.month
>
> 2014-
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
> months_choice
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
http://stackoverflow.com/questions/844746/performing-a-getattr
22 matches
Mail list logo