Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread sarfaraz ahmed
Hello Roman,

Thanks for response. Tried what you suggested me. The modal does not even
pop up if I used the code mentioned in your reply.

Regards,
Sarfaraz Ahmed


On Fri, Jun 27, 2014 at 12:09 PM, Roman Klesel 
wrote:

> 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 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
> >
> > from django.shortcuts import render_to_response
> > from django.http import HttpResponseRedirect
> > from django.contrib import auth
> > from django.core.context_processors import csrf
> > from django.template import RequestContext
> > from django.views.decorators.csrf import csrf_protect
> > from django.shortcuts import render
> >
> >
> >
> > @csrf_protect
> > def login(request):
> > c={}
> > c.update(csrf(request))
> > return
> >
> render_to_response('login.html',c,context_instance=RequestContext(request))
> >
> >
> >
> > I call the login.html via link in nav bar using
> >
> >   > data-target="#myModal">Login
> >
> > That is code for login.html which is modal included in my base.html
> >
> >
> >  > aria-labelledby="myModalLabel" aria-hidden="true">
> > 
> > 
> > 
> >  > data-dismiss="modal">× > class="sr-only">Close
> > Modal
> title
> > 
> > 
> > {%
> csrf_token
> > %}
> > User Name:
> >  > id="username">
> > Password:
> >  > id="password">
> > 
> > 
> > 
> > 
> >  > data-dismiss="modal">Close
> > Save
> > changes
> > 
> > 
> > 
> > 
> >
> > --
> > 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 it, send an
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/943e0bf4-ce4d-4ef5-ae45-57e86c36f367%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAL2Rd%3DKwRHU-G_jF4winxka2nnLRB%3D-qbejfDdnQ0GE0zNNMeQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPJdizEX-0Jju_hT5wE8-dS%3D6Kxvp_h3kgtJKV7N5oOqvL0jQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANNOUNCE] Django 1.7 release candidate 1

2014-06-27 Thread cercatrova2

  
  
On 27/06/14 03:43, James Bennett wrote:


  
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 from this group and stop receiving emails from it,
  send an email to django-users+unsubscr...@googlegroups.com.
  To post to this group, send email to django-users@googlegroups.com.
  Visit this group at http://groups.google.com/group/django-users.
  To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL13Cg9mu6To35mC2_wCyn0NHwz7htD%3D8vfnHnWL_OO1NkmAqw%40mail.gmail.com.
  For more options, visit https://groups.google.com/d/optout.



"FastCGI support via the runfcgi management command will be
removed in
Django 1.9. Please deploy your project using WSGI."

Why does the documentation *persist* in confusing FastCGI with WSGI?

