Monday, June 30, 2014

Re: where is base_site.html

Yes I have it!

Thank You Andreas!!!

W dniu poniedziałek, 30 czerwca 2014 18:10:07 UTC+2 użytkownik Dariusz Mysior napisał:
I use virtualenv with Django 1.6 Python 2.7 and I am use tutorial https://docs.djangoproject.com/en/1.6/intro/tutorial02/ and I had a problem becouse I don't know where I can find  file base_site.html from
django/contrib/admin/templates where I can't find this place :/

--
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+unsubscribe@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/fa5729c7-c81f-4717-abff-c8a30794c13b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Call for Papers for Djangocon US 2014 *extended*

If my English was better I would go in this year. :/

maybe in the next.


2014-06-30 17:21 GMT+01:00 Christophe Pettus <xof@thebuild.com>:
Greetings,

The Call for Papers for Djangocon US 2014 has been extended through July 15, 2014.  (The web site still shows the old date, but will be updated shortly.)  Please share what you know with us!

        http://djangocon.us/

Best,
--
-- Christophe Pettus
   xof@thebuild.com

--
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+unsubscribe@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/B574574F-754C-4626-A8CF-B79CAC5AD1CE%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.



--

Helton Alves 
Desenvolvedor web
Graduado em Sistemas de Informação - FACIMP
Cursando Metodologia do Ensino Superior - INESPO

--
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+unsubscribe@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/CABcoSmDQaJ%3Dzw-iHaTV1h9siMadTHX06ZwVdVdT8nP8qnsBZ0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Call for Papers for Djangocon US 2014 *extended*

Greetings,

The Call for Papers for Djangocon US 2014 has been extended through July 15, 2014. (The web site still shows the old date, but will be updated shortly.) Please share what you know with us!

http://djangocon.us/

Best,
--
-- Christophe Pettus
xof@thebuild.com

--
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+unsubscribe@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/B574574F-754C-4626-A8CF-B79CAC5AD1CE%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.

Re: where is base_site.html

Hi Dariusz,

You will have to find where you have created your virtualenv. In the virtualenv folder you should have a lib/python2.7/site-packages folder. In that folder, you will find all of the libraries you have installed via pip. It is good to know where that folder is, so you can check the sources for some of the libraries.

If you are running linux, you should also be able to run "locate base_site.html" and you should get all of the places where there is a base_site.html file.

Regards,

Andréas

2014-06-30 18:10 GMT+02:00 Dariusz Mysior <mysior.darek@gmail.com>:
I use virtualenv with Django 1.6 Python 2.7 and I am use tutorial https://docs.djangoproject.com/en/1.6/intro/tutorial02/ and I had a problem becouse I don't know where I can find  file base_site.html from
django/contrib/admin/templates where I can't find this place :/

--
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+unsubscribe@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/236de42f-0431-404d-a4ab-6f75b533e72b%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+unsubscribe@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/CALXYUb%3D4M4YremBZyi49g8SOKpe3ji%3DTYN_DWY-aNJVYuxkj2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

where is base_site.html

I use virtualenv with Django 1.6 Python 2.7 and I am use tutorial https://docs.djangoproject.com/en/1.6/intro/tutorial02/ and I had a problem becouse I don't know where I can find  file base_site.html from
django/contrib/admin/templates where I can't find this place :/

--
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+unsubscribe@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/236de42f-0431-404d-a4ab-6f75b533e72b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to simplify this code - newbie question

Hi :o)

I would like to simplify get_rating to fewer lines of code:

class Product(AbstractProduct):

    ... just a little info about the model fields ...
    title = charfield
    parent = foreignkey(Product, related_name='variants')
    rating = a float
    def is_group - return True if it is a parent product and have variants 
    ...

    @property
    def get_rating(self):
        u"""Return a product's rating - group product's ratings is gathered and presented as one"""
        if self.is_group:
            ratings_count = 0
            if self.rating:
                ratings_sum = self.rating
                ratings_count+=1
            for variant in self.variants.all():
                if variant.rating:
                    ratings_sum += variant.rating
                    ratings_count+=1

            if ratings_count > 0:
                rating = float(ratings_sum) / ratings_count
                return rating
        return self.rating


My best guess is below, but it isnt working.
Will somebody please teach me what I should do and maybe explain to me why it isnt working.
I really want to learn this :o)

