Re: Upgrading to 1.9 - Any Easy Guide ?

2016-01-14 Thread Vibhu Rishi
Thanks Andre!

On Tue, Jan 12, 2016 at 7:04 PM, André Jarussi <jarussimain...@gmail.com>
wrote:

> Hello,
>
> I recently had to upgrade from Django 1.4 to 1.8 (not quite ready for 1.9)
> ... I made the upgrade with the minor realeases .. I didn't had much
> trouble with the patches ..
>
> basically .. 1.4 to 1.5 .. deploy .. see whats wrong .. 1.5 to 1.6 ..
> deploy .. see whats wrong ..  until you reach the version you wanna stay.
>
> It's a lot less painfull .. and boring.
>
> Read the release notes before starting any upgrade. It really helps you
> have an understading on what's changing and how that affects you.
>
> https://docs.djangoproject.com/en/stable/releases/1.5/
>
>
> Good luck!!
>
>
> On Tuesday, January 12, 2016 at 10:36:28 AM UTC-2, Vibhu Rishi wrote:
>>
>> Hi Tom
>>
>> So essentially you are saying to go with upgrade to 1.7 - fix issues and
>> then to 1.8 etc ?
>>
>> V.
>> On Jan 11, 2016 11:45 PM, "'Tom Evans' via Django users" <
>> django...@googlegroups.com> wrote:
>>
>>> On Mon, Jan 11, 2016 at 4:36 PM, Vibhu Rishi <vibhu...@gmail.com> wrote:
>>> > Hi
>>> >
>>> > I work on a hobby project on and off which is based on django. After a
>>> long
>>> > gap, I picked up the work again. In the meantime, it seems that django
>>> has
>>> > been evolving faster than I have been working. I am currently on 1.6
>>> (which
>>> > I think i had upgraded from 1.4 or 1.3 as my starting base). However,
>>> the
>>> > current new version of Django is 1.9
>>> >
>>> > I created a new virtual environment and used pip to get the latest
>>> version
>>> > of django.
>>> >
>>> > Now I am getting a lot of errors.
>>>
>>> That is the hard way.
>>>
>>> >
>>> > Is there an easy way to upgrade django ? Or a howto for best practices
>>> ?
>>> >
>>>
>>> (Releases have version components: "1.9.1" is major release 1, minor
>>> release 9, minor-minor release 1)
>>>
>>> If you are on release 1.N, update to release 1.N+1.Y (with Y being the
>>> highest released minor-minor version), and step through its release
>>> notes dealing with all the things which have changed or been
>>> deprecated, and update them accordingly. Run your test suite to
>>> determine if anything has been broken (pro tip: tests are useful - you
>>> might want to write some if you don't already test your most common
>>> features)
>>>
>>> Then, do the next minor release until you reach the latest release.
>>>
>>> A more complete process would be to update to 1.N+1, ensure tests pass
>>> and deprecated behaviour handled, THEN subsequently to 1.N+1.Y, ensure
>>> tests pass and only then go to the next minor version. That can be a
>>> bit paranoid, as (deliberately) not much functionality or breaking
>>> changes are added in minor-minor releases of django.
>>>
>>> Release notes are here:
>>> https://docs.djangoproject.com/en/1.9/releases/
>>>
>>> Cheers
>>>
>>> Tom
>>>
>>> PS: Best practices are not to fall that far behind!
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAFHbX1LiKM3pzb1bAFTk88iLmbJKWpEaa3NTMdsVw3WJ%2BRwbdw%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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3f247925-dc62-4109-8add-379ce704b8c5%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3f247925-dc62-4109-8ad

Re: Upgrading to 1.9 - Any Easy Guide ?

2016-01-12 Thread Vibhu Rishi
Hi Tom

So essentially you are saying to go with upgrade to 1.7 - fix issues and
then to 1.8 etc ?

V.
On Jan 11, 2016 11:45 PM, "'Tom Evans' via Django users" <
django-users@googlegroups.com> wrote:

> On Mon, Jan 11, 2016 at 4:36 PM, Vibhu Rishi <vibhu.ri...@gmail.com>
> wrote:
> > Hi
> >
> > I work on a hobby project on and off which is based on django. After a
> long
> > gap, I picked up the work again. In the meantime, it seems that django
> has
> > been evolving faster than I have been working. I am currently on 1.6
> (which
> > I think i had upgraded from 1.4 or 1.3 as my starting base). However, the
> > current new version of Django is 1.9
> >
> > I created a new virtual environment and used pip to get the latest
> version
> > of django.
> >
> > Now I am getting a lot of errors.
>
> That is the hard way.
>
> >
> > Is there an easy way to upgrade django ? Or a howto for best practices ?
> >
>
> (Releases have version components: "1.9.1" is major release 1, minor
> release 9, minor-minor release 1)
>
> If you are on release 1.N, update to release 1.N+1.Y (with Y being the
> highest released minor-minor version), and step through its release
> notes dealing with all the things which have changed or been
> deprecated, and update them accordingly. Run your test suite to
> determine if anything has been broken (pro tip: tests are useful - you
> might want to write some if you don't already test your most common
> features)
>
> Then, do the next minor release until you reach the latest release.
>
> A more complete process would be to update to 1.N+1, ensure tests pass
> and deprecated behaviour handled, THEN subsequently to 1.N+1.Y, ensure
> tests pass and only then go to the next minor version. That can be a
> bit paranoid, as (deliberately) not much functionality or breaking
> changes are added in minor-minor releases of django.
>
> Release notes are here:
> https://docs.djangoproject.com/en/1.9/releases/
>
> Cheers
>
> Tom
>
> PS: Best practices are not to fall that far behind!
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFHbX1LiKM3pzb1bAFTk88iLmbJKWpEaa3NTMdsVw3WJ%2BRwbdw%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPiONwn%3DWyB_k1L2pHz%2BBu1bmhQFX_Bd0SmAH4o4%2BC3Brj99rQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Upgrading to 1.9 - Any Easy Guide ?

2016-01-11 Thread Vibhu Rishi
Hi

I work on a hobby project on and off which is based on django. After a long
gap, I picked up the work again. In the meantime, it seems that django has
been evolving faster than I have been working. I am currently on 1.6 (which
I think i had upgraded from 1.4 or 1.3 as my starting base). However, the
current new version of Django is 1.9

I created a new virtual environment and used pip to get the latest version
of django.

Now I am getting a lot of errors.

Is there an easy way to upgrade django ? Or a howto for best practices ?

Thanks
V.

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPiONwmXN%2BVPs7OhpkSL1mMNVskqkVo20UFoY0cEoR5kcUDwXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Implementing a timeline of objects

2015-04-18 Thread Vibhu Rishi
Hi Folks,

I am playing around with Django and making a site for my motorcycling
group.

I am trying to implement a timeline view and thought I would share my
thoughts with you and get some feedback.

So far, I have a few models which can be user created. A user can add a
'bike' , or a 'place' or add 'tips' to the place. Now, I want this all to
be shown in a single flow on a page. Lets say the URL for this is
/timeline.

I am trying to figure out which is the best way to aggregate this data. So,
far I have been thinking of the following :
1. Create another object, which I can call "timeline" object, and when the
save for any of the above objects is called, I also create a 'timeline'
object, and populate with the pk and a choice_field item for the 3 models.
I don't particularly like this as if I want to add a new object, I will
need to make changes to multiple places.
2. I create a base model from which I derive these models. There are a few
common fields for the timeline view which create the base model. However, I
don't know how i can differentiate between the different model types when I
implement the view & Template.
3. If there is a way to chain the objects together in a view. In this case,
I don't have to change my current code much - but I could not figure out if
this can be implemented.  Essentially, i do a get on the different models
into a meta model , sort them by creation timestamp and render in the view.

What are your thoughts ?

V.

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONw%3DM7w0e3%3D7droYgXcDsirw0n3kxjfsC-2BEPSgE6WkcZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Alternatives to markup and comments modules

2014-08-08 Thread Vibhu Rishi
I just picked up an old project i was working on ( wasn't working on it for
a year almost), and now the comments and markup modules are not working. It
seems that they have been depricated in 1.6  ( project was in 1.4 ).

What are the current alternatives for these ?

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwn%2BcAAJ3pPMzPJEGBd4apvqwdhjsCGj75tff7kaA_rXeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to pass URL to a view

2014-05-28 Thread Vibhu Rishi
Thanks Ilya ! Perfect ! That is what I was missing.

And point noted about reverse.

V.


On Wed, May 28, 2014 at 6:04 PM, Ilya Kazakevich <
ilya.kazakev...@jetbrains.com> wrote:

> Hello,
>
> 1) Never hardcode urls in Django. Use reverse:
> https://docs.djangoproject.com/en/dev/ref/urlresolvers/#django.core.urlresolvers.reverse
> 2) If I understood you correctly, you need to redirect user back. Use
> request header REFERER' (check rfc2616 section 14.36). For Django:
> http://stackoverflow.com/questions/12758786/redirect-return-to-same-previous-page-in-django
> See also: https://docs.djangoproject.com/en/dev/ref/request-response/
>
> Be sure to check this header exists.
>
>
> Ilya Kazakevich,
> JetBrains PyCharm (Best Python/Django IDE)
> http://www.jetbrains.com/pycharm/
> "Develop with pleasure!"
>
>
> >-Original Message-
> >From: django-users@googlegroups.com
> >[mailto:django-users@googlegroups.com] On Behalf Of Vibhu Rishi
> >Sent: Wednesday, May 28, 2014 4:23 PM
> >To: django-users@googlegroups.com
> >Subject: How to pass URL to a view
> >
> >Hi,
> >
> >
> >Maybe there is a better way to achieve what I am trying - so any
> suggestion is
> >welcome :)
> >
> >
> >I have a small view. It does nothing much - if the user clicks a button
> for being
> >interested in something he is looking at - it adds to the table of
> interested things.
> >e.g. as below :
> >
> >@login_required
> >def add_interested_project(request, project_id):
> >project = get_object_or_404(Project, pk=project_id)
> >try:
> >InterestedProject.objects.get(user__pk=request.user.id,
> >project__pk=project.id)
> >except InterestedProject.DoesNotExist:
> >InterestedProject.objects.create(user=request.user,
> project=project)
> >return HttpResponseRedirect("/projects/" + project_id)
> >
> >
> >
> >Now this works fine if he is in the details page e.g. as per the url
> /projects/4 . It
> >works as expected, I am able to add to the table and it redirects back to
> the
> >same page.
> >
> >However, since this is something which I can call from any place, it
> fails in the
> >sense that it gets redirected back to the project details page. E.g. I
> have a listing
> >of projects, on /projects/ , i click the interested button, it
> unfortunately instead of
> >going back to /projects/ goes to /projects/
> >
> >
> >The code in my template file which calls this :
> >
> > class="glyphicon
> >glyphicon-heart"> Interested 
> >
> >
> >The relevant urls.py hookup :
> >url(r'^(?P\d+)/add_interested_project$',
> >views.add_interested_project, name="interestedProjects"),
> >
> >
> >
> >The solution seems apparent that I should just pass the current URL to
> the view
> >so that I can do a redirect back to it - but I am not able to get an
> example of how
> >to actually implement it.
> >
> >
> >Regards,
> >
> >Vibhu
> >
> >
> >--
> >Simplicity is the ultimate sophistication. - Leonardo da Vinci Life is
> really simple,
> >but we insist on making it complicated. - Confucius
> >
> >--
> >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/CAPiONwmgaEG5cCO2LDOh3
> >dJ%2BD8ViYbQvkAk34wBRgD--3e8iQQ%40mail.gmail.com
> ><https://groups.google.com/d/msgid/django-users/CAPiONwmgaEG5cCO2LDOh
> >3dJ%2BD8ViYbQvkAk34wBRgD--3e8iQQ%40mail.gmail.com?utm_medium=emai
> >l_source=footer> .
> >For more options, visit https://groups.google.com/d/optout.
> >
> >
> >No virus found in this message.
> >Checked by AVG - www.avg.com
> >Version: 2014.0.4592 / Virus Database: 3950/7573 - Release Date: 05/27/14
> >
> >
> >
> >No virus found in this message.
> >Checked by AVG - www.avg.com
> >Version: 2014.0.4592 / Virus Database: 3950/7563 - Release Date: 05/26/14
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscrib

How to pass URL to a view

2014-05-28 Thread Vibhu Rishi
Hi,

Maybe there is a better way to achieve what I am trying - so any suggestion
is welcome :)

I have a small view. It does nothing much - if the user clicks a button for
being interested in something he is looking at - it adds to the table of
interested things. e.g. as below :

@login_required
def add_interested_project(request, project_id):
project = get_object_or_404(Project, pk=project_id)
try:
InterestedProject.objects.get(user__pk=request.user.id, project__pk=
project.id)
except InterestedProject.DoesNotExist:
InterestedProject.objects.create(user=request.user, project=project)
return HttpResponseRedirect("/projects/" + project_id)


Now this works fine if he is in the details page e.g. as per the url
/projects/4 . It works as expected, I am able to add to the table and it
redirects back to the same page.

However, since this is something which I can call from any place, it fails
in the sense that it gets redirected back to the project details page. E.g.
I have a listing of projects, on /projects/ , i click the interested
button, it unfortunately instead of going back to /projects/ goes to
/projects/

The code in my template file which calls this :

 Interested 

The relevant urls.py hookup :
url(r'^(?P\d+)/add_interested_project$',
views.add_interested_project, name="interestedProjects"),


The solution seems apparent that I should just pass the current URL to the
view so that I can do a redirect back to it - but I am not able to get an
example of how to actually implement it.

Regards,
Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwmgaEG5cCO2LDOh3dJ%2BD8ViYbQvkAk34wBRgD--3e8iQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django authentication by email

2014-05-15 Thread Vibhu Rishi
Hi,

django-allauth will work for your needs. Give it a try.

http://django-allauth.readthedocs.org/en/latest/

V.


On Thu, May 15, 2014 at 5:26 PM, Frankline  wrote:

> Hi all,
>
> I am thinking of developing a web application where users will have to
> login by their email address instead of using their usernames.
>
> Now I know I can do this by writing my own auth backend, but I'm just
> curious how the rest of you handle this. Do you normally use third party
> packages to handle this instead of writing a custom backend? If so, what
> packages would you recommend that are actively maintained?
>
> Any disadvantages to writing my own custom backend?
>
> 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+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/CAEAUGdUV44ZjMQCxiaVk_Ok9H5SbLP3jfc_rv-vEUsHrtZWmgw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwnMnUtYLn1f%3D6UCK2SGq7vL1kAjzAgKhWLjqR3ET%3Dn7%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating an object using Foreign Key for Users but filtered by group

2014-05-06 Thread Vibhu Rishi
Hi Simon,

this is exactly what I was looking for ! It works perfectly.

I had gone through the documentation for limit_choices_to but I was not
able to figure out how to do the groups part.

Vibhu


On Mon, May 5, 2014 at 8:51 PM, Simon Charette <charett...@gmail.com> wrote:

> You could use the `ForeignKey.limit_choices_to` 
> option<https://docs.djangoproject.com/en/1.6/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to>
> :
>
> class Message(models.Model):
>  moderator = models.ForeignKey(User, limit_choices_to={'groups__name':
> 'Moderator'})
>
>  user= models.ForeignKey(User)
>  text = models.TextField(max_length=1000)
>   date = models.DateField(default=datetime.now())
>
>
> Le lundi 5 mai 2014 09:52:58 UTC-4, Vibhu Rishi a écrit :
>
>> Hi
>>
>> I have Users and based on some requirements, I have created a few User
>> Groups . e.g. I have a group of moderators.
>>
>> Now, I am trying to create a form where a normal user can message the
>> moderators.
>>
>> So, I have a model to be used by the form something like :
>>
>> class Message(models.Model):
>>  moderator = models.ForeignKey(User)
>>  user= models.ForeignKey(User)
>>  text = models.TextField(max_length=1000)
>>  date = models.DateField(default=datetime.now())
>>
>> I want the moderator field to have keys to only those people who are in
>> the group where name='Moderator'
>>
>> I am not sure how to filter the ForeignKey in this case.
>>
>>
>> Why I want to do this --> is so that the form will have a dropdown list
>> of moderators to choose from by the user when it is displayed. User selects
>> the moderator, and enteres the message text - and sends it.
>>
>> Regards,
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>  --
> 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/c381e096-5466-4f4a-8356-95c595b0b28c%40googlegroups.com<https://groups.google.com/d/msgid/django-users/c381e096-5466-4f4a-8356-95c595b0b28c%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwmS6j5Y4Q22w_n1xQQu7ZM8N_dtaCSU%3DyLe6gbFgDcPhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Creating an object using Foreign Key for Users but filtered by group

2014-05-05 Thread Vibhu Rishi
Hi

I have Users and based on some requirements, I have created a few User
Groups . e.g. I have a group of moderators.

Now, I am trying to create a form where a normal user can message the
moderators.

So, I have a model to be used by the form something like :

class Message(models.Model):
 moderator = models.ForeignKey(User)
 user= models.ForeignKey(User)
 text = models.TextField(max_length=1000)
 date = models.DateField(default=datetime.now())

I want the moderator field to have keys to only those people who are in the
group where name='Moderator'

I am not sure how to filter the ForeignKey in this case.


Why I want to do this --> is so that the form will have a dropdown list of
moderators to choose from by the user when it is displayed. User selects
the moderator, and enteres the message text - and sends it.

Regards,
Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkfs%3DcTc5dMVVKdZAeRvR0vOTz6%2B03oL1FiG_%2BumJBOeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: FieldError, But Only In Production

2014-02-13 Thread Vibhu Rishi
Seems to me somewhere in the code it is trying to put user into a field
instead of treating it as a table.
Basic sanity checks :
- is the djagno versions on both production and local same ?
- same for wsgi and apache ?
- syncdb worked fine ?

V.



On Thu, Feb 13, 2014 at 11:30 AM, Rich Jones  wrote:

> Hey guys!
>
> I've got a real stumper here. Pulling my hair out over this one, would
> really appreciate some options!
>
> Anywhere in my application that calls user.get_profile() causes a
> FieldError.. but only in production. I'm using WSGI and Apache.
>
> When I run locally with:
>
>  python manage.py runserver 0.0.0.0:
>
> it works just fine. However, running the exact same code and the exact
> same database with Apache, I get a 500 and find this in the logs:
>
>  [Wed Feb 12 21:23:21 2014] [error] [client] FieldError: Cannot
> resolve keyword 'user' into field. Choices are: about_me, about_me_mkd,
> etc..
>
> (Full traceback: http://pastebin.com/6141pHZ2)
>
> When I run sqlall, there is a users_id entry for the model:
>
> "user_id" integer NOT NULL UNIQUE REFERENCES "auth_user" ("id")
> DEFERRABLE INITIALLY DEFERRED
>
> What could possibly be happening here? What could the difference between
> devserver and Apache?
>
> (For reference, this is using Django-Userena 1.0, Django 1.3.7. and
> Postgres 8.4.)
>
> I've tried a few things I found on the internet:
>
>
> http://stackoverflow.com/questions/19145787/fielderror-cannot-resolve-keyword--into-field
>
> http://chase-seibert.github.io/blog/2010/04/30/django-manytomany-error-cannot-resolve-keyword-xxx-into-a-field.html
>
> Which both suggest that it has something to do with the order of the
> imports, but I haven't had any success with this approach.
>
> There is an extremely old Django bug seemingly related to this,
>
> https://code.djangoproject.com/ticket/1796
>
> but I don't know how relevant this is, as this is not a ManyToMany
> problem, because Userena uses a OneToOne field:
>
> user = models.OneToOneField(User,
> unique=True,
> verbose_name=_('user'),
> related_name='profile')
>
> Can anybody help me? I'm going nuts over here. I just don't know why the
> behavior would be different for runserver and Apache!
>
> Any ideas?
>
> Thanks so much!,
> Rich
>
>  --
> 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/41e0fdbe-520d-44a4-b3b5-ee4914d0e099%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONw%3DwazFkycVy%3DAwoj99uq4RgqhFu%2B2iotZz712AKa0U%3DYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django with Ubuntu Cloud

2014-01-31 Thread Vibhu Rishi
So - I can use Ubuntu One ( which seems to be like Drop box if I understand
it correctly ) as a media file storage?

V.
On Jan 31, 2014 12:47 PM, "Me Sulphur"  wrote:

> Django is a fairly flexible web framework. See read more about STATIC and
> MEDIA files in Django. The Ubuntu cloud API is documented here
> https://one.ubuntu.com/developer/files/store_files/cloud, you can
> interact with it using libraries like requests.
>
> https://docs.djangoproject.com/en/dev/howto/static-files/
>
> --
> 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/d132b6ad-1f34-4585-888e-20801e020ad0%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAPiONw%3DHWTD%3DyERPuHg60q6RsgiCdwt_skr7b%2BSUB1sbn5izRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django with Ubuntu Cloud

2014-01-31 Thread Vibhu Rishi
Thanks Russ.
On Jan 31, 2014 12:42 PM, "Russell Keith-Magee" <russ...@keith-magee.com>
wrote:

> Hi Vibhu,
>
> Everything I know about Ubuntu Cloud I learned from their homepage in the
> last couple of minutes --  but that website seems to suggest that Ubuntu
> Cloud is based on OpenStack. OpenStack is a generic API for cloud computing
> that is shared by a number of providers (most notably Rackspace, but there
> are others), so if Ubuntu Cloud uses OpenStack, then you just need to look
> for libraries that support OpenStack, and you should be able to use those
> libraries on Ubuntu Cloud.
>
> If you're looking for an alternative to S3, then you want OpenStack Swift.
> There are Python libraries to talk to Swift stores, and there are Django
> file storage backends that will use Swift as well.
>
> Yours,
> Russ Magee %-)
>
>
>
>
>
> On Fri, Jan 31, 2014 at 2:56 PM, Vibhu Rishi <vibhu.ri...@gmail.com>wrote:
>
>> Hi,
>>
>> Has anyone setup Django with Ubuntu Cloud ?
>>
>> My primary interest is how to setup the media server. I am primarily
>> using Heroku for the hosting of the project, but that does not provide
>> hosting for the static / user uploaded files. So, I am looking at what
>> alternatives I have. There are a lot of suggestions to use AWS. I also came
>> across ubuntu cloud - but havent gotten much details if i can use it with
>> ubuntu.
>>
>> Thanks for your insights!
>> V.
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>> --
>> 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/CAPiONwmd9h%2Bcwb1SYseYeiijag4Aa5weeMtg_eqiDgh7txVOKg%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CAJxq84_F2HTfNAH%2BaUN-evCOm-EZBaYvnnk6iimG2-4FrMr9Mw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAPiONwnrZbh-RnVJhtiNaMyT1jq6wMc4%2BO7xc79QUe9Qg13bGg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django with Ubuntu Cloud

2014-01-31 Thread Vibhu Rishi
It requires a CC for sign up - even for the free mode. Can't use mine here
and I don't want to get another CC.

V.
On Jan 31, 2014 1:42 PM, "Andreas Kuhne" <andreas.ku...@suitopia.com> wrote:

> Hi,
>
> Why not use S3 for storage? Then you can still keep heroku and don't have
> to make vast changes to your setup?
>
> Regards,
>
> Andréas
>
>
> 2014-01-31 Vibhu Rishi <vibhu.ri...@gmail.com>:
>
>> Hi,
>>
>> Has anyone setup Django with Ubuntu Cloud ?
>>
>> My primary interest is how to setup the media server. I am primarily
>> using Heroku for the hosting of the project, but that does not provide
>> hosting for the static / user uploaded files. So, I am looking at what
>> alternatives I have. There are a lot of suggestions to use AWS. I also came
>> across ubuntu cloud - but havent gotten much details if i can use it with
>> ubuntu.
>>
>> Thanks for your insights!
>> V.
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>> --
>> 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/CAPiONwmd9h%2Bcwb1SYseYeiijag4Aa5weeMtg_eqiDgh7txVOKg%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CALXYUb%3DxLaVMPLQBcvyObuR19KHQ9rkQ%3DuvWUMqafO-q_EJ%3D_w%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAPiONwmrk-c3E2v6v5z7j76rxRcXp3h4CNSKAbp-LyhYVZmDnA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django with Ubuntu Cloud

2014-01-30 Thread Vibhu Rishi
Hi,

Has anyone setup Django with Ubuntu Cloud ?

My primary interest is how to setup the media server. I am primarily using
Heroku for the hosting of the project, but that does not provide hosting
for the static / user uploaded files. So, I am looking at what alternatives
I have. There are a lot of suggestions to use AWS. I also came across
ubuntu cloud - but havent gotten much details if i can use it with ubuntu.

Thanks for your insights!
V.

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwmd9h%2Bcwb1SYseYeiijag4Aa5weeMtg_eqiDgh7txVOKg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Deploying to Heroku for first time, Dynos is blank, not recognizing Procfile

2014-01-09 Thread Vibhu Rishi
Everything on Heroku is git based. So, you will have to do a git push
heroku master for any updates.

V.


On Thu, Jan 9, 2014 at 7:18 AM, Scott Meyers <scottmeyer...@gmail.com>wrote:

> Thanks for the effort.  Yes I do have a requirements.txt file, and yes, my
> Procfile has no extensions.  Heroku just isn't picking it up.  If I delete
> my procfile and build another one, how do I re-send it to Heroku?  Do I do
> another commit, or push master?
>
>
> On Tuesday, January 7, 2014 2:40:07 AM UTC-8, James Turley wrote:
>
>> Do you have a requirements.txt file (with all your requirements therein)?
>> Heroku recognises python apps by its presence (although I'm told this is
>> not yet 100% reliable - never tried myself).
>>
>>
>> On Tue, Jan 7, 2014 at 9:55 AM, Vibhu Rishi <vibhu...@gmail.com> wrote:
>>
>>> yes. just create a text file with no extension. Here's mine for
>>> reference :
>>>
>>> $ cat Procfile
>>> web: gunicorn qj.wsgi
>>>
>>>
>>> V.
>>>
>>>
>>> On Tue, Jan 7, 2014 at 9:31 AM, Scott Meyers <scottm...@gmail.com>wrote:
>>>
>>>>  Programming newb, Trying to use Heroku for the first time for a
>>>> Django app. After I push it to Heroku, the Dynos field is blank. I expected
>>>> to see my procfile: web: python manage.py runserver 0.0.0.0:$PORT
>>>> --noreload
>>>>
>>>> Of course, when I try to open the application on Heroku, I get: An
>>>> error occurred in the application and your page could not be served. Please
>>>> try again in a few moments.
>>>>
>>>> If you are the application owner, check your logs for details
>>>>
>>>> Could this be because I don't have an extension on my procfile?
>>>>
>>>> My Procfile should just be a file I created in my text editor, right?
>>>>
>>>> Here is the log:
>>>>
>>>> 2014-01-06T07:34:17.321925+00:00 heroku[router]: at=error code=H14
>>>> desc="No web processes running" method=GET path=/ host=
>>>> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
>>>> service= status=503 bytes=
>>>>
>>>> 2014-01-06T07:34:17.778360+00:00 heroku[router]: at=error code=H14
>>>> desc="No web processes running" method=GET path=/favicon.ico host=
>>>> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
>>>> service= status=503 bytes=
>>>>
>>>> 2014-01-06T07:35:01.608749+00:00 heroku[router]: at=error code=H14
>>>> desc="No web processes running" method=GET path=/ host=
>>>> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
>>>> service= status=503 bytes=
>>>>
>>>> 2014-01-06T07:35:01.868486+00:00 heroku[router]: at=error code=H14
>>>> desc="No web processes running" method=GET path=/favicon.ico host=
>>>> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
>>>> service= status=503 bytes=
>>>>
>>>> 2014-01-06T07:46:57.862560+00:00 heroku[router]: at=error code=H14
>>>> desc="No web processes running" method=GET path=/ host=
>>>> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
>>>> service= status=503 bytes=
>>>>
>>>> 2014-01-06T07:46:58.114270+00:00 heroku[router]: at=error code=H14
>>>> desc="No web processes running" method=GET path=/favicon.ico host=
>>>> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
>>>> service= status=503 bytes=
>>>>
>>>> --
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@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/293796b7-2700-4c95-ac02-25c512ea41b0%
>>>> 40googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> --
>>> Simplicity is the ultimate sophistication. - Leonar