FastCGI is a protocol and WSGI is an API. One can deploy a WSGI
application over FastCGI and that is exactly what a FastCGI-to-WSGI
adapter like flup does (flup is what runfcgi is written for). There
are so many clarifications about this out there, including at least
one by the author of mod_wsgi
(http://stackoverflow.com/questions/1747266/is-there-a-speed-difference-between-wsgi-and-fcgi)

And it seems that the point made in the developer thread about
deprecation being unwise was simply ignored and intentionally
misunderstood
(https://groups.google.com/forum/#!topic/django-developers/oGmD8LvLTPg
"Deprecate FCGI support in Django
  1.7"). 

My case is just one example - there's an apache/mod_python/python2
application that I can't touch, so to run something on apache with
python3 I need mod_fastcgi/mod_fcgi and flup. Mixing
mod_python/python2 with mod_wsgi/python3 doesn't work even in daemon
mode.






  




-- 
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 it, send an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53AD2757.5050303%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to display image in template

2014-06-27 Thread Ram Ganesh
I started learning Django and I'm trying to build a photo app.
this app merging uploaded images and rendering.
I have merged Images with PIL and save the image in accessible file system.

Now I'm stuck with this,
 -How do I displaying merged new Image,
 -How to serve merged new Image files in my Templates?
Can some one show a step by step instruction

Application running on django development server.

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/912a0115-080f-4e01-9c2e-c7253a940fd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to display image in template

2014-06-27 Thread Phang Mulianto
Hi,

The image i assume you upload to media folder .
Make sure your media folder accessible by webserver which serving static
files.

To use in template just use the html img src='urltoimage'  , and use
media_url context variable to not hardening the url.

Mulianto

http://muliantophang.blogspot.com




On Fri, Jun 27, 2014 at 4:33 PM, Ram Ganesh  wrote:

> I started learning Django and I'm trying to build a photo app.
> this app merging uploaded images and rendering.
> I have merged Images with PIL and save the image in accessible file system.
>
> Now I'm stuck with this,
>  -How do I displaying merged new Image,
>  -How to serve merged new Image files in my Templates?
> Can some one show a step by step instruction
>
> Application running on django development server.
>
> --
> 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 it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/912a0115-080f-4e01-9c2e-c7253a940fd0%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BSr5mRRBxLhj1zaWSuTcfuUxrdFs7QTM-mM4EFauWrD_XJuWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANNOUNCE] Django 1.7 release candidate 1

2014-06-27 Thread James Bennett
On Fri, Jun 27, 2014 at 3:12 AM, cercatrova2  wrote:

> "FastCGI support via the runfcgi management command will be removed in
> Django 1.9. Please deploy your project using WSGI."
>
> Why does the documentation *persist* in confusing FastCGI with WSGI?
>

This does not confuse them (if it were confusing them, it would assume that
FastCGI and WSGI are identical).


> And it seems that the point made in the developer thread about deprecation
> being unwise was simply ignored and intentionally misunderstood (
> https://groups.google.com/forum/#!topic/django-developers/oGmD8LvLTPg 
> "Deprecate
> FCGI support in Django 1.7").
>

I don't see anyone ignoring or intentionally misunderstanding in that
thread.

The "runfcgi" command and its supporting code just implements a
FastCGI<->WSGI bridge using flup. That's convenient for cases where FastCGI
is the only deployment option, but it does come at a significant cost: flup
appears to be abandonware, and the flup-based bridge has generated a lot of
bugs and maintenance headaches. That cost was deemed the bigger issue, and
so Django will no longer have a built-in FastCGI<->WSGI bridge based on
flup.

This doesn't mean that Django can't be deployed using FastCGI, of course;
it just means that someone else needs to provide the bridge from FastCGI to
WSGI, because going forward Django will only support speaking WSGI, and
will not include its own bridge to let it pretend to speak FastCGI or other
gateway protocols. And in that thread several people showed interest in
starting and maintaining a third-party package to provide that bridge. If
FastCGI is a requirement for you, your best course is likely to follow up
on that effort.

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL13Cg_sXKbHmwvp-JnihBqGGwq3wxoB8zZB1behdcQ%3DpPTB7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Syntax highlighting using vim

2014-06-27 Thread Christopher Schenk



Hi everybody.

I have recently started to use django and I really enjoy it. However, I 
can't seem to achieve the optimal syntax highlighting using vim. I 
installed the three scripts found from the following link:

http://www.vim.org/scripts/script.php?script_id=1487

However, the resulting highlighting is not great. The image above shows the 
problem. I would like the highlighting to assign different colors to the 
variable name "user_list" and the brackets "{%" and "%}". Ideal, the syntax 
highlighting when editing templates should be as found in this link from 
the djangoproject tutorial:

https://docs.djangoproject.com/en/1.6/intro/tutorial03/

I have researched and I have not found a solution. Any help would be 
appreciated.

Best regards,

Christopher


-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/51b4a13b-e25d-41bc-a355-9816776ed37f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to store/model reachable data in django.

2014-06-27 Thread Tom Evans
On Thu, Jun 26, 2014 at 2:28 AM, Mario Gudelj  wrote:
> You don't want to use a csv. Store them in a db table cell. Even if you have
> a million entries you'll be surprised how quick it will be.

Another option is RRD (Round Robin Database), which is designed for
collecting (and dropping) samples in order to always be able to
produce a set of graphs. The eponymous tool in this category is
rrdtool, which has python bindings.

Cheers

Tom

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1Ksf7fJ0-N1%3D4W2iPjSCM%2BuwjK%2BDxX3UCdJ-u7iUTDiPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANNOUNCE] Django 1.7 release candidate 1

2014-06-27 Thread cercatrova2

  
  
On 27/06/14 11:16, James Bennett wrote:


  On Fri, Jun 27, 2014 at 3:12 AM, cercatrova2 
wrote:

  

  "FastCGI support via
the runfcgi management command
will be removed in Django 1.9. Please deploy your
project using WSGI."

Why does the documentation *persist* in confusing
FastCGI with WSGI?
  



This does not confuse them (if it were confusing them,
  it would assume that FastCGI and WSGI are identical). 
  


  
And it seems that the point made in the developer thread
about deprecation being unwise was simply ignored and
intentionally misunderstood (https://groups.google.com/forum/#!topic/django-developers/oGmD8LvLTPg
"Deprecate FCGI support in Django 1.7"). 



I don't see anyone ignoring or intentionally
  misunderstanding in that thread.
  

The "runfcgi" command and its supporting code just
  implements a FastCGI<->WSGI bridge using flup.
  That's convenient for cases where FastCGI is the only
  deployment option, but it does come at a significant cost:
  flup appears to be abandonware, and the flup-based bridge
  has generated a lot of bugs and maintenance headaches.
  That cost was deemed the bigger issue, and so Django will
  no longer have a built-in FastCGI<->WSGI bridge
  based on flup.
  

This doesn't mean that Django can't be deployed using
  FastCGI, of course; it just means that someone else needs
  to provide the bridge from FastCGI to WSGI, because going
  forward Django will only support speaking WSGI, and will
  not include its own bridge to let it pretend to speak
  FastCGI or other gateway protocols. And in that thread
  several people showed interest in starting and maintaining
  a third-party package to provide that bridge. If FastCGI
  is a requirement for you, your best course is likely to
  follow up on that effort.

  

  
  -- 
  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 it,
  send an email to django-users+unsubscr...@googlegroups.com.
  To post to this group, send email to django-users@googlegroups.com.
  Visit this group at http://groups.google.com/group/django-users.
  To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL13Cg_sXKbHmwvp-JnihBqGGwq3wxoB8zZB1behdcQ%3DpPTB7w%40mail.gmail.com.
  For more options, visit https://groups.google.com/d/optout.


Come now. When you say "FastCGI support via the runfcgi
management command will be removed in Django 1.9. Please deploy your
project using WSGI." it implies that they are mutually exclusive.
They are not. I'm using FastCGI and I've deployed my project using
WSGI.

It's like how the doc states "Although WSGI
is the preferred deployment
platform for Django, many people use shared hosting, on which
protocols such as
FastCGI, SCGI or AJP are the only viable options." Again the
implication is that these things are mutually exclusive and again
they are not.

If you were to say "FastCGI and flup support via the runfcgi
management command will be removed in Django 1.9. You may of course
continue to use FastCGI and flup or some other FastCGI-to-WSGI
deployment technology independently at your own risk, or you may of
course switch to another WSGI deployment technology." then IMHO it
would make more sense.

Yes I noticed the interest in forking flup in the thread. I'll check
it out.

Thanks for responding!









  




-- 
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 it, send an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53AD5790.3080607%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Best Django apps/extensions

2014-06-27 Thread Greg Niewisiewicz
Hi,

I'm working on a short guide about setting up a new Django project. I'd
like to ask you for apps that you think are indispensable in every project
(e.g. south or django-debug-toolbar).

What are your favorite apps/extensions that you install in most of your
projects?

Best regards
--
Greg Niewisiewicz

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMzt_qdHgfMR6H4ipKOEfdcbS8-mjydKCOX2Gz3hMbkWtxi%2B1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best Django apps/extensions

2014-06-27 Thread Jorge Andrés Vergara Ebratt
I thinks it depends a lot on the project, but for almost every project I
use South to manage my DB migrations, Pillow to handle images and rest
framework to make my APIs
On Jun 27, 2014 7:22 AM, "Greg Niewisiewicz"  wrote:

> Hi,
>
> I'm working on a short guide about setting up a new Django project. I'd
> like to ask you for apps that you think are indispensable in every project
> (e.g. south or django-debug-toolbar).
>
> What are your favorite apps/extensions that you install in most of your
> projects?
>
> Best regards
> --
> Greg Niewisiewicz
>
> --
> 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 it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMzt_qdHgfMR6H4ipKOEfdcbS8-mjydKCOX2Gz3hMbkWtxi%2B1A%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAeX05HUMLgDVtvV9y%2B_KqR-kC2%3DDsXJsKZOX%3D5Xq8-mGphhmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Returning submitted formset data to the template for further editing

2014-06-27 Thread Daniele Procida
As far as I can tell, there doesn't seem to be an easy way to do this:

1.  bind POST data from the request to a formset
2.  loop over the forms in the formset
3.  for each form, manipulate some of the form data
4.  return the manipulated form data to the template
5.  in the template, have useful access to the forms' is_valid(), validation 
and so on

Form data are immutable, so can't be edited directly, so step 3 is difficult.

We could copy the immutable form data to make them editable, but since they are 
in one great big soup of a QueryDict and have prefixes, picking them out one by 
one for each form and field to edit them is messy and unpleasant.

We could instead process all the data in the usual way, then put each dict of 
form.cleaned_data into a new list, and create a new formset using 
my_formset=MyFormset(initial=all_my_cleaned_data_dicts), but now that's 
unbound, which makes step 5 is impossible.

I think the answer has to be to get all of the cleaned_data dicts; loop over 
the keys, add the prefixes to each one; dump the key/value pairs into a new 
data dict; grab the formset management key/values and transfer those too, and 
then do my_formset.data = my_new_data_dict.

But it seems like an awful lot of work for what must be a fairly usual use-case.

Daniele

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20140627152438.1830134201%40smtpauth.cf.ac.uk.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax highlighting using vim

2014-06-27 Thread carlos
maybe read this
https://code.djangoproject.com/wiki/UsingVimWithDjango
or install this plugin
https://github.com/yodiaditya/vim-pydjango

cheers


On Fri, Jun 27, 2014 at 4:04 AM, Christopher Schenk <
christopher.sch...@gmail.com> wrote:

>
> 
> Hi everybody.
>
> I have recently started to use django and I really enjoy it. However, I
> can't seem to achieve the optimal syntax highlighting using vim. I
> installed the three scripts found from the following link:
>
> http://www.vim.org/scripts/script.php?script_id=1487
>
> However, the resulting highlighting is not great. The image above shows
> the problem. I would like the highlighting to assign different colors to
> the variable name "user_list" and the brackets "{%" and "%}". Ideal, the
> syntax highlighting when editing templates should be as found in this link
> from the djangoproject tutorial:
>
> https://docs.djangoproject.com/en/1.6/intro/tutorial03/
>
> I have researched and I have not found a solution. Any help would be
> appreciated.
>
> Best regards,
>
> Christopher
>
>
>  --
> 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 it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/51b4a13b-e25d-41bc-a355-9816776ed37f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO36vpUxWQtWf9ejO7aDw0b3bOY6Sz8NfgTdK7wthyPUBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Questions about Django email packages.

2014-06-27 Thread Chen Xu
Hi Everyone,
Any recommendations on Django email packages? Recently, I started looking
at django-sitemessage, which looks pretty good to me. I wonder how it does
comparing to others.

Thanks

-- 
⚡ Chen Xu ⚡

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACac-qbZmn_dVwg_-C%3DnA7RZjYogqL64k9ecSBoeVbo1FFfzqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread sarfaraz ahmed
Hello,

You were absolutely right.. the function was wrong. Please help me sort out
that.. as this your suggestion took me one step close to fix this issue.

Now the scenario is like this
*views.py *has this function to render my login.html
--
@csrf_protect
def login(request):
#c={}
#c.update(csrf(request))
print 'step2'
return render_to_response('login.html',{},RequestContext(request))
-

base.html has include statement to include login.html and login.html has
following code






×Close
Modal
title


{%csrf_token%}
User Name:

Password:





Close
Save
changes





When I click on link which has following code
 Login

Nothing happens...the modal does not open...

When I manually go to link : accounts/login i can see the form with any
formatting and also can see csrf token.

Desperately looking for help

Regards,
Sarfaraz Ahmed




On Fri, Jun 27, 2014 at 12:34 PM, sarfaraz ahmed 
wrote:

> Hello Roman,
>
> Thanks for response. Tried what you suggested me. The modal does not even
> pop up if I used the code mentioned in your reply.
>
> Regards,
> Sarfaraz Ahmed
>
>
> On Fri, Jun 27, 2014 at 12:09 PM, Roman Klesel 
> wrote:
>
>> 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 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
>> >
>> > from django.shortcuts import render_to_response
>> > from django.http import HttpResponseRedirect
>> > from django.contrib import auth
>> > from django.core.context_processors import csrf
>> > from django.template import RequestContext
>> > from django.views.decorators.csrf import csrf_protect
>> > from django.shortcuts import render
>> >
>> >
>> >
>> > @csrf_protect
>> > def login(request):
>> > c={}
>> > c.update(csrf(request))
>> > return
>> >
>> render_to_response('login.html',c,context_instance=RequestContext(request))
>> >
>> >
>> >
>> > I call the login.html via link in nav bar using
>> >
>> >  > > data-target="#myModal">Login
>> >
>> > That is code for login.html which is modal included in my base.html
>> >
>> >
>> > > > aria-labelledby="myModalLabel" aria-hidden="true">
>> > 
>> > 
>> > 
>> > > > data-dismiss="modal">×> > class="sr-only">Close
>> > Modal
>> title
>> > 
>> > 
>> > {%
>> csrf_token
>> > %}
>> > User Name:
>> > > > id="username">
>> > Password:
>> > > > id="password">
>> > 
>> > 
>> > 
>> > 
>> > > > data-dismiss="modal">Close
>> > Save
>> > changes
>> > 
>> > 
>> > 
>> > 
>> >
>> > --
>> > 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 it, send
>> an
>> > email to django-users+unsubscr...@googlegroups.com.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/943e0bf4-ce4d-4ef5-ae45-57e86c36f367%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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 it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAL2Rd%3DKwRHU-G_jF4winxka2nnLRB%3D-qbejfDdnQ0GE0zNNMeQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
>

Translations

2014-06-27 Thread Joris

Dear all,


I'm trying to get the translations to work. After running makemessages I 
find about 2500 items in the .pot file, not even 100 of which are of my app.


Most of them are from the "localflavor" package, also from 
"django/contrib/admin" or even the names of the months from 
"django/utils/dates.py".
Obviously I'm doing something wrong? It cannot be that the names of the 
months in a standard Django package are not translated?
The localflavor package tries to make me translate all the names of the 
cities in the world. I'm not using it, but still tried adding it to to 
INSTALLED_APPS

so maybe makemessages would find its translations, but no luck.

I must be missing something?

And then also the duplicates, when importing the pot file into poedit it 
complains about duplicates. What's the recommendation here?
Generally do you keep duplicates or do you merge them? (How many times 
does one really want to translate "homepage" and "email" ?)



Thanks!
Joris

--
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53ADD01D.6020408%40promani.be.
For more options, visit https://groups.google.com/d/optout.


GeoDjango/PostGIS installation issues

2014-06-27 Thread Ben Dean
I'm stymied on installing GeoDjango with Postgres9.3 on Ubuntu. I've posted 
the details here 
,
 
so any help would be appreciated and I can promise you all the internet 
points I'm capable of distributing!

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5699b73e-6780-4750-a9c5-6b55ecb96a56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango/PostGIS installation issues

2014-06-27 Thread Alex Mandel
On 06/27/2014 01:47 PM, Ben Dean wrote:
> I'm stymied on installing GeoDjango with Postgres9.3 on Ubuntu. I've posted 
> the details here 
> ,
>  
> so any help would be appreciated and I can promise you all the internet 
> points I'm capable of distributing!
> 

Try the Geodjango mailing list
https://groups.google.com/forum/#!forum/geodjango
OR IRC
#geodjango on freenode

Thanks,
Alex

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53ADDE80.1030803%40wildintellect.com.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango/PostGIS installation issues

2014-06-27 Thread Alex Mandel
On 06/27/2014 02:13 PM, Alex Mandel wrote:
> On 06/27/2014 01:47 PM, Ben Dean wrote:
>> I'm stymied on installing GeoDjango with Postgres9.3 on Ubuntu. I've posted 
>> the details here 
>> ,
>>  
>> so any help would be appreciated and I can promise you all the internet 
>> points I'm capable of distributing!
>>
> 
> Try the Geodjango mailing list
> https://groups.google.com/forum/#!forum/geodjango
> OR IRC
> #geodjango on freenode
> 
> Thanks,
> Alex
> 

While your at it, your question need more info.
What Distro/Version are you using and what version of postgis and gdal
do you want to use.

The simple answer is you have multiple conflicting repos. Straightening
those out will resolve the issue. This issue has been discussed on the
UbuntuGIS mailing list too.

Thanks,
Alex

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53ADE3F8.7070105%40wildintellect.com.
For more options, visit https://groups.google.com/d/optout.


Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread Mario Gudelj
Sounds like you have a js issue now. Have a look inside chrome console for
any errors and fix them. Modal not coming up wouldn't be a django issue.
On 28/06/2014 5:41 am, "sarfaraz ahmed"  wrote:

> Hello,
>
> You were absolutely right.. the function was wrong. Please help me sort
> out that.. as this your suggestion took me one step close to fix this
> issue.
>
> Now the scenario is like this
> *views.py *has this function to render my login.html
> --
> @csrf_protect
> def login(request):
> #c={}
> #c.update(csrf(request))
> print 'step2'
> return render_to_response('login.html',{},RequestContext(request))
>
> -
>
> base.html has include statement to include login.html and login.html has
> following code
>
>
>  aria-labelledby="myModalLabel" aria-hidden="true">
> 
> 
> 
>  data-dismiss="modal">× class="sr-only">Close
> Modal
> title
> 
> 
>  method='post'>{%csrf_token%}
> User Name:
>  id="username">
> Password:
>  id="password">
> 
> 
> 
> 
>  data-dismiss="modal">Close
> Save
> changes
> 
> 
> 
> 
>
> When I click on link which has following code
>   >Login
>
> Nothing happens...the modal does not open...
>
> When I manually go to link : accounts/login i can see the form with any
> formatting and also can see csrf token.
>
> Desperately looking for help
>
> Regards,
> Sarfaraz Ahmed
>
>
>
>
> On Fri, Jun 27, 2014 at 12:34 PM, sarfaraz ahmed 
> wrote:
>
>> Hello Roman,
>>
>> Thanks for response. Tried what you suggested me. The modal does not even
>> pop up if I used the code mentioned in your reply.
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>>
>> On Fri, Jun 27, 2014 at 12:09 PM, Roman Klesel 
>> wrote:
>>
>>> 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 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
>>> >
>>> > from django.shortcuts import render_to_response
>>> > from django.http import HttpResponseRedirect
>>> > from django.contrib import auth
>>> > from django.core.context_processors import csrf
>>> > from django.template import RequestContext
>>> > from django.views.decorators.csrf import csrf_protect
>>> > from django.shortcuts import render
>>> >
>>> >
>>> >
>>> > @csrf_protect
>>> > def login(request):
>>> > c={}
>>> > c.update(csrf(request))
>>> > return
>>> >
>>> render_to_response('login.html',c,context_instance=RequestContext(request))
>>> >
>>> >
>>> >
>>> > I call the login.html via link in nav bar using
>>> >
>>> >  >> > data-target="#myModal">Login
>>> >
>>> > That is code for login.html which is modal included in my base.html
>>> >
>>> >
>>> > >> > aria-labelledby="myModalLabel" aria-hidden="true">
>>> > 
>>> > 
>>> > 
>>> > >> > data-dismiss="modal">×>> > class="sr-only">Close
>>> > Modal
>>> title
>>> > 
>>> > 
>>> > {%
>>> csrf_token
>>> > %}
>>> > User Name:
>>> > >> > id="username">
>>> > Password:
>>> > >> > id="password">
>>> > 
>>> > 
>>> > 
>>> > 
>>> > >> > data-dismiss="modal">Close
>>> > Save
>>> > changes
>>> > 
>>> > 
>>> > 
>>> > 
>>> >
>>> > --
>>> > 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 it, send
>>> an
>>> > email to django-users+unsubscr...@googlegroups.com.
>>> > To post to this group, send email to django-users@googlegroups.com.
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/943e0bf4-ce4d-4ef5-ae45-57e86c36f367%40googlegroups.com
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> You received t

Re: Questions about Django email packages.

2014-06-27 Thread Some Developer


On 27/06/2014 20:05, Chen Xu wrote:

Hi Everyone,
Any recommendations on Django email packages? Recently, I started 
looking at django-sitemessage, which looks pretty good to me. I wonder 
how it does comparing to others.


Thanks

--
⚡ Chen Xu ⚡
--


What exactly do you want to do with this email package? It would help if 
you gave some more information.


--
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53AE0F20.90106%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about Django email packages.

2014-06-27 Thread Chen Xu
Basically what I want to do for now, is just being able to send an email
for example: a registration confirmation email, but later on, I might need
to send emails in a monthly basis, or whenever we have some new features
coming up, kinda like a scheduled email sendings.


On Fri, Jun 27, 2014 at 8:41 PM, Some Developer 
wrote:

>
> On 27/06/2014 20:05, Chen Xu wrote:
>
> Hi Everyone,
> Any recommendations on Django email packages? Recently, I started looking
> at django-sitemessage, which looks pretty good to me. I wonder how it does
> comparing to others.
>
>  Thanks
>
>  --
> ⚡ Chen Xu ⚡
>  --
>
>
> What exactly do you want to do with this email package? It would help if
> you gave some more information.
>
> --
> 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 it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/53AE0F20.90106%40googlemail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
⚡ Chen Xu ⚡

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACac-qZ5qk0Swc-YR29BdBDrjoObtWDTeCJHqam5DzQrmf8TRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


crm app

2014-06-27 Thread Mike Dewhirst
I have a non-technical colleague who needs a fairly simple CRM system. 
SugarCRM Community Edition is overkill.


Django packages doesn't have a CRM category so I wonder if anyone has 
anything which might be in production?


I could install and configure for him but he is definitely in the 
end-user camp and I'm not keen to become his primary support for someone 
else's package.


He needs to keep track of prospects, write notes, add keywords and 
search/filter his database on dates, keywords etc. Not sure what the etc 
might actually be.


Thanks

Mike

--
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53AE2FD6.5020803%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: crm app

2014-06-27 Thread Kelvin Wong
If you don't want to help the fellow when he runs into issues, give him a 
supported product like Zoho CRM. It is free for 3 users.

I'm currently reviewing Tree.io for a client and while it looks nice, it 
uses Piston (abandonware), Jinja (unnecessary), Dajaxice (a bad idea 
generally). I wouldn't recommend it at this point.

K


On Friday, June 27, 2014 8:01:43 PM UTC-7, Mike Dewhirst wrote:
>
> I have a non-technical colleague who needs a fairly simple CRM system. 
> SugarCRM Community Edition is overkill. 
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/247fd82c-0b64-4731-a409-37b8f3a22870%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread sarfaraz ahmed
i am using attribute to call modal popup. Should I use JS and try. I would
give a try and let you know.

Thanks in advance,
Sarfaraz Ahmed


On Sat, Jun 28, 2014 at 6:09 AM, Mario Gudelj 
wrote:

> Sounds like you have a js issue now. Have a look inside chrome console for
> any errors and fix them. Modal not coming up wouldn't be a django issue.
> On 28/06/2014 5:41 am, "sarfaraz ahmed"  wrote:
>
>> Hello,
>>
>> You were absolutely right.. the function was wrong. Please help me sort
>> out that.. as this your suggestion took me one step close to fix this
>> issue.
>>
>> Now the scenario is like this
>> *views.py *has this function to render my login.html
>> --
>> @csrf_protect
>> def login(request):
>> #c={}
>> #c.update(csrf(request))
>> print 'step2'
>> return render_to_response('login.html',{},RequestContext(request))
>>
>> -
>>
>> base.html has include statement to include login.html and login.html has
>> following code
>>
>>
>> > aria-labelledby="myModalLabel" aria-hidden="true">
>> 
>> 
>> 
>> > data-dismiss="modal">×> class="sr-only">Close
>> Modal
>> title
>> 
>> 
>> > method='post'>{%csrf_token%}
>> User Name:
>> > id="username">
>> Password:
>> > id="password">
>> 
>> 
>> 
>> 
>> > data-dismiss="modal">Close
>> Save
>> changes
>> 
>> 
>> 
>> 
>>
>> When I click on link which has following code
>>  > data-target="#myModal" >Login
>>
>> Nothing happens...the modal does not open...
>>
>> When I manually go to link : accounts/login i can see the form with any
>> formatting and also can see csrf token.
>>
>> Desperately looking for help
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>>
>>
>>
>> On Fri, Jun 27, 2014 at 12:34 PM, sarfaraz ahmed 
>> wrote:
>>
>>> Hello Roman,
>>>
>>> Thanks for response. Tried what you suggested me. The modal does not
>>> even pop up if I used the code mentioned in your reply.
>>>
>>> Regards,
>>> Sarfaraz Ahmed
>>>
>>>
>>> On Fri, Jun 27, 2014 at 12:09 PM, Roman Klesel 
>>> wrote:
>>>
 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 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
 >
 > from django.shortcuts import render_to_response
 > from django.http import HttpResponseRedirect
 > from django.contrib import auth
 > from django.core.context_processors import csrf
 > from django.template import RequestContext
 > from django.views.decorators.csrf import csrf_protect
 > from django.shortcuts import render
 >
 >
 >
 > @csrf_protect
 > def login(request):
 > c={}
 > c.update(csrf(request))
 > return
 >
 render_to_response('login.html',c,context_instance=RequestContext(request))
 >
 >
 >
 > I call the login.html via link in nav bar using
 >
 >  >>> > data-target="#myModal">Login
 >
 > That is code for login.html which is modal included in my base.html
 >
 >
 > >>> > aria-labelledby="myModalLabel" aria-hidden="true">
 > 
 > 
 > 
 > >>> > data-dismiss="modal">×>>> > class="sr-only">Close
 > Modal
 title
 > 
 > 
 > {%
 csrf_token
 > %}
 > User Name:
 > >>> > id="username">
 > Password:
 > >>> > id="password">
 > 
 > 
 > 
 > 
 > >>> > data-dismiss="modal">Close
 > Save
 > changes
 > 
 > 
 > 
 > 
 >
 > --
 > 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 it,
 send an
 > email to django-users+unsubscr...@googlegrou

Re: crm app

2014-06-27 Thread Mike Dewhirst

Thanks Kelvin. It looks good at first glance.

Do you know if Django-CRM is suitable for an end user?

Mike

On 28/06/2014 2:05 PM, Kelvin Wong wrote:

If you don't want to help the fellow when he runs into issues, give him
a supported product like Zoho CRM. It is free for 3 users.

I'm currently reviewing Tree.io for a client and while it looks nice, it
uses Piston (abandonware), Jinja (unnecessary), Dajaxice (a bad idea
generally). I wouldn't recommend it at this point.

K


On Friday, June 27, 2014 8:01:43 PM UTC-7, Mike Dewhirst wrote:

I have a non-technical colleague who needs a fairly simple CRM system.
SugarCRM Community Edition is overkill.

--
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 it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/247fd82c-0b64-4731-a409-37b8f3a22870%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53AE55BA.4010804%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.