class Product(AbstractProduct):

    @property
    def get_rating(self):
        u"""Return a product's rating - group product's ratings is gathered and presented as one"""
        if self.is_group:
            return float(Product.objects.filter(Q(parent__in=self) | Q(pk=self.pk)).aggregate(Avg('rating')))
        return self.rating


Thanks alot :)

--
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+unsubscribe@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/007ec8b7-4ab9-460e-bf3e-06c14f91b5db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sunday, June 29, 2014

Re: Full text search available on PostgreSQL?

On Saturday, June 28, 2014 7:15:05 PM UTC+3, Bastian Kuberek wrote:
Hi,

Just saw that django.contrib.admin.ModelAdmin.search_fields full text search only support MySQL.

Are there plans on any progress towards getting this functionality on PostgreSQL?

Yes, see https://www.kickstarter.com/projects/mjtamlyn/improved-postgresql-support-in-django.

 - Anssi

--
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+unsubscribe@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/2972b581-4fcc-4c3d-bf78-67a44e3f1278%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Django Contacts

Hi All,

I am looking for a contact manager app.

I've found Django-contacts, but there are a number of more forks - I
was wondering what people are using?

cheers
L.

--
The idea is that a beautiful image is frameable. Everything you need
to see is there: It's everything you want, and it's very pleasing
because there's no extra information that you don't get to see.
Everything's in a nice package for you. But sublime art is
unframeable: It's an image or idea that implies that there's a bigger
image or idea that you can't see: You're only getting to look at a
fraction of it, and in that way it's both beautiful and scary, because
it's reminding you that there's more that you don't have access to.
It's now sort of left the piece itself and it's become your own
invention, so it's personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
-----------------------------------------------------------------------------------------------------------
Adventure Time http://theholenearthecenteroftheworld.com/

--
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+unsubscribe@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/CAGBeqiO4hDJ7rC1W96w0zkiQQcCU8WXL4GcNdP62c3B6v-%3DAMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: admin ViewDoesNotExistError

Martin,

Perhaps try copying over the folder configuration from the non-error-triggering project and try to continue from there. Also, perhaps permissions are to blame?

Andrew

On Sunday, June 29, 2014 2:22:11 AM UTC+9, Martin Spasov wrote:
Hello guys, I am following the Tango with Django tutorial and cant  access my admin site. For the past hour and a half I was trying to figure out why i get the following 

I also follow the Official Django Tut and i checked to see if i would get the same error, but i didn't.. Everything worked fine and in there i dont have the views file that is shown in this error. I checked both projects files and they seem the same. Any advice?

--
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+unsubscribe@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/8a74498e-3510-40d2-80c3-f244dbd9d717%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Update user and user profile same form

Henrique,

It looks like what you're looking for is a formset: https://docs.djangoproject.com/en/1.6/topics/forms/formsets/

Andrew

On Saturday, June 28, 2014 11:28:35 PM UTC+9, Henrique Oliveira wrote:
Hi Guys,

I have this model:

class Member(models.Model):
    user = models.OneToOneField(User, primary_key=True)
    date_of_birth = models.DateField('Date of Birth')

    class Meta:
        db_table = 'member'

    def member_email(self):
        return self.user.email

    def first_name(self):
        return self.user.first_name

I'd like to update both, User and Member, in the same form, how can i do that?

--
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+unsubscribe@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/d8ac8517-30e9-4877-a77d-d5099d6899d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: crm app

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mike

> I'm also interested django-cms for another project so thank you for
> steering me in that direction.

Unfortunately i didn't read your first post thoroughly enough. I am
using django-cms (content management system) not django-crm (customer
relationship management).
But if you are looking for cms functionality, give django-cms a try.

Andreas

- --
Kurs 10 / IT-Consulting
Andreas Schosser a@kurs-10.de

St.-Cajetan-Str. 13 Telefon +49 89 41615842-0
81669 München Telefax +49 89 41615842-3