Re: Deploying to Heroku for first time, Dynos is blank, not recognizing Procfile

2014-01-07 Thread Vibhu Rishi
yes. just create a text file with no extension. Here's mine for reference :

$ cat Procfile
web: gunicorn qj.wsgi


V.


On Tue, Jan 7, 2014 at 9:31 AM, Scott Meyers wrote:

> Programming newb, Trying to use Heroku for the first time for a Django
> app. After I push it to Heroku, the Dynos field is blank. I expected to see
> my procfile: web: python manage.py runserver 0.0.0.0:$PORT --noreload
>
> Of course, when I try to open the application on Heroku, I get: An error
> occurred in the application and your page could not be served. Please try
> again in a few moments.
>
> If you are the application owner, check your logs for details
>
> Could this be because I don't have an extension on my procfile?
>
> My Procfile should just be a file I created in my text editor, right?
>
> Here is the log:
>
> 2014-01-06T07:34:17.321925+00:00 heroku[router]: at=error code=H14
> desc="No web processes running" method=GET path=/ host=
> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
> service= status=503 bytes=
>
> 2014-01-06T07:34:17.778360+00:00 heroku[router]: at=error code=H14
> desc="No web processes running" method=GET path=/favicon.ico host=
> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
> service= status=503 bytes=
>
> 2014-01-06T07:35:01.608749+00:00 heroku[router]: at=error code=H14
> desc="No web processes running" method=GET path=/ host=
> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
> service= status=503 bytes=
>
> 2014-01-06T07:35:01.868486+00:00 heroku[router]: at=error code=H14
> desc="No web processes running" method=GET path=/favicon.ico host=
> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
> service= status=503 bytes=
>
> 2014-01-06T07:46:57.862560+00:00 heroku[router]: at=error code=H14
> desc="No web processes running" method=GET path=/ host=
> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
> service= status=503 bytes=
>
> 2014-01-06T07:46:58.114270+00:00 heroku[router]: at=error code=H14
> desc="No web processes running" method=GET path=/favicon.ico host=
> aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect=
> service= status=503 bytes=
>
> --
> 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/293796b7-2700-4c95-ac02-25c512ea41b0%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkA87ecejWXLMrvjUgmTE8z3pbZ%2B1N1t%3DyPJ85xYyb2DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Embedding images like on Quora

2014-01-06 Thread Vibhu Rishi
Hi Arun

Thanks man. This is also interesting.

However, I dont really want to download the web and autolink the image ( as
how it is in facebook - though I think now that I know i would want to try
it out also). What I want to achieve is that if there is an image which a
person has hosted on google+/flickr/etc , just pasting that url in his post
will show the thumbnail of that image. So, lets say he has an album on
google+, and he is referencing 2 or 3 images he can then just paste their
links, and they show up as images.

V.


On Mon, Jan 6, 2014 at 3:16 PM, trojactory <aru...@gmail.com> wrote:

> Hi Vibhu,
>
> This works automatically for certain sites if they implement a standard
> called oEmbed (http://oembed.com/). Several sites like Flickr, Youtube
> etc support providing a thumbnail for a url within their domain. Django has
> several packages which support oEmbed, of which, I have used micawber (
> https://pypi.python.org/pypi/micawber) very successfully in the past.
>
> For a general solution, you will need to download the page in the
> background and parse it for a representative image.
>
> Hope this addresses your question.
>
> Regards,
> Arun
>
> On Monday, January 6, 2014 2:48:30 PM UTC+5:30, Vibhu Rishi wrote:
>>
>> Hi,
>>
>> Is there a way to have images show up by just pasting a url ?
>>
>> e.g. on Quora, if i paste a url to an image - http://www.brothersthegame.
>> com/core/media/images/brothers_europe05_big.jpg
>>
>> it shows up as an image not as a URL. How can I achieve the same using
>> django ?
>>
>> Regards,
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>  --
> 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/4bf2d938-75a2-4fa9-9796-9a52a150a073%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwnq10r7x1Ly6waB1%3D28cKcdDCEf%3D78d3fv_YHffSzu3hg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Embedding images like on Quora

2014-01-06 Thread Vibhu Rishi
some more details of what I am looking for :

Its a forum kind of thing. So, the model has a TextField where user can
type whatever text he wants which can include urls and images.

for urls, i can use a template filter like urlize
I want something similar for images ( imgize ? )

V.


On Mon, Jan 6, 2014 at 2:48 PM, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:

> Hi,
>
> Is there a way to have images show up by just pasting a url ?
>
> e.g. on Quora, if i paste a url to an image -
> http://www.brothersthegame.com/core/media/images/brothers_europe05_big.jpg
>
> it shows up as an image not as a URL. How can I achieve the same using
> django ?
>
> Regards,
> Vibhu
>
> --
> Simplicity is the ultimate sophistication. - Leonardo da Vinci
> Life is really simple, but we insist on making it complicated. - Confucius
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkWeMO5QySssfuQ%3D%3DmzPXQ1R2j9guK-oM1L5QCrqpGfzw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to deploy a django project in the web?

2013-12-24 Thread Vibhu Rishi
Try Heroku https://devcenter.heroku.com/articles/getting-started-with-django

Caveat - just found it the hard way - heroku does not support user uploaded
files. So, if your project has that you will need to figure out where to
host the files. One suggestion given on the heroku site is AWS S3
https://devcenter.heroku.com/articles/s3

V.


On Mon, Dec 23, 2013 at 11:22 PM, C. Kirby  wrote:

> You can read up about deploying django in the deployment section of the
> docs:
>
> https://docs.djangoproject.com/en/1.6/howto/deployment/
>
>
> On Friday, December 20, 2013 11:36:58 PM UTC-6, Pablo Diaz wrote:
>>
>> I've finished my django project but I'm only running it locally. I want
>> to put it on a website
>>
>  --
> 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/68b82be9-d730-4480-a996-8a8d31c368b0%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwn24xNg9hTQ6BeVBuWSa2XpjpC4-dVdEyFePsxem148%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django-facebook

2013-12-17 Thread Vibhu Rishi
I installed Pillow a few days back - it went fine.

$pip install Pillow

You need to make sure that you have libraries for png/jpg available. I am
not sure if that has to be a pip or a sudo apt-get ( i went the apt-get way
)

V.



On Tue, Dec 17, 2013 at 6:35 PM, Duncan Bates wrote:

> Testing django for my next web app, but encountering image library
> problems when I've added the django-facebook to my project;
> ImproperlyConfigured: Neither Pillow nor PIL could be imported: No module
> named Image
>
> Using python v2.7 win64 / Django 1.6, and Microsoft Python Tools for
> Visual Studio v2.0.11016.00
>
> Tried to install PIL and Pillow through pip, both fails.
>
> Ideas?
>
> --
> 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/be25e45b-d428-4e37-85f1-3129d6d0551a%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwncnujsWOVfXjgiGVaL3L1LJqMiZw0XOuKWaUKL4JAq_A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Adding Objects to Query Set

2013-12-17 Thread Vibhu Rishi
I will try this out also. Thanks!


On Tue, Dec 17, 2013 at 1:57 PM, Arnold Krille <arn...@arnoldarts.de> wrote:

> Hi,
>
> define related names in ProjectMember:
>
> class ProjectMember(models.Model):
> project = models.ForeignKey(Project, related_name='members')
> member = models.ForeignKey(User)
> added_on = models.DateTimeField()
>
> The full query to get all Projects the User is either member or leader:
>
> Projects.objects.filter(
> Q(owner=user) | Q(members__member=user)
> )
>
> Don't merge in python what you can merge in the database. One
> query in the database is (almost) always faster then two queries and
> merging in python.
>
> Have fun,
>
> Arnold
>
> Am Mon, 16 Dec 2013 09:56:27 -0800 (PST)
> schrieb antialiasis <antialia...@gmail.com>:
> > Rather than fetching
> > ProjectMember.objects.filter(member=request.user), you want to fetch
> > Project.objects.filter(projectmember_set__member=request.user). That
> > will get you Project objects rather than ProjectMember objects.
> >
> > On Monday, December 16, 2013 1:47:13 PM UTC, Vibhu Rishi wrote:
> > >
> > > Hi
> > >
> > > I am not able to figure this out. I want to add objects to a query
> > > set.
> > >
> > > I have 2 models :
> > > 1. Projects which is basically a list of projects. I have a field
> > > which defines the owner of the project. e.g. :
> > >
> > > class Project(models.Model):
> > > ...
> > > owner = models.ForeignKey(User)
> > >
> > > 2. ProjectMember - This is a table where I add any user ( other
> > > than owner ) if they are member of the project.
> > >
> > > class ProjectMember(models.Model):
> > > project = models.ForeignKey(Project)
> > > member = models.ForeignKey(User)
> > > added_on = models.DateTimeField()
> > >
> > > What I am trying to do is get a list of projects which the current
> > > user is either owner or member of. So, I have this in my view :
> > >
> > > def mylist(request):
> > > projects = Project.objects.filter(owner=request.user)
> > > member_of = ProjectMember.objects.filter(member = request.user)
> > > # Now find all projects the user is a member of and add to the
> > > projects list
> > > all_projects = projects
> > > for m in member_of:
> > > all_projects |= m.project
> > > return render (request, "project/projects_mine.html",
> > > {'projects':projects})
> > >
> > >
> > > I am doing something wrong here as the line all_projects |=
> > > m.project is not working. I tried with a += also.
> > >
> > > How can I achieve what I am trying to do ?
> > >
> > > Vibhu
> > >
> > > --
> > > Simplicity is the ultimate sophistication. - Leonardo da Vinci
> > > Life is really simple, but we insist on making it complicated. -
> > > Confucius
> > >
> >
>
>


-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkrt35x43uEcdZkrsdm3N1FiA%3DEFww9rkGEB2G-P5RqoA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Adding Objects to Query Set

2013-12-17 Thread Vibhu Rishi
This seems to be working with a slite modification. the _set was giving an
error. So, I changed to :

Project.objects.filter(projectmember__member=request.user)

I am not sure if that will just return 1 result or all the results. I have
to check that out.

Vibhu


On Mon, Dec 16, 2013 at 11:26 PM, antialiasis <antialia...@gmail.com> wrote:

> Rather than fetching ProjectMember.objects.filter(member=request.user),
> you want to fetch
> Project.objects.filter(projectmember_set__member=request.user). That will
> get you Project objects rather than ProjectMember objects.
>
>
> On Monday, December 16, 2013 1:47:13 PM UTC, Vibhu Rishi wrote:
>>
>> Hi
>>
>> I am not able to figure this out. I want to add objects to a query set.
>>
>> I have 2 models :
>> 1. Projects which is basically a list of projects. I have a field which
>> defines the owner of the project. e.g. :
>>
>> class Project(models.Model):
>> ...
>> owner = models.ForeignKey(User)
>>
>> 2. ProjectMember - This is a table where I add any user ( other than
>> owner ) if they are member of the project.
>>
>> class ProjectMember(models.Model):
>> project = models.ForeignKey(Project)
>> member = models.ForeignKey(User)
>> added_on = models.DateTimeField()
>>
>> What I am trying to do is get a list of projects which the current user
>> is either owner or member of. So, I have this in my view :
>>
>> def mylist(request):
>> projects = Project.objects.filter(owner=request.user)
>> member_of = ProjectMember.objects.filter(member = request.user)
>> # Now find all projects the user is a member of and add to the
>> projects list
>> all_projects = projects
>> for m in member_of:
>> all_projects |= m.project
>> return render (request, "project/projects_mine.html",
>> {'projects':projects})
>>
>>
>> I am doing something wrong here as the line all_projects |= m.project is
>> not working. I tried with a += also.
>>
>> How can I achieve what I am trying to do ?
>>
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>  --
> 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/094848da-0d22-47a2-b97a-0abed22cc5e2%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkKd13THYjHH%2BTcQ27zgP2zOnyW%2BsYVAOQvC20WNXnhWg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Adding Objects to Query Set

2013-12-16 Thread Vibhu Rishi
Hi Andrew,

The set seem to add on properly. How do i now access the project detail ?
When I try to iterate over it since this set is made of 2 different object
types, it fails for one of them.

e.g. i have in the project model attribute as 'name' for the project. so
when i iterate over the list like :

for o in totoal_projects:
  print o.name

this fails when it hits the ProjectMember objects as for them the name is
actually o.project.name

V.


On Mon, Dec 16, 2013 at 8:21 PM, Andrew Farrell <armorsmit...@gmail.com>wrote:

> It sounds like you just want a set of projects and don't actually need a
> querySet.
> You can do this with
> projects = set( Project.objects.filter(owner=request.user).all() )
> member_projects = set( ProjectMember.objects.filter(member = request.user)
> )
> total_projects = set(projects) | set(member_projects)
>
> You could also do
> projects = Project.objects.filter(owner=request.user).all()
> member_projects = ProjectMember.objects.filter(member =
> request.user).exclude(project__owner=request.user).all()
> total_projects = projects + member_projects
>
>
> On Mon, Dec 16, 2013 at 8:47 AM, Vibhu Rishi <vibhu.ri...@gmail.com>wrote:
>
>> Hi
>>
>> I am not able to figure this out. I want to add objects to a query set.
>>
>> I have 2 models :
>> 1. Projects which is basically a list of projects. I have a field which
>> defines the owner of the project. e.g. :
>>
>> class Project(models.Model):
>> ...
>> owner = models.ForeignKey(User)
>>
>> 2. ProjectMember - This is a table where I add any user ( other than
>> owner ) if they are member of the project.
>>
>> class ProjectMember(models.Model):
>> project = models.ForeignKey(Project)
>> member = models.ForeignKey(User)
>> added_on = models.DateTimeField()
>>
>> What I am trying to do is get a list of projects which the current user
>> is either owner or member of. So, I have this in my view :
>>
>> def mylist(request):
>> projects = Project.objects.filter(owner=request.user)
>> member_of = ProjectMember.objects.filter(member = request.user)
>> # Now find all projects the user is a member of and add to the
>> projects list
>> all_projects = projects
>> for m in member_of:
>> all_projects |= m.project
>> return render (request, "project/projects_mine.html",
>> {'projects':projects})
>>
>>
>> I am doing something wrong here as the line all_projects |= m.project is
>> not working. I tried with a += also.
>>
>> How can I achieve what I am trying to do ?
>>
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>> --
>> 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/CAPiONwm9%2Bnp_BROqjVEfmDaE_KgAnYnhv8u-GuiFBG7q2QeuaA%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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%2By5TLaNBRwaYuRmJq1hzF2Lfb67dnOduu3%3D46_7TDX0TtRx%2Bw%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkpAYipfg1n8MtwqLSjRuYKVG_cYmNArsC87o_3sUV_wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Adding Objects to Query Set

2013-12-16 Thread Vibhu Rishi
Hi Sebastian,

Not really. I want the list of project objects which is coming ok by
filtering on the user object. I checked it from commandline, and I am
getting it correctly.

The problem is the 2nd table. I want to get the projects from the 1st table
when the user is a member as specified in the 2nd table.

e.g. following is the full list of projects. + denotes that I am owner. *
denotes where I am a member.

Project1
Project2 ( + )
Project 3
Project4 ( * )

When I do a projects = Project.objects.filter(owner=request.user) I get a
query set like :
[]

Now, when I do member_projects= Member.objects.filter(member=request.user)
I get a query set like:
[]

So far so good. I dont have any issues from them. However, in my templates,
now I need to pass on 2 querysets because these objects are different. I
have 2 loops for listing the projects. one for projects where I print the
name as  {{ o.name }} and one for the ProjectMember where I print the name
as o.project.name . I want to make the code neater and have just one loop :)

Now from the 2nd queryset ( since the object type is different), I want to
take out the actual project objects and add to the 1st set. Thats where I
am hitting a roadblock.

for o in member_projects
   o.project

works fine, as I get the project object.

However, now I want to add this project into the 1st queryset  - and there
i am not able to.

Hope this clears what I am trying to achieve!

V.

On Mon, Dec 16, 2013 at 8:21 PM, Sebastian Morkisch
wrote:

> Hi
>
> I am working on the same thing. Same here, one project model, one extended
> User model. Well, when I printed the request, I got the Usename, which is
> not an id, but you'd like to compare ids. Is that correct?
>
> So perhaps you're closer to a solution, if you have a method like this:
>
> def get_queryset(self):
>return Project.objects.filter(owner=self.request.user.id) <-- see that
> id?
>
> Best regards,
> Sebastian
>
>>  --
> 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/9dec582e-41c0-47b1-a9ed-65850eac8585%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwka6BorE6ec8vRXgAy6X85HiCctZy55rR5MaetuzafSEw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Adding Objects to Query Set

2013-12-16 Thread Vibhu Rishi
Hi

I am not able to figure this out. I want to add objects to a query set.

I have 2 models :
1. Projects which is basically a list of projects. I have a field which
defines the owner of the project. e.g. :

class Project(models.Model):
...
owner = models.ForeignKey(User)

2. ProjectMember - This is a table where I add any user ( other than owner
) if they are member of the project.

class ProjectMember(models.Model):
project = models.ForeignKey(Project)
member = models.ForeignKey(User)
added_on = models.DateTimeField()

What I am trying to do is get a list of projects which the current user is
either owner or member of. So, I have this in my view :

def mylist(request):
projects = Project.objects.filter(owner=request.user)
member_of = ProjectMember.objects.filter(member = request.user)
# Now find all projects the user is a member of and add to the projects
list
all_projects = projects
for m in member_of:
all_projects |= m.project
return render (request, "project/projects_mine.html",
{'projects':projects})


I am doing something wrong here as the line all_projects |= m.project is
not working. I tried with a += also.

How can I achieve what I am trying to do ?

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwm9%2Bnp_BROqjVEfmDaE_KgAnYnhv8u-GuiFBG7q2QeuaA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Displaying images in comments/text fields

2013-12-13 Thread Vibhu Rishi
I want to show images in comments or text fields.

I looked at markdown - and while it is quite cool for text formatting, it
is quite archaic for image display. Also it does not do any resizing so
some large images go out of bounds.

So, can you guys guide me to some good template filter utility which will
do the above 2 things ?

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwmQ6KnLsmm%2BcZhAUA6wQm3LRh39HG%3DwzzPK625TkoD0ew%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: python virtual environment

2013-12-05 Thread Vibhu Rishi
so, for an existing project, how do i update the manage.py file ? create a
new project in 1.6 and copy it over ?

V.


On Thu, Dec 5, 2013 at 9:58 PM, Timothy W. Cook <t...@mlhim.org> wrote:

>
>
>
> On Thu, Dec 5, 2013 at 2:09 PM, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:
>
>> I am getting the same error when I did an upgrade of Django to 1.6 .
>> Reverted back to 1.5 and it seems to work, but i am still searching for a
>> solution for this to work with 1.6
>>
>> V.
>>
>> execute_manager was deprecated:
>
> https://docs.djangoproject.com/en/1.4/releases/1.4/#django-core-management-execute-manager
>
> and probably removed in 1.6
>
> HTH,
>
> --Tim
>
>
>>
>> On Fri, Nov 29, 2013 at 11:14 PM, tino <tin...@gmail.com> wrote:
>>
>>>
>>>
>>> Hello
>>>
>>> I am trying to run a project that was setup in another server, but
>>> getting the following error. I am using python 2.7, django, virtualenv. So
>>> I am running the project inside a python virtual environment
>>>
>>>
>>> (virtualenv)[web.srv1 daily# python manage.py runserver 0.0.0.0:8000
>>> Traceback (most recent call last):
>>>   File "manage.py", line 2, in 
>>> from django.core.management import execute_manager
>>> ImportError: cannot import name execute_manager
>>>
>>>
>>> I used the method mentioned in the below link to setup the virtual
>>> environment.
>>>
>>> http://toic.org/blog/2011/wsgi-on-cpanel-improved/
>>>
>>> This project was setup inside a cpanel server. But the current server I
>>> using is not a cpanel server. It is normal centos server.
>>>
>>> Can somebody help me to track down the issue.
>>>
>>>
>>>  --
>>> 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/7181ba64-d2d6-4926-b35d-5b4a2a7792a4%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>> --
>> 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/CAPiONw%3DAKX8tXx0G4bqoOUf5RUDJXF8k3KkM6XFNfCe8r6vfPQ%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>
> --
> 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%2B%3DOU3XigT_au7ww4HBzKxf2CQzWy19O-XaPg0w_8KdvDSQTQw%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwmehf3%3DSjh88CFc9TQ7KMxBgufKGqFbTKsaB9g4SWQ5-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: python virtual environment

2013-12-05 Thread Vibhu Rishi
I am getting the same error when I did an upgrade of Django to 1.6 .
Reverted back to 1.5 and it seems to work, but i am still searching for a
solution for this to work with 1.6

V.


On Fri, Nov 29, 2013 at 11:14 PM, tino  wrote:

>
>
> Hello
>
> I am trying to run a project that was setup in another server, but getting
> the following error. I am using python 2.7, django, virtualenv. So I am
> running the project inside a python virtual environment
>
>
> (virtualenv)[web.srv1 daily# python manage.py runserver 0.0.0.0:8000
> Traceback (most recent call last):
>   File "manage.py", line 2, in 
> from django.core.management import execute_manager
> ImportError: cannot import name execute_manager
>
>
> I used the method mentioned in the below link to setup the virtual
> environment.
>
> http://toic.org/blog/2011/wsgi-on-cpanel-improved/
>
> This project was setup inside a cpanel server. But the current server I
> using is not a cpanel server. It is normal centos server.
>
> Can somebody help me to track down the issue.
>
>
>  --
> 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/7181ba64-d2d6-4926-b35d-5b4a2a7792a4%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONw%3DAKX8tXx0G4bqoOUf5RUDJXF8k3KkM6XFNfCe8r6vfPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Email Templates and the full website URL

2013-12-02 Thread Vibhu Rishi
Not sure how the header injection will work in this case ?

As I see it, I am using this in the email text for the email body. This is
generated and sent in a view function I have. So, how will the http header
get inserted in this flow ?

Vibhu



On Fri, Nov 29, 2013 at 7:39 PM, Joseph Mutumi <jjmut...@gmail.com> wrote:

> That could work but isn't it a bit insecure? I think it will be
> susceptible to a header injection(
> http://en.wikipedia.org/wiki/HTTP_header_injection). I would rather
> create a setting with the domain name in settings.py and then call it from
> the template or write a custom template tag.
>
>
> On Fri, Nov 29, 2013 at 2:55 PM, Rafael E. Ferrero <
> rafael.ferr...@gmail.com> wrote:
>
>> Good work!!
>>
>>
>>
>> 2013/11/29 Vibhu Rishi <vibhu.ri...@gmail.com>
>>
>>> Thanks for the links. I had done the google searches and gone through
>>> them, but they seemed to me a lot of work to get something simple.
>>>
>>> I finally did the following. Any comments welcome if this is not a good
>>> way to do.
>>>
>>> In my view, I pass a context object of the request to the email
>>> template. I need the request as i also want to put in the user's name.
>>>
>>> in the email template now I changed it to :
>>> http://{{request.get_get_host}}{% url "project.views.details"
>>> project.id %}">{{ project }}
>>>
>>> This seems to be working and quite simple too !
>>>
>>> Regards,
>>> Vibhu
>>>
>>>
>>>
>>>
>>> On Fri, Nov 29, 2013 at 4:26 PM, Rafael E. Ferrero <
>>> rafael.ferr...@gmail.com> wrote:
>>>
>>>>
>>>> https://docs.djangoproject.com/en/dev/ref/contrib/sites/#getting-the-current-domain-for-full-urls
>>>>
>>>>
>>>> 2013/11/29 Vibhu Rishi <vibhu.ri...@gmail.com>
>>>>
>>>>>  hi,
>>>>>
>>>>> I have a setup where I have a project details page, and I can do a
>>>>> "send email" which should send the email with the URL.
>>>>>
>>>>> Email is working fine.
>>>>>
>>>>> The problem is that i am getting a relative url in the tempalte
>>>>>
>>>>> I have the following in the html email template :
>>>>> {{ project
>>>>> }}
>>>>>
>>>>> This give me a URL in the email as /projects/1 ( 1 being the project
>>>>> id)
>>>>>
>>>>> How do i prepend the url of the server here ? e.g. I want this to be
>>>>> http://localhost:8000/projects/1
>>>>>
>>>>> Vibhu
>>>>>
>>>>> --
>>>>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>>>>> Life is really simple, but we insist on making it complicated. -
>>>>> Confucius
>>>>>
>>>>> --
>>>>> 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/CAPiONwn6cHwi51fJ63oFUOLof2QmFqsSeqz2VeOM_Jxk%2BaUYGQ%40mail.gmail.com
>>>>> .
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Rafael E. Ferrero
>>>>
>>>> --
>>>> 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/CAJJc_8WWUyfwYd1cjxNzvm0xe5LjUTNDjPGDnYaaxE9w3B1C-g%40mail.gmail.com
>>>> .
>>>>
>>>> For more options, visit https://gr

Re: Email Templates and the full website URL

2013-11-29 Thread Vibhu Rishi
Thanks for the links. I had done the google searches and gone through them,
but they seemed to me a lot of work to get something simple.

I finally did the following. Any comments welcome if this is not a good way
to do.

In my view, I pass a context object of the request to the email template. I
need the request as i also want to put in the user's name.

in the email template now I changed it to :
http://{{request.get_get_host}}{% url "project.views.details"
project.id %}">{{ project }}

This seems to be working and quite simple too !

Regards,
Vibhu




On Fri, Nov 29, 2013 at 4:26 PM, Rafael E. Ferrero <rafael.ferr...@gmail.com
> wrote:

>
> https://docs.djangoproject.com/en/dev/ref/contrib/sites/#getting-the-current-domain-for-full-urls
>
>
> 2013/11/29 Vibhu Rishi <vibhu.ri...@gmail.com>
>
>>  hi,
>>
>> I have a setup where I have a project details page, and I can do a "send
>> email" which should send the email with the URL.
>>
>> Email is working fine.
>>
>> The problem is that i am getting a relative url in the tempalte
>>
>> I have the following in the html email template :
>> {{ project }}
>>
>> This give me a URL in the email as /projects/1 ( 1 being the project id)
>>
>> How do i prepend the url of the server here ? e.g. I want this to be
>> http://localhost:8000/projects/1
>>
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>> --
>> 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/CAPiONwn6cHwi51fJ63oFUOLof2QmFqsSeqz2VeOM_Jxk%2BaUYGQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Rafael E. Ferrero
>
> --
> 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/CAJJc_8WWUyfwYd1cjxNzvm0xe5LjUTNDjPGDnYaaxE9w3B1C-g%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONw%3D7Uh9uReNyCCzhGb%3D09WHCzY9rSPp9mYn_eJRsHwmNpw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Email Templates and the full website URL

2013-11-29 Thread Vibhu Rishi
hi,

I have a setup where I have a project details page, and I can do a "send
email" which should send the email with the URL.

Email is working fine.

The problem is that i am getting a relative url in the tempalte

I have the following in the html email template :
{{ project }}

This give me a URL in the email as /projects/1 ( 1 being the project id)

How do i prepend the url of the server here ? e.g. I want this to be
http://localhost:8000/projects/1

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwn6cHwi51fJ63oFUOLof2QmFqsSeqz2VeOM_Jxk%2BaUYGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How do I display the human readable name of a choice?

2013-11-28 Thread Vibhu Rishi
you just need to enclose it in a get__display and it will
display it in the template file.

in your example below, you will need to show it as follows in your
templates html file:
object.get_state_display

where object is whatever the object name you have passed via the view.

Hope this helps.

V.


On Tue, Nov 26, 2013 at 1:36 PM, Aniket Zamwar wrote:

> This function gets for a specific information stored in the instance of
> the model.
> If I want to display as a drop down in the template all the human readable
> names in the choices can I do that ?
>
> Also, Before storing it to DB, how to convert it back to human redable to
> short version mentioned in CHOICES used to store in DB ?
>
> On Wednesday, February 11, 2009 9:13:01 AM UTC-8, Kevin Audleman wrote:
>>
>> I could've swore I tried that before posting my question and it didn't
>> work, but I tried it this time and it did. Anyhow, a long winded way
>> of apologizing for asking a simple question. Thank you for taking the
>> time to answer!
>>
>> Kevin
>>
>> On Feb 10, 3:41 pm, Alex Gaynor  wrote:
>> > On Tue, Feb 10, 2009 at 6:39 PM, Kevin Audleman <
>> kevin.audle...@gmail.com>wrote:
>> >
>> >
>> >
>> >
>> >
>> > > Thanks Alex, however this is a solution at the View level, and I'm
>> > > using a view that I didn't write. Is there also a way to do this at
>> > > the template level?
>> >
>> > > Thanks again,
>> > > Kevin
>> >
>> > > On Feb 10, 1:24 pm, Alex Gaynor  wrote:
>> > > > On Tue, Feb 10, 2009 at 4:23 PM, Kevin Audleman <
>> > > kevin.audle...@gmail.com>wrote:
>> >
>> > > > > Hi everyone,
>> >
>> > > > > I've set up a model that has a state field with the input set to
>> a
>> > > > > list of states,
>> >
>> > > > > state = models.CharField(max_length=100, blank=True,
>> > > > > choices=US_STATE_LIST)
>> >
>> > > > > The drop-down on the edit form works great, displaying 'Alabama'
>>  and
>> > > > > storing AL in the database. However when I view it, I see AL. How
>> do I
>> > > > > get django to display the human readable name?
>> >
>> > > > > I would prefer to do this on the template level, as I'm using a
>> view
>> > > > > from a contributed app that I can't modify.
>> >
>> > > > > Thanks,
>> > > > > Kevin
>> >
>> > > >http://docs.djangoproject.com/en/dev/ref/models/
>> instances/?from=olddo...
>>
>> >
>> > > > Alex
>> >
>> > > > --
>> > > > "I disapprove of what you say, but I will defend to the death your
>> right
>> > > to
>> > > > say it." --Voltaire
>> > > > "The people's good is the highest law."--Cicero
>> >
>> > Yes, the same thing works {{ model.get_FIELD_display }}.
>> >
>> > Alex
>> >
>> > --
>> > "I disapprove of what you say, but I will defend to the death your
>> right to
>> > say it." --Voltaire
>> > "The people's good is the highest law."--Cicero
>
>  --
> 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/13ff53a8-b905-401c-80ae-87da07f79c90%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONw%3DERGQBK_vgSaSBYttKLEB_kcrWfA0M%3DA9AXMEOx0y7ig%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to fix URL link redirecting from login?

2013-11-24 Thread Vibhu Rishi
Its the @login_required decorator.
https://docs.djangoproject.com/en/1.2/topics/auth/#the-login-required-decorator

V.


On Sun, Nov 24, 2013 at 3:46 PM, Timothy W. Cook  wrote:

> Check in the docs for the instructions on decorating your views to
> restrict to authenticated users.  This also talks about redirecting to
> a page instructing them to login.  Sorry, I don't have the link
> available right now.
>
>
> On Sat, Nov 23, 2013 at 10:40 PM, nobody  wrote:
> > Hi,
> >
> > I made an URL link in an email, if I have logged into the web site, then
> I
> > can click the link, it would bring to a valid web page. But if I haven't
> > logged log in, to click the link would result an error "page not found".
> How
> > can I fix it to check if a user has not logged in, it opens a log page to
> > ask the user to log in rather than an error page, after the user loges
> in,
> > it would redirect to the link URL page?
> >
> > Thank you.
> >
> > Kind regards.
> >
> >
> >
> >
> >
> > --
> > 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/ff130970-c4d4-4a96-8748-d386217b9cf5%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>
> --
> 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%2B%3DOU3WJCAEwgGzvgnH1bH%3DpxtQ%3DWEGO%3DZcJHaWKXz%2BT2863Tw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwno25Gf0KyKoFZWVD%2ByHF8m7%2Biw8KQLOTx8TPDUUrxxbA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.6 error at creating project

2013-11-14 Thread Vibhu Rishi
I work exactly as you have mentioned .. In a xubuntu VM :)

V.
On Nov 13, 2013 11:17 AM, "Ferdy Rodríguez" <ferdyrodrig...@gmail.com>
wrote:

> Hi,
>
> Yes, I always work with virtual environments, and I've checked that I did
> download django 1.6. However, I looks like is a problem with my Windows
> OS I fired up a Virtual Machine with Ubuntu and everything is working
> fine.
>
> So I'm testing my code in the Virtual box.
>
> Thanks for your time!
>
> Ferdy
>
> On Sunday, November 10, 2013 5:22:01 AM UTC-6, Vibhu Rishi wrote:
>>
>> Do you have both versions of django installed ? That could cause the
>> issue.
>>
>> I suggest that you make a virtual environment (
>> https://pypi.python.org/pypi/virtualenv ) and do a pip install of
>> django. This will let you work on different versions of django on the same
>> machine.
>>
>> Vibhu
>>
>>
>> On Sun, Nov 10, 2013 at 2:32 AM, Ferdy Rodríguez <ferdyro...@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> I've been wanting to to test django 1.6, I'm installing this new release
>>> on a virtualenv. However, whenever a to *django-admin.py startproject
>>> mysite* I get the settings.py and urls.py from previous version (1.5).
>>> It even weirder that at creating an app *django-admin.py startapp app* I
>>> get the correct files.
>>>
>>> I've checked that I'm using django 1.6, as it is what I get by doing
>>> django.get_version() in the python shell.
>>>
>>> Does anybody knows what could be happening?
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/cea3e499-7641-4275-b869-ba9cf3a7a804%
>>> 40googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>  --
> 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/332db6f6-6c5e-45bb-ab1c-70731ee27497%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAPiONwnenoOhkaU7DijrEQwv7kuHErp%3Dd--37RBOxLv2pTRPeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.6 error at creating project

2013-11-10 Thread Vibhu Rishi
Do you have both versions of django installed ? That could cause the issue.

I suggest that you make a virtual environment (
https://pypi.python.org/pypi/virtualenv ) and do a pip install of django.
This will let you work on different versions of django on the same machine.

Vibhu


On Sun, Nov 10, 2013 at 2:32 AM, Ferdy Rodríguez
wrote:

> Hi,
>
> I've been wanting to to test django 1.6, I'm installing this new release
> on a virtualenv. However, whenever a to *django-admin.py startproject
> mysite* I get the settings.py and urls.py from previous version (1.5). It
> even weirder that at creating an app *django-admin.py startapp app* I get
> the correct files.
>
> I've checked that I'm using django 1.6, as it is what I get by doing
> django.get_version() in the python shell.
>
> Does anybody knows what could be happening?
>
> --
> 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/cea3e499-7641-4275-b869-ba9cf3a7a804%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwnA1J4dFpbA4Mq5xtEfmuu70h9jeUFJY11p_988Zhk_ZA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Google Maps with Routes

2013-11-10 Thread Vibhu Rishi
Hi Nick,

I am not sure if openstreet will solve my purpose. What I have in mind is
that when someone is planning a trip , he can enter the route details in
the trip info. This should give the approximate distance etc. ( btw bike =
motorcycle here in India). Also apart from google maps I have not really
come across any mapping service which has a good coverage of roads and
cities in India.

vibhu


On Sun, Nov 10, 2013 at 11:51 AM, Nick Apostolakis <nicka...@oncrete.gr>wrote:

> Hello there,
>
> why don't you use openstreetmap service instead of google maps.
> I am not an expert but it seems that there are a few references relating
> django and openstreet map
> a couple from a google search are:
>
> http://wiki.openstreetmap.org/wiki/Editors/Django
> https://github.com/etnalubma/django-osm
>
> http://www.slideshare.net/mishok13/making-use-of-openstreetmap-data-with-python
>
>
> personally, I have used osmand to capture gpx track data and then upload
> them to openstreet map and create a bike route
> or http://www.gpsvisualizer.com/ if you want just to plot your track
>
>
> On Sun, Nov 10, 2013 at 6:22 AM, Vibhu Rishi <vibhu.ri...@gmail.com>wrote:
>
>> Hi Guys,
>>
>> As a hobby project I am working on a website for my motorycle touring
>> group  ( A very early alpha is on http://www.bikenomads.co.in )
>>
>> I am working on the trip module and one of the things I want to work on
>> is a graphical trip route. I checked a few google map modules for django
>> and they seem more of just showing the map for a location.
>>
>> Can you provide me some pointers for any apps which will allow me to have
>> point and click route added ? or any ideas as to how to implement it.
>>
>> Regards,
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>> --
>> 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/CAPiONwnuV6vDGtkuK%2BfNyNePd0rOdO0gsxGQ-URoQ_iu8%2BcioQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
>  --
>  Nick Apostolakis
>  Msc in IT, University of Glasgow
>  e-mail: nicka...@oncrete.gr
>  Web Site: http://nick.oncrete.gr
>  --
>
>  --
> 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%2BTu-wxrfhJ-H%2BzdXY976bjm%2BNL-YTA-t_%2BStjkTQAtc0DVztQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkuj3w98wZda1ndQPx3YKoU6V_vXisqGMdN69q3c3%3D6Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Google Maps with Routes

2013-11-09 Thread Vibhu Rishi
Hi Guys,

As a hobby project I am working on a website for my motorycle touring group
 ( A very early alpha is on http://www.bikenomads.co.in )

I am working on the trip module and one of the things I want to work on is
a graphical trip route. I checked a few google map modules for django and
they seem more of just showing the map for a location.

Can you provide me some pointers for any apps which will allow me to have
point and click route added ? or any ideas as to how to implement it.

Regards,
Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwnuV6vDGtkuK%2BfNyNePd0rOdO0gsxGQ-URoQ_iu8%2BcioQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: how start work in django after installation in ubuntu

2013-10-03 Thread Vibhu Rishi
First of all, i suggest you start working in django in a virtualenv. This
helps as you can have your own virtual env for installing additional django
modules. if you want to host and check it on the web, i suggest you
checkout this page :
https://devcenter.heroku.com/articles/getting-started-with-django

then i suggest that you do the tutorials on django website.

then i suggest you get a book on django and do the project in it to
understand how things work. e.g. this book
http://www.amazon.com/Beginning-Django-E-Commerce-Experts-Development/dp/1430225351/ref=sr_1_1?s=books=UTF8=1380819727=1-1=django+ecommerce


then you start making your own projects.

Vibhu



On Thu, Oct 3, 2013 at 5:58 PM, jasvir sandhu wrote:

>
>  --
> 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/52759c02-31f1-4c94-a856-18375626d94d%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkBe4Uhm4cYa6r0H64rXmCLcw90La_%2BNrJoWkHH%2BKmQAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Two sets of registration with django-registration

2013-10-02 Thread Vibhu Rishi
hi

I have updated and using All Auth now. I also liked it that i can do the
social logins and the linkedin login seems to be working so far :)

Can you point me to documentation on how to ovveride the methods ? I dont
know so much about this part of django and am a bit at a loss in my
implementation.

vibhu


On Tue, Sep 24, 2013 at 7:32 AM, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:

> Thanks for the pointer. Will check out all auth.
>
> V.
>
>
> On Tue, Sep 24, 2013 at 4:03 AM, Kamil Gałuszka <galusz...@gmail.com>wrote:
>
>>
>> Of course.
>>
>> First of all I would recommend you using of django-allauth. They are
>> having great docs and they support custom user model. django-registration
>> is little less maintained and maybe less suitable for your needs.
>>
>> First you define your custom form in settings.py:
>> SIGNUP_FORM_CLASS
>>
>> Then you are inherit this class
>> https://github.com/pennersr/django-allauth/blob/master/allauth/account/adapter.pyand
>>  override method save_user to actually do what you want.
>>
>> And that is it. Is just that simple
>>
>> Cheers
>> Kamil
>>
>>
>>
>>
>> On Monday, September 23, 2013 7:32:38 PM UTC+2, Vibhu Rishi wrote:
>>>
>>> Hi,
>>>
>>> I have 2 types of users with different views of the same page . Using
>>> django-registration, I have been able to setup all the signup/password
>>> change etc for one level of users - say students.
>>>
>>> Now I want to have another set of registrations for Teachers. Is there a
>>> way to achieve that ?
>>>
>>> Vibhu
>>>
>>> --
>>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>>> Life is really simple, but we insist on making it complicated. -
>>> Confucius
>>>
>>  --
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Simplicity is the ultimate sophistication. - Leonardo da Vinci
> Life is really simple, but we insist on making it complicated. - Confucius
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONw%3DSGHvprmV3QYF967i7Ce5z1hQZsPH-%3DDJdoSHpwrMSeg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: custom if tag

2013-09-28 Thread Vibhu Rishi
Hi Alagappan,

The assignment_tag worked perfectly for me !

Thanks!
Vibhu


On Tue, Sep 24, 2013 at 1:01 AM, Alagappan  wrote:

> You can implement has_applied as a filter instead of a template tag.
> https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters
> Haven't check it, but something like {% if user|has_applied_filter:
> opening %} should essentially work out for your case.
>
>
> Another alternative could be use of assignment 
> tags.
> From documentation "This function works the same way as 
> simple_tag,
> except that it stores the tag’s result in a specified context variable
> instead of directly outputting it.".
>
> Regards,
> Alagappan R
>
> Twitter: @_alagappan 
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Two sets of registration with django-registration

2013-09-23 Thread Vibhu Rishi
Thanks for the pointer. Will check out all auth.

V.


On Tue, Sep 24, 2013 at 4:03 AM, Kamil Gałuszka <galusz...@gmail.com> wrote:

>
> Of course.
>
> First of all I would recommend you using of django-allauth. They are
> having great docs and they support custom user model. django-registration
> is little less maintained and maybe less suitable for your needs.
>
> First you define your custom form in settings.py:
> SIGNUP_FORM_CLASS
>
> Then you are inherit this class
> https://github.com/pennersr/django-allauth/blob/master/allauth/account/adapter.pyand
>  override method save_user to actually do what you want.
>
> And that is it. Is just that simple
>
> Cheers
> Kamil
>
>
>
>
> On Monday, September 23, 2013 7:32:38 PM UTC+2, Vibhu Rishi wrote:
>>
>> Hi,
>>
>> I have 2 types of users with different views of the same page . Using
>> django-registration, I have been able to setup all the signup/password
>> change etc for one level of users - say students.
>>
>> Now I want to have another set of registrations for Teachers. Is there a
>> way to achieve that ?
>>
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


custom if tag

2013-09-23 Thread Vibhu Rishi
Hi,

My scenario is that users would have applied for some job opening. I need
to do something like the following in my templates :

{% if has_applied opening user %}
You have applied
{% else %}
Click to apply
{% endif %}

However, so far i have been using templatetags and got the following only:
{% has_applied opening user %}

This returns a True or False from the implementation in
templatetags/project_extras.py as:

@register.simple_tag
def has_applied(opening,user):
applied = False
try:
connect = Connect.objects.get(user=user, connecting_to=opening)
applied = True
except:
applied= False
return applied

I get the correct True or False return from this function , but i am not
able to figure out how to use it with an if statement in the html
templates. Any pointers ?

Regards,
Vibhu


-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Two sets of registration with django-registration

2013-09-23 Thread Vibhu Rishi
Hi,

I have 2 types of users with different views of the same page . Using
django-registration, I have been able to setup all the signup/password
change etc for one level of users - say students.

Now I want to have another set of registrations for Teachers. Is there a
way to achieve that ?

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Login not working.

2013-09-07 Thread Vibhu Rishi
Hi Nigel,

You could also try using django-registration . I found that it made a lot
of the things I was trying with user login/registration easier.

Vibhu



On Fri, Sep 6, 2013 at 8:05 PM, Nigel Legg  wrote:

> I have removed the form.is_valid check and renamed the view, this now
> works (except for not directing to the correct page, it does appear to be
> logging in now)
> Thanks!
>
> Cheers, Nigel
> 07914 740972
>
>
>
> On 6 September 2013 14:35, Nigel Legg  wrote:
>
>> I am using django.contrib.auth, and have created the folowing:
>>
>> view:
>> def login(request):
>> if request.method == 'POST':
>> form = AuthenticationForm(request.POST)
>> if form.is_valid():
>> username = request.POST['username']
>> password = request.POST['password']
>> user = authenticate(username=username, password=password)
>> if user is not None:
>> login(request, user)
>> if login == True:
>> return render_to_response('myapp/list.html')
>> else:
>> error = 'Disabled account. Pay your bill!!'
>> return render_to_response('auth/login.html',
>> {'form': form, 'error': error },
>> context_instance=RequestContext(request)
>> )
>> else:
>> error = 'invalid login...'
>> return render_to_response('auth/login.html',
>> {'form': form, 'error': error },
>> context_instance=RequestContext(request)
>> )
>> else:
>> form = AuthenticationForm()
>> return render_to_response(
>> 'auth/login.html', {'form': form},
>> context_instance=RequestContext(request)
>> )
>>
>> template:
>> 
>>  
>> 
>> > enctype="multipart/formdata"> {% csrf_token %}
>>  {{ error }} 
>>  {{ form.username.label_tag }} {{ form.username }} 
>>  {{ form.password.label_tag }} {{ form.password }} 
>>   
>> 
>>
>> When I go to the login page, and enter the user details, it returns with
>> "invalid login", in other words it is failing the is_valid() check.  Am I
>> missing something here?  I have checked through the documentation (django
>> 1.5) and don't appear to be.
>> Any help greatly appreciated.
>>
>> Cheers, Nigel
>> 07914 740972
>>
>>
>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-registration reset password templates not getting picked up

2013-09-03 Thread Vibhu Rishi
Hi Kevin,

You were absolutely correct. Moving 'homepage' to the top made it work.
Thanks!

I was doing all my templates within a single directory pre 1.5 . But then
in 1.5 they changed it, so I got a bit confused but then started putting
the templates within the app. Not sure if this is good or bad.

Vibhu


On Tue, Sep 3, 2013 at 7:55 AM, Kelvin Wong <wongo...@gmail.com> wrote:

> Check that your 'homepage' app is above the 'registration' app:
>
> INSTALLED_APPS = (
> 'homepage',  # Order matters, this is loaded before others
> 'registration',
> 'django.contrib.auth',
>...
> )
>
> Order of the apps is significant. Review
>
>
> https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.app_directories.Loader
>
> As a matter of personal style, I would put them in a project template
> folder and not in an app templates folder.
>
> K
>
>
>
> On Monday, September 2, 2013 7:01:30 PM UTC-7, Vibhu Rishi wrote:
>>
>> Essentially the below should work (and is working for all) as I have the
>> following template loader:
>>
>> TEMPLATE_LOADERS = (
>> 'django.template.loaders.**filesystem.Loader',
>> 'django.template.loaders.app_**directories.Loader',
>> )
>>
>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-registration reset password templates not getting picked up

2013-09-02 Thread Vibhu Rishi
Essentially the below should work (and is working for all) as I have the
following template loader:

TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)

Vibhu

On Tue, Sep 3, 2013 at 7:21 AM, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:

> I have a module called homepage and they reside in that. Path is as
> follows :
>
> $ ls homepage/templates/registration/
> *activate.htmlpassword_change_form.html
> *activation_complete.html  password_reset_complete.html
> *activation_email_subject.txt  password_reset_confirm.html
> *activation_email.txt  password_reset_done.html
> *base.html password_reset_email.html
> *login_error.html  password_reset_form.html
> *login.html*registration_complete.html
> *logout.html   *registration_form.html
> password_change_done.html
>
> The ones with * are being picked up (* added after the ls command :) ).
> Others are not.
>
> Vibhu
>
>
> On Tue, Sep 3, 2013 at 6:58 AM, Kelvin Wong <wongo...@gmail.com> wrote:
>
>> If you are not using a templates folder in your project root, where are
>> your registration templates located?
>>
>> K
>>
>>
>> On Monday, September 2, 2013 9:42:50 AM UTC-7, Vibhu Rishi wrote:
>>
>>>
>>> So far, all the other template html files get picked up - except the
>>> ones related to the password management ones.
>>>
>>> Vibhu
>>>
>>  --
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Simplicity is the ultimate sophistication. - Leonardo da Vinci
> Life is really simple, but we insist on making it complicated. - Confucius
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-registration reset password templates not getting picked up

2013-09-02 Thread Vibhu Rishi
I have a module called homepage and they reside in that. Path is as follows
:

$ ls homepage/templates/registration/
*activate.htmlpassword_change_form.html
*activation_complete.html  password_reset_complete.html
*activation_email_subject.txt  password_reset_confirm.html
*activation_email.txt  password_reset_done.html
*base.html password_reset_email.html
*login_error.html  password_reset_form.html
*login.html*registration_complete.html
*logout.html   *registration_form.html
password_change_done.html

The ones with * are being picked up (* added after the ls command :) ).
Others are not.