0x6EDECCF1 - 2AA0 939B 5585 819B FCE8 E43B 0B8E 0DF2 6EDE CCF1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTr9GxAAoJEAuODfJu3szxYdIH/3q/oVd9F8P0at3Rlrh8XVht
QBs3i1aC4NOVJxjw14Lv4RTbw0Gvrd1wte9BfBKmxAO37lAc1QAeR/vV/IUbHhD5
iU2NHNR18huWmg2G0/40u+X25f1mRkRn1jRuDVJycB4ZpHCopRXaZZ6MH0Yf6s8t
3gXlsRWpZbVI5xMsChwX7GBqdnUbSvxw6qpBmk72eQi5I+JCren2GCc0BRq63MuS
Abv7uPZeURQMb7wzPliqnFfLBmUJksDB7so8E9Q3tnHYo15HRFpnkbCaXcKMv5Vw
r7Q/yfs2kCtaZBevPmXE9Dazyu1fTKU4AjIXkRiFxawi+/2MkTCAfdlx6BaPqD8=
=elRs
-----END PGP SIGNATURE-----

--
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+unsubscribe@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/53AFD1B5.6010905%40kurs-10.de.
For more options, visit https://groups.google.com/d/optout.

Re: The Django 1.7 tees!

Hi Russell,

I hope you are well. As it turned out, my order was never received (I never got the confirmation emails in question). Is there the slightest possibility that you could start a *final* TeeSpring campaign for the final release of 1.7? I see that RC1 is out.

Any concession would be hugely appreciated.

Kind regards,
Lloyd


On Sun, Jun 8, 2014 at 10:46 AM, Russell Keith-Magee <russell@keith-magee.com> wrote:
Hi Lloyd,

You should have got an email when you placed your order, and another when the campaign completed (i.e., last Sunday). If you didn't get either of those emails, then I don't know what's happened with your order - you might want to contact TeeSpring support.

Yours,
Russ Magee %-)

On Sunday, June 8, 2014, Sithembewena Lloyd Dube <zebra05@gmail.com> wrote:
Hi Russell,

Emails from Teespring? I cannot seem to find any - not even in my trash?? :( You are right though, the currency arbitrage at most banks is shocking - and the fees are not insignificant.

I am not sure what went on here and I am really jittery because I badly want a 1.7 tee. This is a milestone release and I want to keep  a memento. I actually wanted to go back and buy a second, which is when I realised I knew nothing of the first transaction. If nothign happens i will just ask the mailing list if anyone has a small tee they want to let go off.

Again, thanks for your help (and patience).

Kind regards,
Lloyd


On Sun, Jun 8, 2014 at 2:32 AM, Russell Keith-Magee <russell@keith-magee.com> wrote:
Hi Lloyd; 

The emails you've received from Teespring give all the details, including a link that should let you track progress of your order. I don't have access to any info beyond that.

However, personally, I wouldn't take absence of a bank record to be evidence of anything. Interbank currency arbitrage is a mess :-)

Yours,
Russ Magee %-)


On Sunday, June 8, 2014, Sithembewena Lloyd Dube <zebra05@gmail.com> wrote:
Hi Russell,

Thanks for the feedback. I still do not see anything processed on the card - am getting a bit worried here. Is there some way I could find out what happened to my order?

Kind regards,
Lloyd


On Tue, Jun 3, 2014 at 1:56 AM, Russell Keith-Magee <russell@keith-magee.com> wrote:
Hi Lloyd,

The card won't be debited until the campaign completes, which was over the weekend; I'm guessing that means the bank wouldn't have processed anything until Monday, and as with all bank things, it might take a day or two to show up in statements.

The actual shirts should have gone into production on Monday as well, and generally ship within 2 weeks. US deliveries take 7-14 days from end of campaign; international take 14-21 days.

Yours,
Russ Magee %-)


On Mon, Jun 2, 2014 at 8:13 PM, Sithembewena Lloyd Dube <zebra05@gmail.com> wrote:
Hey Russell,

I placed an order for a small tee, but I see my card has not been debited in my bank statement? When do they get charged/ shipped?

Thanks,
Lloyd


On Wed, May 21, 2014 at 2:17 PM, Sithembewena Lloyd Dube <zebra05@gmail.com> wrote:
Hi Russell,

Thank you! I really appreciate you bringing the campaign back :)

Kind regards,
Sithu


On Wed, May 21, 2014 at 1:35 PM, Russell Keith-Magee <russell@keith-magee.com> wrote:
Hi Sithu,

Good news! It turns out you weren't the only person to have problems placing an order, so we've re-opened the campaign for one last run to make sure everyone who wants a shirt can get one. You can place your order here:


You have until the end of May.

Yours,
Russ Magee %-)