Vibhu


On Tue, Sep 3, 2013 at 6:58 AM, Kelvin Wong <wongo...@gmail.com> wrote:

> If you are not using a templates folder in your project root, where are
> your registration templates located?
>
> K
>
>
> On Monday, September 2, 2013 9:42:50 AM UTC-7, Vibhu Rishi wrote:
>
>>
>> So far, all the other template html files get picked up - except the ones
>> related to the password management ones.
>>
>> Vibhu
>>
>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-registration reset password templates not getting picked up

2013-09-02 Thread Vibhu Rishi
Thanks Kelvin for the response. However, I am not sure I understand why
this is to be done.

currently my TEMPLATE_DIRS is not having anything. it is as follows:
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

So far, all the other template html files get picked up - except the ones
related to the password management ones.

Vibhu



On Mon, Sep 2, 2013 at 6:37 AM, Kelvin Wong <wongo...@gmail.com> wrote:

> TEMPLATE_DIRS needs to have the location of the templates. As long as
> those templates are being picked up and one is called
> 'password_reset_form.html' it should work.
>
> One of my apps has this form at:
>
> /my_project/templates_global/registration/password_reset_form.html
>
> In /my_project/my_project/settings.py
>
> PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
>
> TEMPLATE_DIRS = (
> os.path.join(PROJECT_ROOT, 'templates_global')
> )
>
> The templates were all copied
> from django.contrib.admin.templates.registration
>
> K
>
>
> On Saturday, August 31, 2013 11:02:14 PM UTC-7, Vibhu Rishi wrote:
>
>> I am getting a bit of a problem with django-registration
>>
>> what else do i need to do ? As per the django-registration documentation,
>> the auth_urls.py is supposed to be automatically included with the default
>> backend. But apparently, there is some disconnect here.
>>
>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Django-registration reset password templates not getting picked up