On Thu, May 1, 2014 at 7:03 PM, Sithembewena Lloyd Dube <zebra05@gmail.com> wrote:
Hi Russell,

Thank you for the feedback. I'm hoping that others may show interest so that the campaign could be re-opened. I will be watching this closely :)

Kind regards,
Sithu


On Thu, May 1, 2014 at 2:39 AM, Russell Keith-Magee <russell@keith-magee.com> wrote:
Hi Sithu,

Unfortunately, we can't add orders once the campaign is closed - this is one of the features of TeeSpring as a fund raising method.

We *can* relaunch the campaign, but that campaign would be independent to the original. It would have its own sales target, its own closing date, and so on. 

The lowest we can set the sales target is 20 shirts. I know there are about 6 other orders out there from people who missed the deadline; if there's any other interest out there (speak up in a reply if you're interested), we might consider reopening the campaign for a week.

Yours,
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJxq84_c5M9PhGT%2BGyr7erbgZOiaZbicc4dL8dkN7nG9G_517g%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Sithu Lloyd Dube

--
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+unsubscribe@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/CAH-SnCBC9zFXjWSfg%3D-SAzPF2G-a3mxf4SRV9zf5%2B7s0VtLAXA%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+unsubscribe@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/CAJxq84_rnGRGDP0pKmo9zNhHcgjF44rT0KVfU-_h5ikoe18Ftg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Sithu Lloyd Dube

--
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+unsubscribe@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/CAH-SnCAU2BT%3De2FbfeG9odaw-BQ%2BQGP5rO_iDV-0uaY7uSX0SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: crm app

Andreas

I'm also interested django-cms for another project so thank you for
steering me in that direction.

Cheers

Mike

On 28/06/2014 10:59 PM, Andreas Schosser wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Mike
>
>> Do you know if Django-CRM is suitable for an end user?
>
> I have set up several projects with django-cms. The backend is easy to
> use and you can integrate your own apps with no great effort.
>
> Andreas
>
> - --
> Kurs 10 / IT-Consulting
> Andreas Schosser a@kurs-10.de
>
> St.-Cajetan-Str. 13 Telefon +49 89 41615842-0
> 81669 München Telefax +49 89 41615842-3
>
> 0x6EDECCF1 - 2AA0 939B 5585 819B FCE8 E43B 0B8E 0DF2 6EDE CCF1
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJTrrwlAAoJEAuODfJu3szxWawH/3Tfvt67LcrbzChQVYbZLWNV
> 8p+0+nTGvIaejsdmso4E2iW33PV0woFS8UdY0Glm+vE+fRHDvL6IdAQDZd1AthBW
> KpyPT7HAW/mCgdm7rRIwK7fyLGj/IUW9MN3zQAOvl4iXyRMue8hYvlnf/dzudoZg
> eKSzXHuWd6v2HRd0Jr/sSI1y4OeKlclEdcq3ptAvxdulbxgJ3+hOD2r7O4CPmxD9
> l6KEesV8/R35FDEJWuki5vuN9hWxPQ84JZ7+ZTzXS8Mlfz/UbSqiaCnxOuogHOoR
> akpIkPZ+44IMgQD4Wo0AWdmG4C8Blo/Cj52lJ3/5s7O8E6M+fVZX6KeCBAElrng=
> =CAJ/
> -----END PGP SIGNATURE-----
>

--
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+unsubscribe@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/53AFC37E.6030905%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Re: crm app

On 28/06/2014 6:18 PM, Phang Mulianto wrote:
> have a look of openerp which have crm on the package..

Thanks Phang - I discovered the CRM comparison on wikipedia which lists
a couple of Django CRMs ao I'll check openERP and the others.

>
> it has cloud offer also, and is still free for a few user.
>
>
> On Sat, Jun 28, 2014 at 1:42 PM, Mike Dewhirst <miked@dewhirst.com.au
> <mailto:miked@dewhirst.com.au>> wrote:
>
> 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+unsubscribe@__googlegroups.com
> <mailto:django-users%2Bunsubscribe@googlegroups.com>
> <mailto:django-users+__unsubscribe@googlegroups.com
> <mailto:django-users%2Bunsubscribe@googlegroups.com>>.
>
> To post to this group, send email to
> django-users@googlegroups.com <mailto:django-users@googlegroups.com>
> <mailto:django-users@__googlegroups.com
> <mailto:django-users@googlegroups.com>>.
>
> Visit this group at
> http://groups.google.com/__group/django-users
> <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
> <https://groups.google.com/d/msgid/django-users/247fd82c-0b64-4731-a409-37b8f3a22870%40googlegroups.com>
> <https://groups.google.com/d/__msgid/django-users/247fd82c-__0b64-4731-a409-37b8f3a22870%__40googlegroups.com?utm_medium=__email&utm_source=footer
> <https://groups.google.com/d/msgid/django-users/247fd82c-0b64-4731-a409-37b8f3a22870%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> For more options, visit https://groups.google.com/d/__optout
> <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+unsubscribe@__googlegroups.com
> <mailto:django-users%2Bunsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at http://groups.google.com/__group/django-users
> <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
> <https://groups.google.com/d/msgid/django-users/53AE55BA.4010804%40dewhirst.com.au>.
>
> For more options, visit https://groups.google.com/d/__optout
> <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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto: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%2BSr5mTi7z1SVBKJoWrTQTU8p%2BDwn2iW%2B-jMJwZRqWQRhpmm7Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BSr5mTi7z1SVBKJoWrTQTU8p%2BDwn2iW%2B-jMJwZRqWQRhpmm7Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> 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+unsubscribe@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/53AFC2CF.9040808%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Re: django user authenication form in modal form twitter bootstrap

The issue is almost resolved. The only problem now I am facing is when I include login function which provides form with csrf token. The bootstrap modal forms dissappear immediately after is comes on screen. If I do not include this url using data-remote option the modal comes. But without csrf it do not let me login. 

Here is code 
********************************************************************************************************************
@csrf_protect
def login(request):
    return render_to_response('login.html',{},RequestContext(request))
********************************************************************************************************************
<div class="modal" id="myModal" data-remote="/accounts/login/" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

Now the code in red is issue. when I include the the modal does not stay. 

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+unsubscribe@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/12cf734e-7204-475c-a65f-a88d2fe08a17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: crm app

On 29/06/2014 2:45 AM, Kelvin Wong wrote:
> I've not used Django-CRM.
>
> I've used Salesforce in the past, but it is even more overkill than
> SugarCRM. It is incredibly flexible though. It depends on what your
> client's requirements are.
>
> Keep in mind what they are going to do for on-going support (backup,
> etc). Non-tech users always need support and training. As developers it
> is easy to take this for granted.

You are absolutely right. I won't forget!

>
> K
>
>
> On Friday, June 27, 2014 10:42:48 PM UTC-7, Mike Dewhirst wrote:
>
> Thanks Kelvin. It looks good at first glance.
>
> Do you know if Django-CRM is suitable for an end user?
>
> 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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto: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/bfb40a14-fa55-463a-b0a3-1c2ec4f231a6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/bfb40a14-fa55-463a-b0a3-1c2ec4f231a6%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 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+unsubscribe@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/53AFC26D.3060302%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Saturday, June 28, 2014

Re: Best Django apps/extensions

http://phpdude.github.io/django-macros-url/

Macros url for simplifying routing :)

On Friday, June 27, 2014 7:22:33 PM UTC+7, 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+unsubscribe@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/d7e6414d-da24-45c5-8f77-0ebcdb132645%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Right way add dynamically fields to model and migrations

Hi all!

Have little problem.

I have Custom Field like abstract RichTextEditor which can parse entered text to html some ways. For performance optimization this fields caches parsed data in separate field of model which creates dynamically.

Take a look into code.

    def contribute_to_class(self, cls, name):
        if self.add_rendered_field and not cls._meta.abstract:
            preview_field = models.TextField(editable=False, blank=True, null='')
            cls.add_to_class(_preview_field_name(name), preview_field)

            readmore_field = models.CharField(editable=False, blank=True, null='', max_length=250)
            cls.add_to_class(_readmore_field_name(name), readmore_field)
        super(RichTextField, self).contribute_to_class(cls, name)
        setattr(cls, self.name, MarkupDescriptor(self))

For example in my model i adding this type of fields by piece of code:

content = RichTextEditor()

All working good until i want to migrate this app :)

As result of migration i getting fields in migration file.

                ('content', project.apps.utils.fields.RichTextField()),
                ('_content_preview', models.TextField(null=b'', editable=False, blank=True)),
                ('_content_readmore', models.CharField(max_length=250, null=b'', editable=False, blank=True)),