2013-09-01 Thread Vibhu Rishi
I am getting a bit of a problem with django-registration

django-registration was installed in a venv using pip. I have version 1.0
of django-registration and 1.5.1 of Django . I have the
templates/registration directory with the templates for the pages that are
to display the different pages.
login, logout, register work fine. Proper templates get picked up - and I
have modified them according to my needs.

However, now I am trying to loop in the password reset functionality.
However, when I hit the URL http://127.0.0.1:8000/accounts/password/reset/ it
is picking up the default django admin reset url. I cant get this to pickup
my templates. Following are my settings:

in settings.py :

INSTALLED_APPS = (
'registration',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
   ...
)

in urls.py

urlpatterns = patterns('',
#django-registration
url(r'^accounts/',include('registration.backends.default.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
   ...
)

what else do i need to do ? As per the django-registration documentation,
the auth_urls.py is supposed to be automatically included with the default
backend. But apparently, there is some disconnect here.

Regards,
Vibhu
-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Simple Static Content Site on Heroku?

2013-06-17 Thread Vibhu Rishi
In this case - do you even need django ? A html site with just bootstrap
for the response ux will be enough.

Vibhu

On Sun, Jun 16, 2013 at 7:32 PM, Vincent Fulco  wrote:

> Fairly new to the framework and have been reading a ton of material.
>
> While I have found a couple of great git repos using Bootstrap with
> Django, I haven't found too many examples of dead simple sites other than
> some single page blogs.  I am working on an informational site with at most
> 5 pages and potentially a blog down the road for a customer (thinking S3,
> compressor, boto, etc. usage within).
>
> Do I even need to incorporate the PostgreSQL RDBMS at this juncture or
> should I set it up for future proofing purposes?  Django is most likely too
> feature packed for such a rudimentary project, yet using it is fulfilling a
> secondary role of giving me a learning stepping stone to a few more
> projects with greater complexity.  So I am not looking for other tools to
> use, just some mention of what I can safely do at this point (elimination
> wise) and still have a robust, well designed, responsive offering.
>
> TIA, V.
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't open any other view except default "It Worked!" page......

2013-05-04 Thread Vibhu Rishi
Did you :
1. add the polls app to the INSTALLED_APP?
2. modify the urls.py as mentioned below to go to the polls ?

Vibhu

On Sun, May 5, 2013 at 7:42 AM, Russell Keith-Magee  wrote:

>
> If all you're getting is the "It worked!" page, then it means your urls.py
> hasn't been configured correctly. The "It worked" page is displayed when
> your urls.py is found, but is empty.
>
> You'll need to write some views and connect them up in your urls.py;
> alternatively, you could write up admin registrations for your inspected
> models and activate the admin URLs.
>
> Yours,
> Russ Magee %-)
>
> On Sun, May 5, 2013 at 8:27 AM, Daniel O' Shaughnessy <
> danieljamesda...@gmail.com> wrote:
>
>> Hi,
>>
>> This worked fine for me with the polls tutorial app but when I tried
>> another app it kept just giving me that page over and over even though I
>> followed the same procedure as the polls app except I used inspectdb
>>
>> Now this page is all I get for anything and I've tried deleting all
>> projects and starting new ones but no luck any ideas?
>>
>> Cheers,
>>
>> Daniel
>>
>> --
>> 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?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can I get away with creating login/logout.html ?

2013-04-17 Thread Vibhu Rishi
I tried this but when I click submit, the page goes to
http://127.0.0.1:8000/account/login/ . i suppose once the login part
finishes it is supposed to go to the LOGIN_REDIRECT_URL setting.

Vibhu


On Wed, Apr 17, 2013 at 9:38 PM, Gabriel [SGT]  wrote:

> > still trying to figure out the login part.
> >
>
>
> https://docs.djangoproject.com/en/dev/topics/auth/default/#module-django.contrib.auth.views
>
> See settings.LOGIN_REDIRECT_URL
>
> Regards.
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can I get away with creating login/logout.html ?

2013-04-17 Thread Vibhu Rishi
update:

logout seems to be working if i change the logout url pattern to :
(r'^logout/$', 'logout', {'template_name':'homepage/index.html',
'next_page':'/'}),

still trying to figure out the login part.

Vibhu



On Wed, Apr 17, 2013 at 8:05 PM, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:

> Hi,
>
> I am trying to figure out if i can get away with creating the login.html
> and logout.html files ?
>
> The scenario is this:
> - I have a navigation bar which has the username/password field in it . I
> am using the example at :
> http://twitter.github.io/bootstrap/examples/hero.html
> - I want the user to login at this box and be redirected back to the
> current page.
>
> as per the documentation I created an app for account and in its url.py I
> have added
> from django.conf.urls import patterns,url
>
> from account import views
>
> urlpatterns = patterns('django.contrib.auth.views',
> (r'^login/$', 'login',
> {'template_name':'account/login.html'},'login'),
> (r'^logout/$', 'logout',
> {'template_name':'account/logout.html'},'logout'),
> )
>
> in my index.html file i did the following modifications :
>
> {% if user.is_authenticated %}
> 
>  Hello {{ user.username }} ! 
>  ( logout 
> 
> {% else %}
> {% csrf_token %}
>   
>   
>   Sign in
> 
> {% endif %}
>
> I checked with admin user (which was already logged in via /admin url )
> and the above reflects the username if admin is logged in otherwise it
> shows the login form boxes.
>
> Now, what i am trying to do is get a new user i created ( vibhu ) to
> login, but the app is expecting to find a URL for account/login . I get the
> following :
> TemplateDoesNotExist at /account/login/
>
> Is there a way to remove this requirement ? I dont want to really create
> an account/login.html or account/logout.html if possible as I think those
> are unnecessary here. I want the login/logout to be handled by the code in
> the navbar itself.
>
> Vibhu
>
> --
> Simplicity is the ultimate sophistication. - Leonardo da Vinci
> Life is really simple, but we insist on making it complicated. - Confucius
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Can I get away with creating login/logout.html ?

2013-04-17 Thread Vibhu Rishi
Hi,

I am trying to figure out if i can get away with creating the login.html
and logout.html files ?

The scenario is this:
- I have a navigation bar which has the username/password field in it . I
am using the example at :
http://twitter.github.io/bootstrap/examples/hero.html
- I want the user to login at this box and be redirected back to the
current page.

as per the documentation I created an app for account and in its url.py I
have added
from django.conf.urls import patterns,url

from account import views

urlpatterns = patterns('django.contrib.auth.views',
(r'^login/$', 'login',
{'template_name':'account/login.html'},'login'),
(r'^logout/$', 'logout',
{'template_name':'account/logout.html'},'logout'),
)

in my index.html file i did the following modifications :

{% if user.is_authenticated %}

 Hello {{ user.username }} ! 
 ( logout 

{% else %}
{% csrf_token %}
  
  
  Sign in

{% endif %}

I checked with admin user (which was already logged in via /admin url ) and
the above reflects the username if admin is logged in otherwise it shows
the login form boxes.

Now, what i am trying to do is get a new user i created ( vibhu ) to login,
but the app is expecting to find a URL for account/login . I get the
following :
TemplateDoesNotExist at /account/login/

Is there a way to remove this requirement ? I dont want to really create an
account/login.html or account/logout.html if possible as I think those are
unnecessary here. I want the login/logout to be handled by the code in the
navbar itself.

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Trouble with CSS/Static Files

2013-04-04 Thread Vibhu Rishi
Hi,

>Have you ran
>$ manage.py collectstatic

Can you explain why I need to do this on my dev machine when I am not
deploying it to production ? If I look at the docs at
https://docs.djangoproject.com/en/dev/howto/static-files/#deployment , it
mentions that I need to run this to deploy it. However, the problem I was
getting was on my local system.


Vibhu


On Fri, Apr 5, 2013 at 4:00 AM, CJ Milholland <cjm1...@gmail.com> wrote:

> Have you ran
>
> $ manage.py collectstatic
>
> On Thursday, April 4, 2013 12:49:11 AM UTC-7, Vibhu Rishi wrote:
>>
>> I am not sure where I am going wrong, but the CSS files are just not
>> getting picked up. I have just started a project and am using the dev
>> server with the runserver command.
>>
>> Here's my relevant settings.py :
>>
>>
>> STATIC_ROOT = os.path.join(os.path.dirname(_**_file__),'/static/')
>> STATIC_URL = '/static/'
>>
>> My directory structure :
>> .
>> ├── homepage
>> │   └── templates
>> │   └── homepage
>> ├── qj
>> └── static
>> ├── css
>> ├── img
>> └── js
>>
>> qj is where my settings.py file is.
>> static is where i have the css. I am using bootstrap css files. I want it
>> to be at the top location as these files are going to be used in all the
>> apps that i will be writing.
>> homepage is where i have the index page that I am trying to link the css
>> to. the html is as follows :
>>
>> $ cat homepage/templates/homepage/**index.html
>>
>> 
>> 
>>   
>>   {% load static %}
>> Hello World!
>> 
>>  
>> > media="screen">
>>   
>>   
>>   Hello World
>>  > src="<a  rel="nofollow" href="http://code.jquery.com/**jquery.js">http://code.jquery.com/**jquery.js</a><<a  rel="nofollow" href="http://code.jquery.com/jquery.js">http://code.jquery.com/jquery.js</a>>
>> ">
>> 
>>   
>> 
>>
>> I am trying both the {% static  %} and the hardcoded static/js to
>> see if it is working. The following is the output i get on loading the /
>> page:
>>
>> [04/Apr/2013 12:23:38] "GET / HTTP/1.1" 200 413
>> [04/Apr/2013 12:23:38] "GET /static/css/bootstrap.min.css HTTP/1.1" *404*1667
>> [04/Apr/2013 12:23:38] "GET /static/js/bootstrap.min.js HTTP/1.1" *404*1661
>>
>> It just is not picking up the css or the js file. What am I doing wrong ?
>>
>> Regards,
>> Vibhu
>>
>>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Trouble with CSS/Static Files

2013-04-04 Thread Vibhu Rishi
Thanks Tom, your post got me thinking ! If the problem was the pathing then
using the absolute path should have worked. So , I put in
STATIC_ROOT="/home/vibhu/Programming/qj/static/"

But that still did not work - which means that I was still doing something
wrong. Finally, it hit me - I was using the wrong variable (see comment
copied below).

Instead of STATIC_ROOT , I should have been using STATICFILES_DIR

So, now my settings.py is as follows :

# Absolute path to the directory static files should be collected to.
# *Don't put anything in this directory yourself*; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
STATIC_ROOT=""
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
 os.path.join(os.path.dirname(__file__),'../static/'),
)


And this is working ! Thanks for the tip for going up a directory else i
would still be floundering !

Vibhu



On Thu, Apr 4, 2013 at 7:24 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Thu, Apr 4, 2013 at 8:49 AM, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:
> > I am not sure where I am going wrong, but the CSS files are just not
> getting
> > picked up. I have just started a project and am using the dev server with
> > the runserver command.
> >
> > Here's my relevant settings.py :
> >
> >
> > STATIC_ROOT = os.path.join(os.path.dirname(__file__),'/static/')
> > STATIC_URL = '/static/'
> >
> > My directory structure :
> > .
> > ├── homepage
> > │   └── templates
> > │   └── homepage
> > ├── qj
> > └── static
> > ├── css
> > ├── img
> > └── js
> >
> > qj is where my settings.py file is.
> > static is where i have the css.
>
> You've told it to look in the wrong place:
>
> >>> os.path.dirname('/path/to/project/qj/settings.py')
> '/path/to/project/qj'
> >>> os.path.join(os.path.dirname('/path/to/project/qj/settings.py'),
> 'static')
> '/path/to/project/qj/static'
>
> Try this instead:
>
> STATIC_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__),
> '..', '/static/'))
>
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Trouble with CSS/Static Files

2013-04-04 Thread Vibhu Rishi
Hi Jack,

Template is fine as the Hello World is getting rendered correctly. I also
get the 200 for /

Vibhu


On Thu, Apr 4, 2013 at 6:33 PM, Jacky Tedy <sgs...@gmail.com> wrote:

> it looks like you don't have the right template ! You sure you have the
> right path?
>
>
> 2013/4/4 Vibhu Rishi <vibhu.ri...@gmail.com>
>
>> I am not sure where I am going wrong, but the CSS files are just not
>> getting picked up. I have just started a project and am using the dev
>> server with the runserver command.
>>
>> Here's my relevant settings.py :
>>
>>
>> STATIC_ROOT = os.path.join(os.path.dirname(__file__),'/static/')
>> STATIC_URL = '/static/'
>>
>> My directory structure :
>> .
>> ├── homepage
>> │   └── templates
>> │   └── homepage
>> ├── qj
>> └── static
>> ├── css
>> ├── img
>> └── js
>>
>> qj is where my settings.py file is.
>> static is where i have the css. I am using bootstrap css files. I want it
>> to be at the top location as these files are going to be used in all the
>> apps that i will be writing.
>> homepage is where i have the index page that I am trying to link the css
>> to. the html is as follows :
>>
>> $ cat homepage/templates/homepage/index.html
>>
>> 
>> 
>>   
>>   {% load static %}
>> Hello World!
>> 
>>  
>> > media="screen">
>>   
>>   
>>   Hello World
>>  http://code.jquery.com/jquery.js&quot</a>;>
>> 
>>   
>> 
>>
>> I am trying both the {% static  %} and the hardcoded static/js to
>> see if it is working. The following is the output i get on loading the /
>> page:
>>
>> [04/Apr/2013 12:23:38] "GET / HTTP/1.1" 200 413
>> [04/Apr/2013 12:23:38] "GET /static/css/bootstrap.min.css HTTP/1.1" *404*1667
>> [04/Apr/2013 12:23:38] "GET /static/js/bootstrap.min.js HTTP/1.1" *404*1661
>>
>> It just is not picking up the css or the js file. What am I doing wrong ?
>>
>> Regards,
>> Vibhu
>>
>>  --
>> 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?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Trouble with CSS/Static Files

2013-04-04 Thread Vibhu Rishi
I am not sure where I am going wrong, but the CSS files are just not
getting picked up. I have just started a project and am using the dev
server with the runserver command.

Here's my relevant settings.py :


STATIC_ROOT = os.path.join(os.path.dirname(__file__),'/static/')
STATIC_URL = '/static/'

My directory structure :
.
├── homepage
│   └── templates
│   └── homepage
├── qj
└── static
├── css
├── img
└── js

qj is where my settings.py file is.
static is where i have the css. I am using bootstrap css files. I want it
to be at the top location as these files are going to be used in all the
apps that i will be writing.
homepage is where i have the index page that I am trying to link the css
to. the html is as follows :

$ cat homepage/templates/homepage/index.html



  
  {% load static %}
Hello World!

 

  
  
  Hello World
 http://code.jquery.com/jquery.js";>

  


I am trying both the {% static  %} and the hardcoded static/js to see
if it is working. The following is the output i get on loading the / page:

[04/Apr/2013 12:23:38] "GET / HTTP/1.1" 200 413
[04/Apr/2013 12:23:38] "GET /static/css/bootstrap.min.css HTTP/1.1" *404*1667
[04/Apr/2013 12:23:38] "GET /static/js/bootstrap.min.js HTTP/1.1" *404* 1661

It just is not picking up the css or the js file. What am I doing wrong ?

Regards,
Vibhu

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Heroku] App crashing on unidle

2013-03-07 Thread Vibhu Rishi
Hi

I have not done any update to my django site in the last couple of weeks.
However, suddenly, about 2 days back, it is crashing repeatedly. If I stop
and start the web service from the heroku.com site, it starts again. If
check logs from the command line ( heroku logs ) it starts after sometime.
But after another couple of hours, it crashes again.

site is http://www.bikenomads.co.in

The log part that I can see the problem is as follows :
2013-03-06T23:08:55+00:00 app[web.1]: [06/Mar/2013 17:08:55] "*GET
/robots.txt HTTP/1.1" 404 5147*
2013-03-06T23:08:56+00:00 app[web.1]: [06/Mar/2013 17:08:56] "GET /
HTTP/1.1" 200 14527
2013-03-07T00:15:50+00:00 heroku[web.1]: Idling
2013-03-07T00:15:54+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-03-07T00:15:58+00:00 heroku[web.1]: *Process exited with status 143*
2013-03-07T00:15:58+00:00 heroku[web.1]: State changed from up to down

I do not have a 'robots.txt' file - do you think that is causing the crash
?

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: virtualenv setup

2013-01-04 Thread Vibhu Rishi
Hi Phil,

What OS are you running on ? for ubuntu, you need to have an extra
parameter while creating the venv like :
$ virtualenv venv --distribute --no-site-packages

After that source the environment and pip install the packages
pip install Django psycopg2 dj-database-url

I would suggest you try the setup first on a blank directory.

Another thing you may want to check is where the manage.py file is . e.g. I
copied over the project that I was working on in a directory called
'website'. the manage.py is inside this directory instead of the root
directory (from where your do source). So, in this case I run the server as
:
$ python website/manage.py runserver

Vibhu

On Sun, Dec 30, 2012 at 10:27 AM, Sam Lai  wrote:

> It looks like you haven't installed Django in your virtualenv. In your
> virtualenv directory, look in lib/python2.x/site-packages and see if there
> is a Django directory in there.
>
> You can also try sourcing your venv, then running Python, and entering in
> the following statement to see if Python can find Django -
>
> import django
>
> If it can't, try the following statements in the Python shell and see if
> your venv's site-packages directory is in the system path -
>
>  import sys
> sys.path
>
> Finally, try the following command in your usual shell and make sure it is
> referring to the right Python executable (it should be referring to the one
> in your venv/bin directory) -
>
> which python
>
>
> On 30 December 2012 09:23, Phil  wrote:
>
>> Hi,
>>
>> Thanks for reply. Yeah I activated the source(terminal has "venv" beside
>> my username). I followed instructions here(so I pip installed django etc
>> after getting virtualenv up and running)...
>>
>> https://devcenter.heroku.com/articles/django#prerequisites
>>
>> If I runserver thats when I get the error. If I runserver without
>> activating source it works fine but that would be using my system wide
>> python. Just need to figure out how to get it to recognise the virtualenv
>> python.
>>
>>
>> On Saturday, December 29, 2012 10:16:45 PM UTC, quinonesvictor wrote:
>>
>>> Hi Phil
>>>
>>> sorry for the question, but, did you activate your virtualenv source?
>>> $ source bin/activate (?)
>>>
>>> Anyway, I'd try to install django via pip once you I have my virtualenv
>>> created and activated.
>>>
>>> Cheers
>>>
>>> On Sat, Dec 29, 2012 at 7:01 PM, Phil  wrote:
>>>
  Hi,

 I have python/django working system wide. But am currently looking into
 using Heroku for a new project so am trying to get virtualenv setup for the
 first time. When I run "django-admin.py startproject whatever" it creates
 the project ok, but then when I run "python manage.py runserver 8080" from
 the project folder I get the following error...

 ImportError: No module named django.core.management

 Is it because at the top of my "manage.py" it is pointing to my system
 wide python(#!/usr/bin/env python) instead of my virtualenv one? If so how
 do I fix this? I tried changing the path at the top of the manage.py file
 but didn't seem to do anything.

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To view this discussion on the web visit https://groups.google.com/d/**
 msg/django-users/-/n4-**fu8ioveIJ
 .
 To post to this group, send email to django...@googlegroups.com.
 To unsubscribe from this group, send email to django-users...@**
 googlegroups.com.

 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>
>>>
>>>
>>> --
>>> Quiñones Victor Manuel
>>> Tel: +54 0362 15 4 880839
>>> Resistencia - 3500
>>> Argentina
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/Gb4JYmpcK-0J.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django 

Re: Get objects sorted by time of last comment

2013-01-04 Thread Vibhu Rishi
Hi Anssi,

Thanks for the comment.

I was thinking that if I have to do the last comment hackery for all the
objects would it also work if I
* add a last_comment_time field to the models I use with comments.
* modify the comment form ( not sure which file to modify, still thinking
it through) to add comment timestamp to the post model data.

then the query could become much simpler in the sense that I only need to
get post objects, and sort by last_comment_time field.

Vibhu

On Wed, Jan 2, 2013 at 8:45 PM, akaariai <akaar...@gmail.com> wrote:

> On 2 tammi, 08:50, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:
> > Hi All,
> >
> > A very happy new year to you all !
> >
> > I am working on a website I am making as my hobby project. It is to do
> with
> > motorcycle touring.
> >
> > I have done some initial work on it, and incrementally making changes as
> > and when I can.
> >
> > I am trying to figure out the following issue :
> > 1. I have a forum object where people can start threads.
> > 2. the forum object uses the django comments module along with mptt. So
> far
> > so good.
> > 3. Now, I want to show the "latest commented on" posts. But I am not able
> > to figure it out.
> >
> > For reference :http://bikenomads.herokuapp.com/
> >
> > On the box on the right, I want to show the posts based on the last
> comment
> > time. However, all I can do right now is show the last post based on
> > creation time (this is a field for the post object). I am not able to
> > figure out how to sort based on comment time.
> >
> > Solutions :
> > 1. Ideally there should be a way to sort object by comment time using the
> > inbuilt comments module in django. Is this possible ?
> > 2. Alternatively, I will need to update the post model to have another
> > field for 'last_comment_time' and when someone posts a comment, I will
> need
> > to update this field. I would rather not do this as I will need to make
> > sure all the objects using comments will need to have this exact field.
> >
> > What would you suggest ?
>
> The ORM doesn't offer a way to do the query you want. The query will
> be something like this:
> select * from post
>   left join comment on comment.object_id = post.id and
> comment.object_type = 'post'
> and comment.timestamp = (select max(timestamp) from
> comment
>   where object_id = post.id and
> comment.object_type = 'post'
>  )
>  order by comment.timestamp;
> (Assuming unique comment timestamp per post).
>
> There are two underlying problems. First, Django's ORM doesn't
> currently offer any way to generate more than single column equality
> comparison in the JOIN clause. We are working on removing this
> limitation from 1.6 (actually, the underlying limitation is already
> somewhat gone). Second, the SQL needed isn't exactly nice. There are
> multiple ways to write the same SQL, and how they perform differ
> somewhat depending on the used DB and the amount of data.
>
> So, what can you do pre 1.6? One way is to use views and some hackery
> to do what you want.
>
> class LatestComment(models.Model):
> post = models.OneToOneField(Post, primary_key=True,
> on_delete=models.DO_NOTHING, related_name='latest_comment')
> {{ duplicate the columns in comment model here - you don't need
> content type id }}
>
> class Meta:
> managed = False
> db_table = 'latest_post_comment_view'
>
> Then, create a view like this in the DB:
>
> create or replace view "latest_post_comment_view" as (
> select object_id as post_id, ...
>   from comment
>  where object_type = 'post'
>  group by post_id, ...
> having max(timestamp) = timestamp
> );
>
> The SQL above is untested. In any case, you should now be able to do:
>
>
> Post.objects.select_related('latest_comment').order_by('latest_comment__timestamp')
>
> You will need to repeat the above for all the models with comments
>
> Managing the raw SQL needed for the views can be somewhat ugly. The
> last_comment_time field might be easier to implement & maintain. That
> being said I have been using the above technique successfully in
> production systems.
>
> I do wish Django will one day have latest_related() functionality. I
> find I need that often, and as the above shows this isn't easily
> doable currently.
>
>  - Anssi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To u

Get objects sorted by time of last comment

2013-01-01 Thread Vibhu Rishi
Hi All,

A very happy new year to you all !

I am working on a website I am making as my hobby project. It is to do with
motorcycle touring.

I have done some initial work on it, and incrementally making changes as
and when I can.

I am trying to figure out the following issue :
1. I have a forum object where people can start threads.
2. the forum object uses the django comments module along with mptt. So far
so good.
3. Now, I want to show the "latest commented on" posts. But I am not able
to figure it out.

For reference : http://bikenomads.herokuapp.com/

On the box on the right, I want to show the posts based on the last comment
time. However, all I can do right now is show the last post based on
creation time (this is a field for the post object). I am not able to
figure out how to sort based on comment time.

Solutions :
1. Ideally there should be a way to sort object by comment time using the
inbuilt comments module in django. Is this possible ?
2. Alternatively, I will need to update the post model to have another
field for 'last_comment_time' and when someone posts a comment, I will need
to update this field. I would rather not do this as I will need to make
sure all the objects using comments will need to have this exact field.

What would you suggest ?

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Happy new year

2013-01-01 Thread Vibhu Rishi
Happy new year from India !

Keep Djangoing !

V.

On Wed, Jan 2, 2013 at 4:56 AM, Elena Williams  wrote:

> Happy New Year from to all the Djangonauts from stonking hot Australia!
>
> I hope everyone's Django projects are awesome and plentiful this year!
>
> Go you smart, creative Django folk!
> ---
> Elena :)
> @elequ
>
> On Wed, Jan 2, 2013 at 4:30 AM, Sultan Imanhodjaev <
> sultan.imanhodj...@gmail.com> wrote:
>
>> Жаңы жылыңыздар менен!
>>
>>
>>
>> Sultan, Bishkek Kyrgyzstan.
>>
>>
>> On Tue, Jan 1, 2013 at 10:33 PM, Mark Phillips <
>> m...@phillipsmarketing.biz> wrote:
>>
>>> Happy New Year from Arizona!
>>>
>>> Mark
>>> On Jan 1, 2013 9:25 AM, "Amirouche" 
>>> wrote:
>>>
 Bonne année, paix et prosperités!

 Amirouche from Paris, FRANCE.

 On Monday, December 31, 2012 10:42:13 PM UTC+1, cingusoft wrote:
>
> Happy new year from spain to all django lovers.
> I wish you a new year with tons of django projects.
>
> Cheers
> Cingusoft
> BlackBerry de movistar, allí donde estés está tu oficin@

  --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/django-users/-/He2t7vHzrBAJ.
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to
 django-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/django-users?hl=en.

>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> --
>> Kind regards,
>> Sultan Imanhodjaev
>> +996 559 06 76 06
>> PGP 0x4E357296
>> http://imanhodjaev.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: views on one page

2012-11-15 Thread Vibhu Rishi
I don't think you can use 2 views on the same page.

what you can do is pass 2 values to the same page to display.

so in the 2nd view you will do as follows:
return render_to_response("kundendaten.html", { 'row': row,'current_date':
now }, context_instance=RequestContext(request))

and make sure that you have a variable for now in the 2nd view.

Hope this helps.

V.


On Thu, Nov 15, 2012 at 2:33 PM, Nebros  wrote:

> Are there not more intput? pls help me, I do not go any further...!
>
> Am Mittwoch, 14. November 2012 10:50:04 UTC+1 schrieb Nebros:
>
>> Good morning
>> I have 2 diffrent views, every one i just needet on one page... till now.
>>
>> view one-output is the time-
>> @csrf_protect
>> def portal(request):
>> now = datetime.datetime.now()
>> return render_to_response('portal.**html', {'current_date': now},
>> context_instance=**RequestContext(request))
>> --**---
>>
>> view two-output are data out of a mssql db--
>> def kundendaten(request):
>> cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=MAURITIUS;**
>> DATABASE=baan5c;UID=***;PWD=***')
>> cursor = cnxn.cursor()
>> cursor.execute("SELECT x.t_name, y.t_mail FROM tttaad20 as x,
>> tttcmf20 as y WHERE (x.t_name = y.t_name) AND (x.t_user = 'niedereh')")
>> row = cursor.fetchall()
>> return render_to_response("**kundendaten.html", { 'row': row },
>> context_instance=**RequestContext(request))
>> --**--**
>> ---
>>
>> in addition, i have to set the x.t_user as a variable. the value will be
>> given from the page before. (form/post/submit)
>>
>> how can i use this two now on one page? (i know these are two
>> render_to_response and i cant just use:
>> {% block content %}Zeit der Aktualisierung {{ current_date }}{%
>> endblock %}
>> and
>> {% block content %}Kundendaten {{ row }}.{% endblock %}
>> on one page)...
>>
>> I just failed by the try to change them...
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Fxv5JtTBvnAJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django - adding a counter for every ManyToMany field added

2012-11-13 Thread Vibhu Rishi
Would this not work :

count = i.objects.filter(activities=Activity).count()

Where you would put the count in a for loop for the Activity and iterate
over it.

V.


On Wed, Nov 14, 2012 at 5:05 AM, Nikolas Stevenson-Molnar <
nik.mol...@consbio.org> wrote:

>  I'm not sure I understand. Do you want the value of the "count" field in
> the Activity model? In that case, you could use values:
>
> activity_counts = i.activities.all().values('id', 'count') #Will give you
> something like [{'id': 1, 'count': 3}, {'id': 2, 'count': 5}, ...]
>
> _Nik
>
>
> On 11/13/2012 3:09 PM, luke lukes wrote:
>
> Hi. I don't need a total counter for all related activities. I need a
> counter for each related Activity:
> Invoice instance:
> activity A -> counter: 3
> activity B -> counter: 5
> ...
> ...
>
> is this possible?
> thanks,
> Luke
>
>
> Il giorno martedì 13 novembre 2012 23:25:28 UTC+1, Nikolas
> Stevenson-Molnar ha scritto:
>>
>>  With an Invoice instance, you can easily get the number of related
>> Activity objects:
>>
>> i = Invoice.objects.get(pk=1)
>> num_activities = i.activities.all().count()
>>
>> _Nik
>>
>> On 11/13/2012 12:49 PM, luke lukes wrote:
>>
>> Hi everyone. hi have these models:
>>
>>#models.py
>>
>>  class Subject(models.Model):
>>  name = models.CharField("Name",max_**length=50, blank=True)
>>  ...
>>  ...
>>
>>  class Activity(models.Model):
>>  label = models.CharField("Act. name",max_length=150)
>>  price = models.DecimalField("price", max_digits=10,
>> decimal_places=2,default=0)
>>  count = models.IntegerField("Count", default=0)
>>
>>  def __unicode__(self):
>> return u"%s" % (self.label)
>>  class Meta:
>> verbose_name_plural = "Activities"
>>
>>
>>  class Invoice(models.Model):
>>  subject = models.ForeignKey(Subject)
>>  date = models.DateField(default=date.**today())
>>  activities = models.ManyToManyField(**Activity)
>>  
>>  
>>
>>
>>  while creating a new Invoice instance on admin, i can select the many
>> to many fields 'activities', but i'd like to have an additional counter
>> (eg. an IntegerField) as an Invoice field to count and save the quantity of
>> each activity added to my Invoice instance. Is this possible?
>>
>> I mean: for each 'Activity' added to an Invoice instance, i need to
>> count the amount of that activity.
>>
>>
>>  thanks,
>>
>> LuKe
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit https://groups.google.com/d/**
>> msg/django-users/-/**F07dICRAF9kJ
>> .
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-users...@**
>> googlegroups.com.
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/S94XcwpnGkUJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Forbidden (403)

2012-11-12 Thread Vibhu Rishi
When is it that you are getting the 403 ?


On Mon, Nov 12, 2012 at 7:30 PM, Nebros  wrote:

> I know this is an old problem with many answers... but no one helps me. ^^
> what i have:
>
> Settings
> MIDDLEWARE_CLASSES = (
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> # Uncomment the next line for simple clickjacking protection:
> # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
> ---
>
> urls--
> from django.conf.urls import patterns
> from klasse.views import portal, kundendaten
> urlpatterns = patterns('',
> (r'^portal/$', portal),
> (r'^kundendaten/$', kundendaten),
> )
> ---
>
> views---
> from django.shortcuts import render_to_response
> from django.core.context_processors import csrf
> from django.views.decorators.csrf import csrf_protect
> import datetime
> import pyodbc
> @csrf_protect
> def portal(request):
> now = datetime.datetime.now()
> return render_to_response('portal.html', {'current_date': now})
> 
>
> portal.html--
> 
> {% csrf_token %}
> 
> Anfrage
> Bitte Kundennamen eingeben
> 
> 
> 
> 
> 
>  href="kundendaten">
> 
> 
> 
>
> I tryed a lot of variants to fix my "post" problem, but without success.
> can anybody help me? ^^
> thx
> *pls ignore my englisch fails
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/iMXtpFVaRp8J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What is the easy way to install DJango?

2012-08-15 Thread Vibhu Rishi
Hi, 

If you are new to Django and are just getting around to learn it, I 
recommend using BitNami Django stack for windows.
http://bitnami.org/stack/djangostack 

So far, it has been the easiest to install on the windows machine.

Vibhu

On Wednesday, 15 August 2012 14:06:33 UTC+5:30, Thato wrote:
>
> Hi guys I want to install Django on my windows computer please help me the 
> easy way to install Django frame work.
>
> Regards
> AbcThato
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/70BcZ0yFvWMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.