This is ok, but when i start migration i getting error.

django.db.utils.ProgrammingError: column "_content_preview" specified more than once.

This error throwed because one time this field added from migration file and second time it added from field initialization for content field.

                ('content', project.apps.utils.fields.RichTextField()),


Does anybody have same problems? 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+unsubscribe@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/24164b62-14b5-42f2-bdb1-dbeedf0a5d1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

admin ViewDoesNotExistError

Hello guys, I am following the Tango with Django tutorial and cant  access my admin site. For the past hour and a half I was trying to figure out why i get the following 

I also follow the Official Django Tut and i checked to see if i would get the same error, but i didn't.. Everything worked fine and in there i dont have the views file that is shown in this error. I checked both projects files and they seem the same. Any advice?

--
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+unsubscribe@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/d015d310-c970-497d-9544-93a0e6a3ca13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: crm app

I've not used Django-CRM.

I've used Salesforce in the past, but it is even more overkill than SugarCRM. It is incredibly flexible though. It depends on what your client's requirements are.

Keep in mind what they are going to do for on-going support (backup, etc). Non-tech users always need support and training. As developers it is easy to take this for granted.

K


On Friday, June 27, 2014 10:42:48 PM UTC-7, Mike Dewhirst wrote:
Thanks Kelvin. It looks good at first glance.

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

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+unsubscribe@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/bfb40a14-fa55-463a-b0a3-1c2ec4f231a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Full text search available on PostgreSQL?

Hi,

Just saw that django.contrib.admin.ModelAdmin.search_fields full text search only support MySQL.

Are there plans on any progress towards getting this functionality on PostgreSQL?

Thanks

--
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+unsubscribe@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/f0071b4f-a368-4512-a6f7-79d921e32141%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Update user and user profile same form

Hi Guys,

I have this model:

class Member(models.Model):
    user = models.OneToOneField(User, primary_key=True)
    date_of_birth = models.DateField('Date of Birth')

    class Meta:
        db_table = 'member'

    def member_email(self):
        return self.user.email

    def first_name(self):
        return self.user.first_name

I'd like to update both, User and Member, in the same form, how can i do that?

--
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+unsubscribe@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/6dafa254-91d9-453d-947d-c02cd10514fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: models

On Sat, 28 Jun 2014 02:22:30 -0700 (PDT), ngangsia akumbo
<ngangsia@gmail.com> declaimed the following:

>please what can go within these models
>
>page, events, news, offers, room types, services


What models? What is the problem description?

All you've listed is six nouns -- and "page" could refer to paper or a
broadcast message asking for someone to report in at a desk.

For all I can tell, you are laying out tourism brochures listing hotels
and conventions.


--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

--
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+unsubscribe@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/fshtq9td318me8fsc3ijdqhqjotiq8km0j%404ax.com.
For more options, visit https://groups.google.com/d/optout.

Re: Returning submitted formset data to the template for further editing

Daniele,

It doesn't seem like there's an easier way to do what you're proposing. However, what's the form data manipulation that you need to do for some of these forms? Is there a way to separate that from the form set submission?

Andrew

On Saturday, June 28, 2014 12:26:34 AM UTC+9, Daniele Procida wrote:
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+unsubscribe@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/21db66a8-68df-45ea-9b3b-128394462f14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: crm app

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mike

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

I have set up several projects with django-cms. The backend is easy to
use and you can integrate your own apps with no great effort.

Andreas

- --
Kurs 10 / IT-Consulting
Andreas Schosser a@kurs-10.de

St.-Cajetan-Str. 13 Telefon +49 89 41615842-0
81669 München Telefax +49 89 41615842-3

0x6EDECCF1 - 2AA0 939B 5585 819B FCE8 E43B 0B8E 0DF2 6EDE CCF1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTrrwlAAoJEAuODfJu3szxWawH/3Tfvt67LcrbzChQVYbZLWNV
8p+0+nTGvIaejsdmso4E2iW33PV0woFS8UdY0Glm+vE+fRHDvL6IdAQDZd1AthBW
KpyPT7HAW/mCgdm7rRIwK7fyLGj/IUW9MN3zQAOvl4iXyRMue8hYvlnf/dzudoZg
eKSzXHuWd6v2HRd0Jr/sSI1y4OeKlclEdcq3ptAvxdulbxgJ3+hOD2r7O4CPmxD9
l6KEesV8/R35FDEJWuki5vuN9hWxPQ84JZ7+ZTzXS8Mlfz/UbSqiaCnxOuogHOoR
akpIkPZ+44IMgQD4Wo0AWdmG4C8Blo/Cj52lJ3/5s7O8E6M+fVZX6KeCBAElrng=
=CAJ/
-----END PGP SIGNATURE-----

--
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+unsubscribe@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/53AEBC2A.2030904%40kurs-10.de.
For more options, visit https://groups.google.com/d/optout.

models

please what can go within these models

page, events, news,  offers,  room types, services

--
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+unsubscribe@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/1976ff72-19fe-4094-82da-e2c1253a9a25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: crm app

have a look of openerp which have crm on the package..

it has cloud offer also, and is still free for a few user.


On Sat, Jun 28, 2014 at 1:42 PM, Mike Dewhirst <miked@dewhirst.com.au> wrote:
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+unsubscribe@googlegroups.com
<mailto:django-users+unsubscribe@googlegroups.com>.

To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>. <https://groups.google.com/d/msgid/django-users/247fd82c-0b64-4731-a409-37b8f3a22870%40googlegroups.com?utm_medium=email&utm_source=footer>.

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+unsubscribe@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.

--
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+unsubscribe@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%2BSr5mTi7z1SVBKJoWrTQTU8p%2BDwn2iW%2B-jMJwZRqWQRhpmm7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Friday, June 27, 2014

Re: crm app

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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto: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
> <https://groups.google.com/d/msgid/django-users/247fd82c-0b64-4731-a409-37b8f3a22870%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 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+unsubscribe@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.

Re: django user authenication form in modal form twitter bootstrap

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 <mario.gudelj@gmail.com> 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" <findsarfaraz@gmail.com> 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 


<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="myModalLabel">Modal title</h4>
                </div>
                <div class="modal-body">
                    <form action='/accounts/auth/' method='post'>{%csrf_token%}
                        <label for="username">User Name:</label>
                        <input type="text" name="username" value="" id="username">
                        <label for="password">Password:</label>
                        <input type="password" name="password" value="" id="password">
                        <input type="Submit" value="login" class="btn btn-primary">
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save changes</button>
                </div>
        </div>
    </div>
</div>

When I click on link which has following code
 <li><a href="/accounts/login/" data-toggle="modal" data-target="#myModal" >Login</a></li>

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 <findsarfaraz@gmail.com> 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 <roman.klesel@gmail.com> 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 <findsarfaraz@gmail.com>:
> 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
>
>  <li><a href="/accounts/login/" data-toggle="modal"
> data-target="#myModal">Login</a></li>
>
> That is code for login.html which is modal included in my base.html
>
>
> <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
> aria-labelledby="myModalLabel" aria-hidden="true">
>     <div class="modal-dialog">
>         <div class="modal-content">
>             <div class="modal-header">
>                 <button type="button" class="close"
> data-dismiss="modal"><span aria-hidden="true">&times;</span><span
> class="sr-only">Close</span></button>
>                 <h4 class="modal-title" id="myModalLabel">Modal title</h4>
>             </div>
>             <div class="modal-body">
>                 <form action='/accounts/auth/' method='post'>{% csrf_token
> %}
>                     <label for="username">User Name:</label>
>                     <input type="text" name="username" value=""
> id="username">
>                     <label for="password">Password:</label>
>                     <input type="password" name="password" value=""
> id="password">
>                     <input type="Submit" value="login" class="btn
> btn-primary">
>                 </form>
>             </div>
>             <div class="modal-footer">
>                 <button type="button" class="btn btn-default"
> data-dismiss="modal">Close</button>
>                 <button type="button" class="btn btn-primary">Save
> changes</button>
>             </div>
>         </div>
>     </div>
> </div>
>
> --
> 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+unsubscribe@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+unsubscribe@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





--
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+unsubscribe@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/CAEPJdiytV_ijs%3D8drXtJnaMBX82h%2BLxXddYFxQCki12-%3DgYFuw%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+unsubscribe@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/CAHqTbjniZLq_YKSfBX6Zha4fHDyq6excFSuNNaVbWZ6vAi%2BbgQ%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+unsubscribe@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/CAEPJdiwiHeiEADmH%2B2OE43648DJxxhHHzRjk%2BRyo%3DLiULxz6Cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.