Re: ImportError: cannot import name actions

2013-10-16 Thread the . paper . men
Hi, Tom and rok!

I didn't mean to start http server flame war, Apache obviously has it's 
upsides and we also use it. What I've proposed is a simple, albeit dirty, 
workaround to run non-forked Django 1.6 in production.

For Django devs to be able to address the root of the issue and solve it 
properly you will probably need to prepare a sample bare bones Django 
project that has the issue.

On Wednesday, October 16, 2013 7:23:53 PM UTC+4, rok wrote:
>
> Hi, I am not a particular evangelist of one or the other but since we use 
> apache+mod_wsgi for several apps throughout the company, we obviously want 
> to stick with one, easier for deployment and maintenance. 
>
> On Wednesday, October 16, 2013 5:17:35 PM UTC+2, Tom Evans wrote:
>>
>> On Wed, Oct 16, 2013 at 3:20 PM,   wrote: 
>> > Ouch! I should have read your post more carefully! If you don't have 
>> any 
>> > other options than to use Apache, you could run it as proxy to 
>> gunicorn. Or 
>> > you could use Nginx instead of Apache... 
>>
>> What, precisely, is wrong with Apache httpd/mod_wsgi as a hosting 
>> solution? 
>>
>> httpd can be as lean and efficient as nginx in memory usage if you 
>> configure it so, doesn't abandon the httpd ecosystem, and can actually 
>> host wsgi apps itself, rather than requiring yet another webserver in 
>> to the mix. 
>>
>> Especially so, I'd imagine, if that other webserver has, in your words 
>> "some weird import errors which occured only when I was running the 
>> project with `gunicorn_django" 
>>
>> Cheers 
>>
>> Tom 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f7a4398d-bb0d-4351-bf8f-2cf1481078cb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread J. Paskaruk
I followed your directions, and the whole thing went off without a hitch.

ARE YOU A WIZARD?!


On Wed, Oct 16, 2013 at 5:25 PM, Robbie Scourou  wrote:

> Shutting up sir! :)
>
> One last thing to try:
>
> apt-get install python-dev
>
> Do that outside of virtualenv, then try it installing mysql-python within
> the virtualenv. After that, I'm out of ideas.
>
>
> On Wed, Oct 16, 2013 at 8:21 PM, J. Paskaruk  wrote:
>
>>
>> On Wed, Oct 16, 2013 at 1:50 PM, Robbie Scourou wrote:
>>
>>> apt-get install libmysqlclient-dev
>>
>>
>>
>> Sorry, I'm running Linux Mint, very similar to your vaporators in most
>> respects. Can you speak Bochi? Of course I can sir, it's like a second
>> language to me. Ok, shut up, I'll take this one.
>>
>> Sorry. I exited my virtualenv to do that install first, and it did indeed
>> install something new. Let's see... still gives the error. pip install
>> MySQL-Python still doesn't work in the virtualenv either. Sigh.
>>
>> In other news, I'm making great progress with sqlite, so if you wanna
>> keep throwing ideas at me I'll keep trying em, but if I'm getting boring,
>> don't worry bout it none. Like i said, as long as I'm making some kind of
>> progress, I usually find that the stuff I find difficult today magically
>> becomes trivial when I come back to it a few weeks later. :>
>>
>>  --
>> 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/CANabDd%2BG_VCS9aen3sRRGBTH09%2B%3D4kuCxDR-XLq8OUYwrWWpeQ%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/lLyFY5EIjyE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAC2OFVpR_Rprnt3u9ywVkqdQQM2u%2BB4J-jBV8rtKTL22SC8ftQ%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/CANabDdKaks8uj7Fe2X4pPt%3D6QCxKfdGARrjeL87YfCC0y8Srsg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread J. Paskaruk
Heh, just realized I made an out-of-context comment. This problem is
actually solved, but I'm currently also having trouble connecting to MySQL,
and am discussing that in another thread. Forgot which thread I'm in.

The potentially virtualenv-based problem is that python-mysqldb is
installed, but the virtualenv Python can't see it, and I can't install it
with pip. No idea, but I switched to sqlite. :>


On Wed, Oct 16, 2013 at 4:42 PM, Dow Street  wrote:

> And just a reminder that you can certainly use virtualenv without
> virtualenvwrapper.  Every env you create with virtualenv will have a script
> to activate that env located at envname/bin/activate.  For example:
>
> Open your shell, cd to the desired directory, and create a new env:
>
> $ virtualenv testenv
> New python executable in testenv/bin/python
> Installing setuptools.done.
> Installing pip...done.
>
> Activate the env:
>
> $ . testenv/bin/activate
> (testenv)$
>
> Note that the prompt changed and is now pre-pended by the env name.
>
> Deactivate the env:
>
> (testenv)$ deactivate
> $
>
> The prompt changes back - env is deactivated.
>
> R,
> Dow
>
>
> On Oct 16, 2013, at 2:32 PM, Bill Freeman  wrote:
>
> > virtualenv is, indeed, great stuff, and is unlikely to be your problem.
> >
> >
> > On Wed, Oct 16, 2013 at 3:24 PM, J. Paskaruk 
> wrote:
> > I will keep that in mind for sure - I'm always aware that there are
> little subtleties like that all around me, waiting to trip me up, so when
> someone explains one to me, I cleave to the info. I'm pretty paranoid about
> this kind of thing to begin with, which is why I removed it from the one
> when I added it to the other - if it only needs to be there once, then
> having it there twice is just stupidity, unless there is a demonstrable
> reason to do so.
> >
> > I'm kinda suspicious of virtualenv in the first place because of this,
> but the sales pitch by that nice young man, Simeon Whatsisname, convinced
> me that it was a good idea to get a handle on it.
> >
> >
> > On Wed, Oct 16, 2013 at 12:51 PM, Bill Freeman 
> wrote:
> > Not strictly true.  .bashrc will get run again in a sub-shell.  For
> example, in your shell, you run a command, and that command is a shell
> script.  A new shell is started to run that script.  It inherits your
> environment variables.  But it also runs .bashrc.  That's usually not a
> problem, but there are corner cases where it is, so it's worth taking a
> little care in writing a .bashrc file.
> >
> >
> > On Wed, Oct 16, 2013 at 1:40 PM, J. Paskaruk 
> wrote:
> > Ahh k. I took it out of .profile entirely and put it in .bashrc, so it
> should only be run the once. I'm the only significant user of this
> computer. Cheers!
> >
> >
> > On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman 
> wrote:
> > What I mean by "I don't know about sourceing virtualenvwrapper.sh" is
> that I don't know, and don't have the inclination to research, whether,
> having sourced the file in a shell, you should avoid sourcing it again in a
> sub-shell.
> >
> > What I mean by guard variables is that you could, at the end of your
> .bashrc, export a variable that is unlikely to clash with the variables of
> other systems, e.g.;
> >
> > export BASHRC_HAS_ALREADY_BEEN RUN
> >
> > And earlier in the file test the variable to guard against redoing the
> things that should not be redone.
> >
> > if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
> ># Put stuff that shouldn't be done twice here
> > fi
> >
> >
> > On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk 
> wrote:
> > That's the one, thank you so much! I saw in the comments of .profile
> that it would not be read if there was a .bashrc file present, so my next
> step was creating that file and putting those lines in it, but I'm very
> afraid of pooching my install. Noob, like I said. :>
> >
> > I have Aspergers, so I'm not clear on what you meant by "I don't know
> about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
> - I'm assuming, though, that you're referring to a security concern in this
> line, presumably based on the idea that someone could access
> virtualenvwrapper.sh and put malicious code in there.
> >
> > If I've assessed your comment correctly, is there a good, basic tutorial
> on {guard variables}, as well as the larger schema into which they fit?
> Preferably one that *does* assume intelligence, but does *not* assume a lot
> of existing knowledge on the part of the user?
> >
> >
> > Whatever the case, thank you again for the new knowledge about .profile
> and .bashrc. :>
> >
> >
> > On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman 
> wrote:
> > The file you want (assuming that your shell is bash) is .bashrc because
> it is run every time a bash shell is started, even if it is not a login
> shell.
> >
> > Note, 

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Robbie Scourou
Shutting up sir! :)

One last thing to try:

apt-get install python-dev

Do that outside of virtualenv, then try it installing mysql-python within
the virtualenv. After that, I'm out of ideas.


On Wed, Oct 16, 2013 at 8:21 PM, J. Paskaruk  wrote:

>
> On Wed, Oct 16, 2013 at 1:50 PM, Robbie Scourou  wrote:
>
>> apt-get install libmysqlclient-dev
>
>
>
> Sorry, I'm running Linux Mint, very similar to your vaporators in most
> respects. Can you speak Bochi? Of course I can sir, it's like a second
> language to me. Ok, shut up, I'll take this one.
>
> Sorry. I exited my virtualenv to do that install first, and it did indeed
> install something new. Let's see... still gives the error. pip install
> MySQL-Python still doesn't work in the virtualenv either. Sigh.
>
> In other news, I'm making great progress with sqlite, so if you wanna keep
> throwing ideas at me I'll keep trying em, but if I'm getting boring, don't
> worry bout it none. Like i said, as long as I'm making some kind of
> progress, I usually find that the stuff I find difficult today magically
> becomes trivial when I come back to it a few weeks later. :>
>
>  --
> 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/CANabDd%2BG_VCS9aen3sRRGBTH09%2B%3D4kuCxDR-XLq8OUYwrWWpeQ%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/CAC2OFVpR_Rprnt3u9ywVkqdQQM2u%2BB4J-jBV8rtKTL22SC8ftQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Accessing related objects on model.clean()

2013-10-16 Thread Marc Aymerich
Yep,
I'm writing some validation logic for a model that is being used in an
admin inline form

The model looks like this

class Child(models.Model):
 parent = models.ForeignKey(Parent)

 def clean(self):
  super().clean()
  if self.parent.surname != self.surname:
  raise ValidationError

The problem is that on the "Parent add admin view" I get a
Parent.DoesNotExist error when I'm saving new Parent and Childs. That
is because when child.clean() is called child.parent_id is None, so
self.parent fails, it looks like self.parent is created afterwards and
is not available at that time.

How can I validate a new child object based on its parent information?
I'm surprised not finding any information regarding this issue :)



Thanks!

-- 
Marc

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


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Dow Street
And just a reminder that you can certainly use virtualenv without 
virtualenvwrapper.  Every env you create with virtualenv will have a script to 
activate that env located at envname/bin/activate.  For example:  

Open your shell, cd to the desired directory, and create a new env:

$ virtualenv testenv
New python executable in testenv/bin/python
Installing setuptools.done.
Installing pip...done.

Activate the env:

$ . testenv/bin/activate
(testenv)$

Note that the prompt changed and is now pre-pended by the env name.

Deactivate the env:

(testenv)$ deactivate
$ 

The prompt changes back - env is deactivated.

R,
Dow


On Oct 16, 2013, at 2:32 PM, Bill Freeman  wrote:

> virtualenv is, indeed, great stuff, and is unlikely to be your problem.
> 
> 
> On Wed, Oct 16, 2013 at 3:24 PM, J. Paskaruk  wrote:
> I will keep that in mind for sure - I'm always aware that there are little 
> subtleties like that all around me, waiting to trip me up, so when someone 
> explains one to me, I cleave to the info. I'm pretty paranoid about this kind 
> of thing to begin with, which is why I removed it from the one when I added 
> it to the other - if it only needs to be there once, then having it there 
> twice is just stupidity, unless there is a demonstrable reason to do so. 
> 
> I'm kinda suspicious of virtualenv in the first place because of this, but 
> the sales pitch by that nice young man, Simeon Whatsisname, convinced me that 
> it was a good idea to get a handle on it.
> 
> 
> On Wed, Oct 16, 2013 at 12:51 PM, Bill Freeman  wrote:
> Not strictly true.  .bashrc will get run again in a sub-shell.  For example, 
> in your shell, you run a command, and that command is a shell script.  A new 
> shell is started to run that script.  It inherits your environment variables. 
>  But it also runs .bashrc.  That's usually not a problem, but there are 
> corner cases where it is, so it's worth taking a little care in writing a 
> .bashrc file.
> 
> 
> On Wed, Oct 16, 2013 at 1:40 PM, J. Paskaruk  wrote:
> Ahh k. I took it out of .profile entirely and put it in .bashrc, so it should 
> only be run the once. I'm the only significant user of this computer. Cheers!
> 
> 
> On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman  wrote:
> What I mean by "I don't know about sourceing virtualenvwrapper.sh" is that I 
> don't know, and don't have the inclination to research, whether, having 
> sourced the file in a shell, you should avoid sourcing it again in a 
> sub-shell.
> 
> What I mean by guard variables is that you could, at the end of your .bashrc, 
> export a variable that is unlikely to clash with the variables of other 
> systems, e.g.;
> 
> export BASHRC_HAS_ALREADY_BEEN RUN
> 
> And earlier in the file test the variable to guard against redoing the things 
> that should not be redone.
> 
> if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
># Put stuff that shouldn't be done twice here
> fi
> 
> 
> On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk  wrote:
> That's the one, thank you so much! I saw in the comments of .profile that it 
> would not be read if there was a .bashrc file present, so my next step was 
> creating that file and putting those lines in it, but I'm very afraid of 
> pooching my install. Noob, like I said. :>
> 
> I have Aspergers, so I'm not clear on what you meant by "I don't know about 
> sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)" - I'm 
> assuming, though, that you're referring to a security concern in this line, 
> presumably based on the idea that someone could access virtualenvwrapper.sh 
> and put malicious code in there.
> 
> If I've assessed your comment correctly, is there a good, basic tutorial on 
> {guard variables}, as well as the larger schema into which they fit? 
> Preferably one that *does* assume intelligence, but does *not* assume a lot 
> of existing knowledge on the part of the user?
> 
> 
> Whatever the case, thank you again for the new knowledge about .profile and 
> .bashrc. :>
> 
> 
> On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman  wrote:
> The file you want (assuming that your shell is bash) is .bashrc because it is 
> run every time a bash shell is started, even if it is not a login shell.
> 
> Note, however, that settings that shouldn't be done multiple times, such as 
> appending ":$HOME/bin" to the PATH, should be protected with an if so they 
> only happen once, no matter how many sub-shells you start (such as by running 
> something in parentheses), so that PATH doesn't grow without bound.  The 
> WORKON_HOME and PROJECT_HOME settings don't suffer from this problem because 
> it doesn't hurt to set them again to the same value.  I don't know about 
> sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)
> 
> For some of this stuff it may also be possible 

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
virtualenv is, indeed, great stuff, and is unlikely to be your problem.


On Wed, Oct 16, 2013 at 3:24 PM, J. Paskaruk  wrote:

> I will keep that in mind for sure - I'm always aware that there are little
> subtleties like that all around me, waiting to trip me up, so when someone
> explains one to me, I cleave to the info. I'm pretty paranoid about this
> kind of thing to begin with, which is why I removed it from the one when I
> added it to the other - if it only needs to be there once, then having it
> there twice is just stupidity, unless there is a demonstrable reason to do
> so.
>
> I'm kinda suspicious of virtualenv in the first place because of this, but
> the sales pitch by that nice young man, Simeon Whatsisname, convinced me
> that it was a good idea to get a handle on it.
>
>
> On Wed, Oct 16, 2013 at 12:51 PM, Bill Freeman  wrote:
>
>> Not strictly true.  .bashrc will get run again in a sub-shell.  For
>> example, in your shell, you run a command, and that command is a shell
>> script.  A new shell is started to run that script.  It inherits your
>> environment variables.  But it also runs .bashrc.  That's usually not a
>> problem, but there are corner cases where it is, so it's worth taking a
>> little care in writing a .bashrc file.
>>
>>
>> On Wed, Oct 16, 2013 at 1:40 PM, J. Paskaruk  wrote:
>>
>>> Ahh k. I took it out of .profile entirely and put it in .bashrc, so it
>>> should only be run the once. I'm the only significant user of this
>>> computer. Cheers!
>>>
>>>
>>> On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman wrote:
>>>
  What I mean by "I don't know about sourceing virtualenvwrapper.sh" is
 that I don't know, and don't have the inclination to research, whether,
 having sourced the file in a shell, you should avoid sourcing it again in a
 sub-shell.

 What I mean by guard variables is that you could, at the end of your
 .bashrc, export a variable that is unlikely to clash with the variables of
 other systems, e.g.;

 export BASHRC_HAS_ALREADY_BEEN RUN

 And earlier in the file test the variable to guard against redoing the
 things that should not be redone.

 if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
# Put stuff that shouldn't be done twice here
 fi


 On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk wrote:

> That's the one, thank you so much! I saw in the comments of .profile
> that it would not be read if there was a .bashrc file present, so my next
> step was creating that file and putting those lines in it, but I'm very
> afraid of pooching my install. Noob, like I said. :>
>
> I have Aspergers, so I'm not clear on what you meant by "I don't know
> about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
> - I'm assuming, though, that you're referring to a security concern in 
> this
> line, presumably based on the idea that someone could access
> virtualenvwrapper.sh and put malicious code in there.
>
> If I've assessed your comment correctly, is there a good, basic
> tutorial on {guard variables}, as well as the larger schema into which 
> they
> fit? Preferably one that *does* assume intelligence, but does *not* assume
> a lot of existing knowledge on the part of the user?
>
>
> Whatever the case, thank you again for the new knowledge about
> .profile and .bashrc. :>
>
>
> On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman wrote:
>
>> The file you want (assuming that your shell is bash) is .bashrc
>> because it is run every time a bash shell is started, even if it is not a
>> login shell.
>>
>> Note, however, that settings that shouldn't be done multiple times,
>> such as appending ":$HOME/bin" to the PATH, should be protected with an 
>> if
>> so they only happen once, no matter how many sub-shells you start (such 
>> as
>> by running something in parentheses), so that PATH doesn't grow without
>> bound.  The WORKON_HOME and PROJECT_HOME settings don't suffer from this
>> problem because it doesn't hurt to set them again to the same value.  I
>> don't know about sourceing virtualenvwrapper.sh.  (Guard variables are 
>> your
>> friend.)
>>
>> For some of this stuff it may also be possible to set the environment
>> of the X session, making it available in the environment of shells that 
>> are
>> started by the window manager, but you'll have to do your own research on
>> that.
>>
>>
>>
>> On Wed, Oct 16, 2013 at 11:54 AM, Jimmy Pants wrote:
>>
>>> Does gnome-terminal make sense to you in this context? I popped up
>>> "edit" on the terminal launcher and that's in the Application field. I
>>> would, 

Re: DJANGO and SOAP

2013-10-16 Thread Mario Gudelj
Go with suds from fedora. I found it easy to use and it's worked with every
soap api I connect to.
On 17/10/2013 1:18 AM, "Domagoj Kovač"  wrote:

> I actually need a client library, not server library.
>
> --
> 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/bc47576e-b505-4e42-8ccc-b8f3d43b2f94%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/CAHqTbjkyJ2M4fG5trFuUqN1s2z2nHFDMzZeZtTkEvzYp7MHCoA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread J. Paskaruk
I will keep that in mind for sure - I'm always aware that there are little
subtleties like that all around me, waiting to trip me up, so when someone
explains one to me, I cleave to the info. I'm pretty paranoid about this
kind of thing to begin with, which is why I removed it from the one when I
added it to the other - if it only needs to be there once, then having it
there twice is just stupidity, unless there is a demonstrable reason to do
so.

I'm kinda suspicious of virtualenv in the first place because of this, but
the sales pitch by that nice young man, Simeon Whatsisname, convinced me
that it was a good idea to get a handle on it.


On Wed, Oct 16, 2013 at 12:51 PM, Bill Freeman  wrote:

> Not strictly true.  .bashrc will get run again in a sub-shell.  For
> example, in your shell, you run a command, and that command is a shell
> script.  A new shell is started to run that script.  It inherits your
> environment variables.  But it also runs .bashrc.  That's usually not a
> problem, but there are corner cases where it is, so it's worth taking a
> little care in writing a .bashrc file.
>
>
> On Wed, Oct 16, 2013 at 1:40 PM, J. Paskaruk  wrote:
>
>> Ahh k. I took it out of .profile entirely and put it in .bashrc, so it
>> should only be run the once. I'm the only significant user of this
>> computer. Cheers!
>>
>>
>> On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman  wrote:
>>
>>>  What I mean by "I don't know about sourceing virtualenvwrapper.sh" is
>>> that I don't know, and don't have the inclination to research, whether,
>>> having sourced the file in a shell, you should avoid sourcing it again in a
>>> sub-shell.
>>>
>>> What I mean by guard variables is that you could, at the end of your
>>> .bashrc, export a variable that is unlikely to clash with the variables of
>>> other systems, e.g.;
>>>
>>> export BASHRC_HAS_ALREADY_BEEN RUN
>>>
>>> And earlier in the file test the variable to guard against redoing the
>>> things that should not be redone.
>>>
>>> if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
>>># Put stuff that shouldn't be done twice here
>>> fi
>>>
>>>
>>> On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk wrote:
>>>
 That's the one, thank you so much! I saw in the comments of .profile
 that it would not be read if there was a .bashrc file present, so my next
 step was creating that file and putting those lines in it, but I'm very
 afraid of pooching my install. Noob, like I said. :>

 I have Aspergers, so I'm not clear on what you meant by "I don't know
 about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
 - I'm assuming, though, that you're referring to a security concern in this
 line, presumably based on the idea that someone could access
 virtualenvwrapper.sh and put malicious code in there.

 If I've assessed your comment correctly, is there a good, basic
 tutorial on {guard variables}, as well as the larger schema into which they
 fit? Preferably one that *does* assume intelligence, but does *not* assume
 a lot of existing knowledge on the part of the user?


 Whatever the case, thank you again for the new knowledge about .profile
 and .bashrc. :>


 On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman wrote:

> The file you want (assuming that your shell is bash) is .bashrc
> because it is run every time a bash shell is started, even if it is not a
> login shell.
>
> Note, however, that settings that shouldn't be done multiple times,
> such as appending ":$HOME/bin" to the PATH, should be protected with an if
> so they only happen once, no matter how many sub-shells you start (such as
> by running something in parentheses), so that PATH doesn't grow without
> bound.  The WORKON_HOME and PROJECT_HOME settings don't suffer from this
> problem because it doesn't hurt to set them again to the same value.  I
> don't know about sourceing virtualenvwrapper.sh.  (Guard variables are 
> your
> friend.)
>
> For some of this stuff it may also be possible to set the environment
> of the X session, making it available in the environment of shells that 
> are
> started by the window manager, but you'll have to do your own research on
> that.
>
>
>
> On Wed, Oct 16, 2013 at 11:54 AM, Jimmy Pants wrote:
>
>> Does gnome-terminal make sense to you in this context? I popped up
>> "edit" on the terminal launcher and that's in the Application field. I
>> would, theoretically, add whatever option for gnome-terminal specifies it
>> as a login shell?
>>
>> Testing this, I added --login to the field, per 
>> thispage, 
>> but it didn't ask for a login, nor did it run 

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread J. Paskaruk
On Wed, Oct 16, 2013 at 1:50 PM, Robbie Scourou  wrote:

> apt-get install libmysqlclient-dev



Sorry, I'm running Linux Mint, very similar to your vaporators in most
respects. Can you speak Bochi? Of course I can sir, it's like a second
language to me. Ok, shut up, I'll take this one.

Sorry. I exited my virtualenv to do that install first, and it did indeed
install something new. Let's see... still gives the error. pip install
MySQL-Python still doesn't work in the virtualenv either. Sigh.

In other news, I'm making great progress with sqlite, so if you wanna keep
throwing ideas at me I'll keep trying em, but if I'm getting boring, don't
worry bout it none. Like i said, as long as I'm making some kind of
progress, I usually find that the stuff I find difficult today magically
becomes trivial when I come back to it a few weeks later. :>

-- 
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/CANabDd%2BG_VCS9aen3sRRGBTH09%2B%3D4kuCxDR-XLq8OUYwrWWpeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Robbie Scourou
Assuming you are using ubuntu/debian:

apt-get install libmysqlclient-dev

Should give you the mysql_config tool. I *think*. I ran into similar build
problems when rebuilding a server recently. I think you'll also need the
python-dev package too.

Frustration with computers is normal, just stick at it. :)

Cheers

Robbie



On Wed, Oct 16, 2013 at 7:34 PM, J. Paskaruk  wrote:

> Yah, nothing under mysql- with dev or devel. I'm getting a sort-of handle
> on the differences between Pip, Apt, etc, but it's all very confusing. I
> seem to have sqlite working, so I'm not worrying about this too much for
> the moment. I'm assuming that a few months from now I'll laugh at how much
> I'm struggling with this at the moment. :>
>
>
> On Wed, Oct 16, 2013 at 1:01 PM, Bill Freeman  wrote:
>
>> No, python-mysqldb-dbg is not related to the problem.  ("dbg" is an
>> abbreviation for debug, while "devel" or "dev" stands for I want to do
>> software development to work with the main package" such as building the
>> python connectory, the operation that got you your error message.
>>
>> When you pip install python-msqldb, that only installs the python
>> connector for MySQL (and if you do it with synaptic, probably only for the
>> system python).  You also have to install MySQL itself (with no "python-"
>> in front of it), and it is that package that might have a -dev version.
>> You install MySQL and possibley MySQL-dev (or however they're spelled, I
>> don't have a debian based system handy to check) using synaptic (or apt or
>> dselectd or yum or rpm).  Then you do whatever you were doing (a pip
>> install of something?) that got the original error, because it was trying
>> to install MySQL-python (in your virtualenv, I presume).
>>
>> My rule of thumb is to never install with synaptic (etc.) that which you
>> can install with pip, but there are a bunch of things that you can't
>> install with pip, such as MySQL itself.
>>
>>
>> On Wed, Oct 16, 2013 at 1:45 PM, J. Paskaruk  wrote:
>>
>>> I found a python-mysqldb-dbg in Synaptic, would that be it? Failing
>>> that, what would be the, umm, Pythonic way to reinstall MySQL?
>>>
>>> I'm also confused by the various names - in Synaptic I've got
>>> python-mysqldb installed, but there's also MySQL-Python, which I can't tell
>>> if that's the same package or something entirely different... I'm drowning
>>> in new software and concepts at the moment. Argh.
>>>
>>>
>>> On Wed, Oct 16, 2013 at 11:49 AM, Bill Freeman wrote:
>>>
 If it's like PostgreSQL, it should have been installed somewhere when
 you installed MySQL.  But if you installed it using an O/S package manager,
 rather than from source, the O/S vender may have "helpfully" excluded bits
 they don't think you need.  Often this will require additionally installing
 a "-devel" (RPM based systems) or "-dev" (deb based systems) of the MySQL
 package.


 On Wed, Oct 16, 2013 at 12:32 PM, J. Paskaruk wrote:

> I ran:
>
> sudo find / -name 'mysql_config'
>
> and it didn't find it. Using the same search, I did find something
> from my home dir, so it seems that it's not actually installed, or 
> rather..
> argh. I've attempted every "this is how to install MySQL-python method I
> could find on the web, and it either fails to install or says it's already
> installed, but the damn server can't see it.
>
> I've switched it to a sqlite database for now, but this is pissing me
> off...
>
>
> On Wed, Oct 16, 2013 at 11:22 AM, Bill Freeman wrote:
>
>> If the program mysql_config is installed on your box, it may be
>> installed in a directory that is not on your path.  If you can find it on
>> your box (try the locate and find commands), you can add the directory to
>> your PATH by hand before running pip (or easy_install).  It only needs to
>> be there for the runnings of pip that instiall or update MySQL-python so
>> you don't need to add the directory permanently.  (An alternative is a
>> symbolic link to it in some directory that is on your path, such as maybe
>> /usr/local/bin - though this is slightly less certain to work, depending 
>> on
>> how clever mysql_config is - I don't use MySQL, so I don't know for 
>> sure.)
>>
>>
>> On Wed, Oct 16, 2013 at 12:10 PM, Jimmy Pants wrote:
>>
>>> I'm trying to do the "Writing Your first Django App" tutorial, and
>>> Django can't see MySQL-python, though it is installed globally.
>>>
>>> I'm not sure if this is a virtualenv problem or what.
>>>
>>>
>>>
>>> Outside of virtualenv:
>>>
>>> jimmy@lilly ~/mysite $ sudo pip install MySQL-python
>>> [sudo] password for jimmy:
>>> Requirement already satisfied (use --upgrade to upgrade):
>>> 

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread J. Paskaruk
Yah, nothing under mysql- with dev or devel. I'm getting a sort-of handle
on the differences between Pip, Apt, etc, but it's all very confusing. I
seem to have sqlite working, so I'm not worrying about this too much for
the moment. I'm assuming that a few months from now I'll laugh at how much
I'm struggling with this at the moment. :>


On Wed, Oct 16, 2013 at 1:01 PM, Bill Freeman  wrote:

> No, python-mysqldb-dbg is not related to the problem.  ("dbg" is an
> abbreviation for debug, while "devel" or "dev" stands for I want to do
> software development to work with the main package" such as building the
> python connectory, the operation that got you your error message.
>
> When you pip install python-msqldb, that only installs the python
> connector for MySQL (and if you do it with synaptic, probably only for the
> system python).  You also have to install MySQL itself (with no "python-"
> in front of it), and it is that package that might have a -dev version.
> You install MySQL and possibley MySQL-dev (or however they're spelled, I
> don't have a debian based system handy to check) using synaptic (or apt or
> dselectd or yum or rpm).  Then you do whatever you were doing (a pip
> install of something?) that got the original error, because it was trying
> to install MySQL-python (in your virtualenv, I presume).
>
> My rule of thumb is to never install with synaptic (etc.) that which you
> can install with pip, but there are a bunch of things that you can't
> install with pip, such as MySQL itself.
>
>
> On Wed, Oct 16, 2013 at 1:45 PM, J. Paskaruk  wrote:
>
>> I found a python-mysqldb-dbg in Synaptic, would that be it? Failing that,
>> what would be the, umm, Pythonic way to reinstall MySQL?
>>
>> I'm also confused by the various names - in Synaptic I've got
>> python-mysqldb installed, but there's also MySQL-Python, which I can't tell
>> if that's the same package or something entirely different... I'm drowning
>> in new software and concepts at the moment. Argh.
>>
>>
>> On Wed, Oct 16, 2013 at 11:49 AM, Bill Freeman  wrote:
>>
>>> If it's like PostgreSQL, it should have been installed somewhere when
>>> you installed MySQL.  But if you installed it using an O/S package manager,
>>> rather than from source, the O/S vender may have "helpfully" excluded bits
>>> they don't think you need.  Often this will require additionally installing
>>> a "-devel" (RPM based systems) or "-dev" (deb based systems) of the MySQL
>>> package.
>>>
>>>
>>> On Wed, Oct 16, 2013 at 12:32 PM, J. Paskaruk wrote:
>>>
 I ran:

 sudo find / -name 'mysql_config'

 and it didn't find it. Using the same search, I did find something from
 my home dir, so it seems that it's not actually installed, or rather..
 argh. I've attempted every "this is how to install MySQL-python method I
 could find on the web, and it either fails to install or says it's already
 installed, but the damn server can't see it.

 I've switched it to a sqlite database for now, but this is pissing me
 off...


 On Wed, Oct 16, 2013 at 11:22 AM, Bill Freeman wrote:

> If the program mysql_config is installed on your box, it may be
> installed in a directory that is not on your path.  If you can find it on
> your box (try the locate and find commands), you can add the directory to
> your PATH by hand before running pip (or easy_install).  It only needs to
> be there for the runnings of pip that instiall or update MySQL-python so
> you don't need to add the directory permanently.  (An alternative is a
> symbolic link to it in some directory that is on your path, such as maybe
> /usr/local/bin - though this is slightly less certain to work, depending 
> on
> how clever mysql_config is - I don't use MySQL, so I don't know for sure.)
>
>
> On Wed, Oct 16, 2013 at 12:10 PM, Jimmy Pants wrote:
>
>> I'm trying to do the "Writing Your first Django App" tutorial, and
>> Django can't see MySQL-python, though it is installed globally.
>>
>> I'm not sure if this is a virtualenv problem or what.
>>
>>
>>
>> Outside of virtualenv:
>>
>> jimmy@lilly ~/mysite $ sudo pip install MySQL-python
>> [sudo] password for jimmy:
>> Requirement already satisfied (use --upgrade to upgrade):
>> MySQL-python in /usr/lib/python2.7/dist-packages
>> Cleaning up...
>>
>> *In* my Django virtualenv:
>>
>> (DJANGO)jimmy@lilly ~/mysite $ pip install MySQL-python
>> Downloading/unpacking MySQL-python
>>   Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
>>   Running setup.py egg_info for package MySQL-python
>> Downloading
>> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
>> Extracting in /tmp/tmpLPLYIS
>> Now 

MySQL error when trying to run tests with utf8mb4 charset

2013-10-16 Thread fletch
Hello!

I tried to run *./manage.py test *for the first time and I got the 
following error:

*DatabaseError: (1071, 'Specified key was too long; max key length is 767 
bytes')*

Looking at the log in MySQL, it appears to be caused by this statement:

CREATE TABLE `auth_customuser` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`password` varchar(128) NOT NULL,
`last_login` datetime NOT NULL,
`email` varchar(255) NOT NULL UNIQUE,
`is_active` bool NOT NULL,
`is_admin` bool NOT NULL,
`date_of_birth` date NOT NULL
)


So the email field of varchar(255) is causing me to go over the 
single-column index of 767 bytes in InnoDB when the charset is utf8mb4, 
that part I understand.

Why is it trying to create this *auth_customuser* table anyways though? It 
doesn't exist in my application normally. The *email* field on my *auth_user
* table is varchar(75) so no error from that, not sure why it's a different 
length there though.

To get around the issue temporarily I set the database engine to sqlite, 
but I'd like to be able to use MySQL for the tests, since that's what my 
application normally uses.

Thanks in advance!

-- 
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/23d63241-40b6-4244-91c4-7f3e5495baba%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Bill Freeman
No, python-mysqldb-dbg is not related to the problem.  ("dbg" is an
abbreviation for debug, while "devel" or "dev" stands for I want to do
software development to work with the main package" such as building the
python connectory, the operation that got you your error message.

When you pip install python-msqldb, that only installs the python connector
for MySQL (and if you do it with synaptic, probably only for the system
python).  You also have to install MySQL itself (with no "python-" in front
of it), and it is that package that might have a -dev version.  You install
MySQL and possibley MySQL-dev (or however they're spelled, I don't have a
debian based system handy to check) using synaptic (or apt or dselectd or
yum or rpm).  Then you do whatever you were doing (a pip install of
something?) that got the original error, because it was trying to install
MySQL-python (in your virtualenv, I presume).

My rule of thumb is to never install with synaptic (etc.) that which you
can install with pip, but there are a bunch of things that you can't
install with pip, such as MySQL itself.


On Wed, Oct 16, 2013 at 1:45 PM, J. Paskaruk  wrote:

> I found a python-mysqldb-dbg in Synaptic, would that be it? Failing that,
> what would be the, umm, Pythonic way to reinstall MySQL?
>
> I'm also confused by the various names - in Synaptic I've got
> python-mysqldb installed, but there's also MySQL-Python, which I can't tell
> if that's the same package or something entirely different... I'm drowning
> in new software and concepts at the moment. Argh.
>
>
> On Wed, Oct 16, 2013 at 11:49 AM, Bill Freeman  wrote:
>
>> If it's like PostgreSQL, it should have been installed somewhere when you
>> installed MySQL.  But if you installed it using an O/S package manager,
>> rather than from source, the O/S vender may have "helpfully" excluded bits
>> they don't think you need.  Often this will require additionally installing
>> a "-devel" (RPM based systems) or "-dev" (deb based systems) of the MySQL
>> package.
>>
>>
>> On Wed, Oct 16, 2013 at 12:32 PM, J. Paskaruk wrote:
>>
>>> I ran:
>>>
>>> sudo find / -name 'mysql_config'
>>>
>>> and it didn't find it. Using the same search, I did find something from
>>> my home dir, so it seems that it's not actually installed, or rather..
>>> argh. I've attempted every "this is how to install MySQL-python method I
>>> could find on the web, and it either fails to install or says it's already
>>> installed, but the damn server can't see it.
>>>
>>> I've switched it to a sqlite database for now, but this is pissing me
>>> off...
>>>
>>>
>>> On Wed, Oct 16, 2013 at 11:22 AM, Bill Freeman wrote:
>>>
 If the program mysql_config is installed on your box, it may be
 installed in a directory that is not on your path.  If you can find it on
 your box (try the locate and find commands), you can add the directory to
 your PATH by hand before running pip (or easy_install).  It only needs to
 be there for the runnings of pip that instiall or update MySQL-python so
 you don't need to add the directory permanently.  (An alternative is a
 symbolic link to it in some directory that is on your path, such as maybe
 /usr/local/bin - though this is slightly less certain to work, depending on
 how clever mysql_config is - I don't use MySQL, so I don't know for sure.)


 On Wed, Oct 16, 2013 at 12:10 PM, Jimmy Pants wrote:

> I'm trying to do the "Writing Your first Django App" tutorial, and
> Django can't see MySQL-python, though it is installed globally.
>
> I'm not sure if this is a virtualenv problem or what.
>
>
>
> Outside of virtualenv:
>
> jimmy@lilly ~/mysite $ sudo pip install MySQL-python
> [sudo] password for jimmy:
> Requirement already satisfied (use --upgrade to upgrade): MySQL-python
> in /usr/lib/python2.7/dist-packages
> Cleaning up...
>
> *In* my Django virtualenv:
>
> (DJANGO)jimmy@lilly ~/mysite $ pip install MySQL-python
> Downloading/unpacking MySQL-python
>   Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
>   Running setup.py egg_info for package MySQL-python
> Downloading
> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
> Extracting in /tmp/tmpLPLYIS
> Now working in /tmp/tmpLPLYIS/distribute-0.6.28
> Building a Distribute egg in
> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>
> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
> sh: 1: mysql_config: not found
> Traceback (most recent call last):
>   File "", line 16, in 
>   File
> "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py", line 18, in
> 
> metadata, options = get_config()
>   File "setup_posix.py", 

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
Not strictly true.  .bashrc will get run again in a sub-shell.  For
example, in your shell, you run a command, and that command is a shell
script.  A new shell is started to run that script.  It inherits your
environment variables.  But it also runs .bashrc.  That's usually not a
problem, but there are corner cases where it is, so it's worth taking a
little care in writing a .bashrc file.


On Wed, Oct 16, 2013 at 1:40 PM, J. Paskaruk  wrote:

> Ahh k. I took it out of .profile entirely and put it in .bashrc, so it
> should only be run the once. I'm the only significant user of this
> computer. Cheers!
>
>
> On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman  wrote:
>
>> What I mean by "I don't know about sourceing virtualenvwrapper.sh" is
>> that I don't know, and don't have the inclination to research, whether,
>> having sourced the file in a shell, you should avoid sourcing it again in a
>> sub-shell.
>>
>> What I mean by guard variables is that you could, at the end of your
>> .bashrc, export a variable that is unlikely to clash with the variables of
>> other systems, e.g.;
>>
>> export BASHRC_HAS_ALREADY_BEEN RUN
>>
>> And earlier in the file test the variable to guard against redoing the
>> things that should not be redone.
>>
>> if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
>># Put stuff that shouldn't be done twice here
>> fi
>>
>>
>> On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk wrote:
>>
>>> That's the one, thank you so much! I saw in the comments of .profile
>>> that it would not be read if there was a .bashrc file present, so my next
>>> step was creating that file and putting those lines in it, but I'm very
>>> afraid of pooching my install. Noob, like I said. :>
>>>
>>> I have Aspergers, so I'm not clear on what you meant by "I don't know
>>> about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
>>> - I'm assuming, though, that you're referring to a security concern in this
>>> line, presumably based on the idea that someone could access
>>> virtualenvwrapper.sh and put malicious code in there.
>>>
>>> If I've assessed your comment correctly, is there a good, basic tutorial
>>> on {guard variables}, as well as the larger schema into which they fit?
>>> Preferably one that *does* assume intelligence, but does *not* assume a lot
>>> of existing knowledge on the part of the user?
>>>
>>>
>>> Whatever the case, thank you again for the new knowledge about .profile
>>> and .bashrc. :>
>>>
>>>
>>> On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman wrote:
>>>
 The file you want (assuming that your shell is bash) is .bashrc because
 it is run every time a bash shell is started, even if it is not a login
 shell.

 Note, however, that settings that shouldn't be done multiple times,
 such as appending ":$HOME/bin" to the PATH, should be protected with an if
 so they only happen once, no matter how many sub-shells you start (such as
 by running something in parentheses), so that PATH doesn't grow without
 bound.  The WORKON_HOME and PROJECT_HOME settings don't suffer from this
 problem because it doesn't hurt to set them again to the same value.  I
 don't know about sourceing virtualenvwrapper.sh.  (Guard variables are your
 friend.)

 For some of this stuff it may also be possible to set the environment
 of the X session, making it available in the environment of shells that are
 started by the window manager, but you'll have to do your own research on
 that.



 On Wed, Oct 16, 2013 at 11:54 AM, Jimmy Pants wrote:

> Does gnome-terminal make sense to you in this context? I popped up
> "edit" on the terminal launcher and that's in the Application field. I
> would, theoretically, add whatever option for gnome-terminal specifies it
> as a login shell?
>
> Testing this, I added --login to the field, per 
> thispage, but 
> it didn't ask for a login, nor did it run .profile.
>
> Not sure if I'm barking up the proper tree here, natch.
>
>
> On Wednesday, October 16, 2013 10:37:03 AM UTC-5, Thomas wrote:
>>
>>  On 10/16/13 8:29 AM, Jimmy Pants wrote:
>>
>> ...every time I open a terminal, that is. As I understand it,
>> .profile is the file to edit in Linux Mint, and it does exist, with some
>> basic code in it, in my home dir. So, per this 
>> tutorial,
>> I added the following to .profile:
>>
>> Your terminal is being opened without specifying it as a "login
>> shell". Not sure which terminal program you are using so you will need to
>> check on options; for xterm it is the -ls option.
>>
>> hth
>>
>>   - Tom
>>
>  

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread J. Paskaruk
I found a python-mysqldb-dbg in Synaptic, would that be it? Failing that,
what would be the, umm, Pythonic way to reinstall MySQL?

I'm also confused by the various names - in Synaptic I've got
python-mysqldb installed, but there's also MySQL-Python, which I can't tell
if that's the same package or something entirely different... I'm drowning
in new software and concepts at the moment. Argh.


On Wed, Oct 16, 2013 at 11:49 AM, Bill Freeman  wrote:

> If it's like PostgreSQL, it should have been installed somewhere when you
> installed MySQL.  But if you installed it using an O/S package manager,
> rather than from source, the O/S vender may have "helpfully" excluded bits
> they don't think you need.  Often this will require additionally installing
> a "-devel" (RPM based systems) or "-dev" (deb based systems) of the MySQL
> package.
>
>
> On Wed, Oct 16, 2013 at 12:32 PM, J. Paskaruk  wrote:
>
>> I ran:
>>
>> sudo find / -name 'mysql_config'
>>
>> and it didn't find it. Using the same search, I did find something from
>> my home dir, so it seems that it's not actually installed, or rather..
>> argh. I've attempted every "this is how to install MySQL-python method I
>> could find on the web, and it either fails to install or says it's already
>> installed, but the damn server can't see it.
>>
>> I've switched it to a sqlite database for now, but this is pissing me
>> off...
>>
>>
>> On Wed, Oct 16, 2013 at 11:22 AM, Bill Freeman  wrote:
>>
>>> If the program mysql_config is installed on your box, it may be
>>> installed in a directory that is not on your path.  If you can find it on
>>> your box (try the locate and find commands), you can add the directory to
>>> your PATH by hand before running pip (or easy_install).  It only needs to
>>> be there for the runnings of pip that instiall or update MySQL-python so
>>> you don't need to add the directory permanently.  (An alternative is a
>>> symbolic link to it in some directory that is on your path, such as maybe
>>> /usr/local/bin - though this is slightly less certain to work, depending on
>>> how clever mysql_config is - I don't use MySQL, so I don't know for sure.)
>>>
>>>
>>> On Wed, Oct 16, 2013 at 12:10 PM, Jimmy Pants wrote:
>>>
 I'm trying to do the "Writing Your first Django App" tutorial, and
 Django can't see MySQL-python, though it is installed globally.

 I'm not sure if this is a virtualenv problem or what.



 Outside of virtualenv:

 jimmy@lilly ~/mysite $ sudo pip install MySQL-python
 [sudo] password for jimmy:
 Requirement already satisfied (use --upgrade to upgrade): MySQL-python
 in /usr/lib/python2.7/dist-packages
 Cleaning up...

 *In* my Django virtualenv:

 (DJANGO)jimmy@lilly ~/mysite $ pip install MySQL-python
 Downloading/unpacking MySQL-python
   Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
   Running setup.py egg_info for package MySQL-python
 Downloading
 http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
 Extracting in /tmp/tmpLPLYIS
 Now working in /tmp/tmpLPLYIS/distribute-0.6.28
 Building a Distribute egg in
 /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python

 /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
 sh: 1: mysql_config: not found
 Traceback (most recent call last):
   File "", line 16, in 
   File
 "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py", line 18, in
 
 metadata, options = get_config()
   File "setup_posix.py", line 43, in get_config
 libs = mysql_config("libs_r")
   File "setup_posix.py", line 25, in mysql_config
 raise EnvironmentError("%s not found" % (mysql_config.path,))
 EnvironmentError: mysql_config not found
 Complete output from command python setup.py egg_info:
 Downloading
 http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz

 Extracting in /tmp/tmpLPLYIS

 Now working in /tmp/tmpLPLYIS/distribute-0.6.28

 Building a Distribute egg in
 /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python


 /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg

 sh: 1: mysql_config: not found

 Traceback (most recent call last):

   File "", line 16, in 

   File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py",
 line 18, in 

 metadata, options = get_config()

   File "setup_posix.py", line 43, in get_config

 libs = mysql_config("libs_r")

   File "setup_posix.py", line 25, in mysql_config

 raise EnvironmentError("%s not found" % (mysql_config.path,))

 EnvironmentError: mysql_config not found

 

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread J. Paskaruk
Ahh k. I took it out of .profile entirely and put it in .bashrc, so it
should only be run the once. I'm the only significant user of this
computer. Cheers!


On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman  wrote:

> What I mean by "I don't know about sourceing virtualenvwrapper.sh" is that
> I don't know, and don't have the inclination to research, whether, having
> sourced the file in a shell, you should avoid sourcing it again in a
> sub-shell.
>
> What I mean by guard variables is that you could, at the end of your
> .bashrc, export a variable that is unlikely to clash with the variables of
> other systems, e.g.;
>
> export BASHRC_HAS_ALREADY_BEEN RUN
>
> And earlier in the file test the variable to guard against redoing the
> things that should not be redone.
>
> if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
># Put stuff that shouldn't be done twice here
> fi
>
>
> On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk  wrote:
>
>> That's the one, thank you so much! I saw in the comments of .profile that
>> it would not be read if there was a .bashrc file present, so my next step
>> was creating that file and putting those lines in it, but I'm very afraid
>> of pooching my install. Noob, like I said. :>
>>
>> I have Aspergers, so I'm not clear on what you meant by "I don't know
>> about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
>> - I'm assuming, though, that you're referring to a security concern in this
>> line, presumably based on the idea that someone could access
>> virtualenvwrapper.sh and put malicious code in there.
>>
>> If I've assessed your comment correctly, is there a good, basic tutorial
>> on {guard variables}, as well as the larger schema into which they fit?
>> Preferably one that *does* assume intelligence, but does *not* assume a lot
>> of existing knowledge on the part of the user?
>>
>>
>> Whatever the case, thank you again for the new knowledge about .profile
>> and .bashrc. :>
>>
>>
>> On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman  wrote:
>>
>>> The file you want (assuming that your shell is bash) is .bashrc because
>>> it is run every time a bash shell is started, even if it is not a login
>>> shell.
>>>
>>> Note, however, that settings that shouldn't be done multiple times, such
>>> as appending ":$HOME/bin" to the PATH, should be protected with an if so
>>> they only happen once, no matter how many sub-shells you start (such as by
>>> running something in parentheses), so that PATH doesn't grow without
>>> bound.  The WORKON_HOME and PROJECT_HOME settings don't suffer from this
>>> problem because it doesn't hurt to set them again to the same value.  I
>>> don't know about sourceing virtualenvwrapper.sh.  (Guard variables are your
>>> friend.)
>>>
>>> For some of this stuff it may also be possible to set the environment of
>>> the X session, making it available in the environment of shells that are
>>> started by the window manager, but you'll have to do your own research on
>>> that.
>>>
>>>
>>>
>>> On Wed, Oct 16, 2013 at 11:54 AM, Jimmy Pants wrote:
>>>
 Does gnome-terminal make sense to you in this context? I popped up
 "edit" on the terminal launcher and that's in the Application field. I
 would, theoretically, add whatever option for gnome-terminal specifies it
 as a login shell?

 Testing this, I added --login to the field, per 
 thispage, but 
 it didn't ask for a login, nor did it run .profile.

 Not sure if I'm barking up the proper tree here, natch.


 On Wednesday, October 16, 2013 10:37:03 AM UTC-5, Thomas wrote:
>
>  On 10/16/13 8:29 AM, Jimmy Pants wrote:
>
> ...every time I open a terminal, that is. As I understand it, .profile
> is the file to edit in Linux Mint, and it does exist, with some basic code
> in it, in my home dir. So, per this 
> tutorial,
> I added the following to .profile:
>
> Your terminal is being opened without specifying it as a "login
> shell". Not sure which terminal program you are using so you will need to
> check on options; for xterm it is the -ls option.
>
> hth
>
>   - Tom
>
  --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.

 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/e3e173c4-56a5-4d16-a449-6da333fbb74e%40googlegroups.com
 .

 For more 

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Bill Freeman
If it's like PostgreSQL, it should have been installed somewhere when you
installed MySQL.  But if you installed it using an O/S package manager,
rather than from source, the O/S vender may have "helpfully" excluded bits
they don't think you need.  Often this will require additionally installing
a "-devel" (RPM based systems) or "-dev" (deb based systems) of the MySQL
package.


On Wed, Oct 16, 2013 at 12:32 PM, J. Paskaruk  wrote:

> I ran:
>
> sudo find / -name 'mysql_config'
>
> and it didn't find it. Using the same search, I did find something from my
> home dir, so it seems that it's not actually installed, or rather.. argh.
> I've attempted every "this is how to install MySQL-python method I could
> find on the web, and it either fails to install or says it's already
> installed, but the damn server can't see it.
>
> I've switched it to a sqlite database for now, but this is pissing me
> off...
>
>
> On Wed, Oct 16, 2013 at 11:22 AM, Bill Freeman  wrote:
>
>> If the program mysql_config is installed on your box, it may be installed
>> in a directory that is not on your path.  If you can find it on your box
>> (try the locate and find commands), you can add the directory to your PATH
>> by hand before running pip (or easy_install).  It only needs to be there
>> for the runnings of pip that instiall or update MySQL-python so you don't
>> need to add the directory permanently.  (An alternative is a symbolic link
>> to it in some directory that is on your path, such as maybe /usr/local/bin
>> - though this is slightly less certain to work, depending on how clever
>> mysql_config is - I don't use MySQL, so I don't know for sure.)
>>
>>
>> On Wed, Oct 16, 2013 at 12:10 PM, Jimmy Pants wrote:
>>
>>> I'm trying to do the "Writing Your first Django App" tutorial, and
>>> Django can't see MySQL-python, though it is installed globally.
>>>
>>> I'm not sure if this is a virtualenv problem or what.
>>>
>>>
>>>
>>> Outside of virtualenv:
>>>
>>> jimmy@lilly ~/mysite $ sudo pip install MySQL-python
>>> [sudo] password for jimmy:
>>> Requirement already satisfied (use --upgrade to upgrade): MySQL-python
>>> in /usr/lib/python2.7/dist-packages
>>> Cleaning up...
>>>
>>> *In* my Django virtualenv:
>>>
>>> (DJANGO)jimmy@lilly ~/mysite $ pip install MySQL-python
>>> Downloading/unpacking MySQL-python
>>>   Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
>>>   Running setup.py egg_info for package MySQL-python
>>> Downloading
>>> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
>>> Extracting in /tmp/tmpLPLYIS
>>> Now working in /tmp/tmpLPLYIS/distribute-0.6.28
>>> Building a Distribute egg in
>>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>>>
>>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
>>> sh: 1: mysql_config: not found
>>> Traceback (most recent call last):
>>>   File "", line 16, in 
>>>   File
>>> "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py", line 18, in
>>> 
>>> metadata, options = get_config()
>>>   File "setup_posix.py", line 43, in get_config
>>> libs = mysql_config("libs_r")
>>>   File "setup_posix.py", line 25, in mysql_config
>>> raise EnvironmentError("%s not found" % (mysql_config.path,))
>>> EnvironmentError: mysql_config not found
>>> Complete output from command python setup.py egg_info:
>>> Downloading
>>> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
>>>
>>> Extracting in /tmp/tmpLPLYIS
>>>
>>> Now working in /tmp/tmpLPLYIS/distribute-0.6.28
>>>
>>> Building a Distribute egg in
>>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>>>
>>>
>>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
>>>
>>> sh: 1: mysql_config: not found
>>>
>>> Traceback (most recent call last):
>>>
>>>   File "", line 16, in 
>>>
>>>   File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py",
>>> line 18, in 
>>>
>>> metadata, options = get_config()
>>>
>>>   File "setup_posix.py", line 43, in get_config
>>>
>>> libs = mysql_config("libs_r")
>>>
>>>   File "setup_posix.py", line 25, in mysql_config
>>>
>>> raise EnvironmentError("%s not found" % (mysql_config.path,))
>>>
>>> EnvironmentError: mysql_config not found
>>>
>>> 
>>> Cleaning up...
>>> Command python setup.py egg_info failed with error code 1 in
>>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>>> Storing complete log in /home/jimmy/.pip/pip.log
>>>
>>>
>>>  --
>>> 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 

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
What I mean by "I don't know about sourceing virtualenvwrapper.sh" is that
I don't know, and don't have the inclination to research, whether, having
sourced the file in a shell, you should avoid sourcing it again in a
sub-shell.

What I mean by guard variables is that you could, at the end of your
.bashrc, export a variable that is unlikely to clash with the variables of
other systems, e.g.;

export BASHRC_HAS_ALREADY_BEEN RUN

And earlier in the file test the variable to guard against redoing the
things that should not be redone.

if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
   # Put stuff that shouldn't be done twice here
fi


On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk  wrote:

> That's the one, thank you so much! I saw in the comments of .profile that
> it would not be read if there was a .bashrc file present, so my next step
> was creating that file and putting those lines in it, but I'm very afraid
> of pooching my install. Noob, like I said. :>
>
> I have Aspergers, so I'm not clear on what you meant by "I don't know
> about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
> - I'm assuming, though, that you're referring to a security concern in this
> line, presumably based on the idea that someone could access
> virtualenvwrapper.sh and put malicious code in there.
>
> If I've assessed your comment correctly, is there a good, basic tutorial
> on {guard variables}, as well as the larger schema into which they fit?
> Preferably one that *does* assume intelligence, but does *not* assume a lot
> of existing knowledge on the part of the user?
>
>
> Whatever the case, thank you again for the new knowledge about .profile
> and .bashrc. :>
>
>
> On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman  wrote:
>
>> The file you want (assuming that your shell is bash) is .bashrc because
>> it is run every time a bash shell is started, even if it is not a login
>> shell.
>>
>> Note, however, that settings that shouldn't be done multiple times, such
>> as appending ":$HOME/bin" to the PATH, should be protected with an if so
>> they only happen once, no matter how many sub-shells you start (such as by
>> running something in parentheses), so that PATH doesn't grow without
>> bound.  The WORKON_HOME and PROJECT_HOME settings don't suffer from this
>> problem because it doesn't hurt to set them again to the same value.  I
>> don't know about sourceing virtualenvwrapper.sh.  (Guard variables are your
>> friend.)
>>
>> For some of this stuff it may also be possible to set the environment of
>> the X session, making it available in the environment of shells that are
>> started by the window manager, but you'll have to do your own research on
>> that.
>>
>>
>>
>> On Wed, Oct 16, 2013 at 11:54 AM, Jimmy Pants wrote:
>>
>>> Does gnome-terminal make sense to you in this context? I popped up
>>> "edit" on the terminal launcher and that's in the Application field. I
>>> would, theoretically, add whatever option for gnome-terminal specifies it
>>> as a login shell?
>>>
>>> Testing this, I added --login to the field, per 
>>> thispage, but 
>>> it didn't ask for a login, nor did it run .profile.
>>>
>>> Not sure if I'm barking up the proper tree here, natch.
>>>
>>>
>>> On Wednesday, October 16, 2013 10:37:03 AM UTC-5, Thomas wrote:

  On 10/16/13 8:29 AM, Jimmy Pants wrote:

 ...every time I open a terminal, that is. As I understand it, .profile
 is the file to edit in Linux Mint, and it does exist, with some basic code
 in it, in my home dir. So, per this 
 tutorial,
 I added the following to .profile:

 Your terminal is being opened without specifying it as a "login shell".
 Not sure which terminal program you are using so you will need to check on
 options; for xterm it is the -ls option.

 hth

   - Tom

>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>>
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/e3e173c4-56a5-4d16-a449-6da333fbb74e%40googlegroups.com
>>> .
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/kDehG6wHqiA/unsubscribe.
>> To unsubscribe from this group and all its topics, send 

Re: Registration in django

2013-10-16 Thread Nick Apostolakis

On 16/10/2013 05:24 μμ, Harjot Mann wrote:

On Wed, Oct 16, 2013 at 7:26 PM, Jaimin Patel  wrote:

you will need to update the registration/forms.py in order to add any
additional field. When you adding organization name or any other field you
must be creating some kind of profile for the user, so you should be able to
store and retrieve the information to display on dashboard or anywhere else.

Also using django-registration doesn't restrict you from modifying and
adding more forms for your application.


But changing in forms is not doing any change. Its models id coming
from auth.models i.e User. How can I do the changes in it?

Hello there, I am using django-registration too. I have elected to add 
the user details later in a secondary table (named as extra user 
attributes in my case) that is linked with the user table.

This is filled from the user after the registration.
Just my 2 cents, it may suit your needs too

--
 --
 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/525EC0DB.4010802%40oncrete.gr.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread J. Paskaruk
I ran:

sudo find / -name 'mysql_config'

and it didn't find it. Using the same search, I did find something from my
home dir, so it seems that it's not actually installed, or rather.. argh.
I've attempted every "this is how to install MySQL-python method I could
find on the web, and it either fails to install or says it's already
installed, but the damn server can't see it.

I've switched it to a sqlite database for now, but this is pissing me off...


On Wed, Oct 16, 2013 at 11:22 AM, Bill Freeman  wrote:

> If the program mysql_config is installed on your box, it may be installed
> in a directory that is not on your path.  If you can find it on your box
> (try the locate and find commands), you can add the directory to your PATH
> by hand before running pip (or easy_install).  It only needs to be there
> for the runnings of pip that instiall or update MySQL-python so you don't
> need to add the directory permanently.  (An alternative is a symbolic link
> to it in some directory that is on your path, such as maybe /usr/local/bin
> - though this is slightly less certain to work, depending on how clever
> mysql_config is - I don't use MySQL, so I don't know for sure.)
>
>
> On Wed, Oct 16, 2013 at 12:10 PM, Jimmy Pants  wrote:
>
>> I'm trying to do the "Writing Your first Django App" tutorial, and Django
>> can't see MySQL-python, though it is installed globally.
>>
>> I'm not sure if this is a virtualenv problem or what.
>>
>>
>>
>> Outside of virtualenv:
>>
>> jimmy@lilly ~/mysite $ sudo pip install MySQL-python
>> [sudo] password for jimmy:
>> Requirement already satisfied (use --upgrade to upgrade): MySQL-python in
>> /usr/lib/python2.7/dist-packages
>> Cleaning up...
>>
>> *In* my Django virtualenv:
>>
>> (DJANGO)jimmy@lilly ~/mysite $ pip install MySQL-python
>> Downloading/unpacking MySQL-python
>>   Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
>>   Running setup.py egg_info for package MySQL-python
>> Downloading
>> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
>> Extracting in /tmp/tmpLPLYIS
>> Now working in /tmp/tmpLPLYIS/distribute-0.6.28
>> Building a Distribute egg in
>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>>
>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
>> sh: 1: mysql_config: not found
>> Traceback (most recent call last):
>>   File "", line 16, in 
>>   File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py",
>> line 18, in 
>> metadata, options = get_config()
>>   File "setup_posix.py", line 43, in get_config
>> libs = mysql_config("libs_r")
>>   File "setup_posix.py", line 25, in mysql_config
>> raise EnvironmentError("%s not found" % (mysql_config.path,))
>> EnvironmentError: mysql_config not found
>> Complete output from command python setup.py egg_info:
>> Downloading
>> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
>>
>> Extracting in /tmp/tmpLPLYIS
>>
>> Now working in /tmp/tmpLPLYIS/distribute-0.6.28
>>
>> Building a Distribute egg in
>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>>
>>
>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
>>
>> sh: 1: mysql_config: not found
>>
>> Traceback (most recent call last):
>>
>>   File "", line 16, in 
>>
>>   File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py",
>> line 18, in 
>>
>> metadata, options = get_config()
>>
>>   File "setup_posix.py", line 43, in get_config
>>
>> libs = mysql_config("libs_r")
>>
>>   File "setup_posix.py", line 25, in mysql_config
>>
>> raise EnvironmentError("%s not found" % (mysql_config.path,))
>>
>> EnvironmentError: mysql_config not found
>>
>> 
>> Cleaning up...
>> Command python setup.py egg_info failed with error code 1 in
>> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>> Storing complete log in /home/jimmy/.pip/pip.log
>>
>>
>>  --
>> 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/2679ff82-df1c-403a-89f1-f6e1f62f6a84%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/lLyFY5EIjyE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> 

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread J. Paskaruk
That's the one, thank you so much! I saw in the comments of .profile that
it would not be read if there was a .bashrc file present, so my next step
was creating that file and putting those lines in it, but I'm very afraid
of pooching my install. Noob, like I said. :>

I have Aspergers, so I'm not clear on what you meant by "I don't know about
sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)" - I'm
assuming, though, that you're referring to a security concern in this line,
presumably based on the idea that someone could access virtualenvwrapper.sh
and put malicious code in there.

If I've assessed your comment correctly, is there a good, basic tutorial on
{guard variables}, as well as the larger schema into which they fit?
Preferably one that *does* assume intelligence, but does *not* assume a lot
of existing knowledge on the part of the user?


Whatever the case, thank you again for the new knowledge about .profile and
.bashrc. :>


On Wed, Oct 16, 2013 at 11:14 AM, Bill Freeman  wrote:

> The file you want (assuming that your shell is bash) is .bashrc because it
> is run every time a bash shell is started, even if it is not a login shell.
>
> Note, however, that settings that shouldn't be done multiple times, such
> as appending ":$HOME/bin" to the PATH, should be protected with an if so
> they only happen once, no matter how many sub-shells you start (such as by
> running something in parentheses), so that PATH doesn't grow without
> bound.  The WORKON_HOME and PROJECT_HOME settings don't suffer from this
> problem because it doesn't hurt to set them again to the same value.  I
> don't know about sourceing virtualenvwrapper.sh.  (Guard variables are your
> friend.)
>
> For some of this stuff it may also be possible to set the environment of
> the X session, making it available in the environment of shells that are
> started by the window manager, but you'll have to do your own research on
> that.
>
>
>
> On Wed, Oct 16, 2013 at 11:54 AM, Jimmy Pants  wrote:
>
>> Does gnome-terminal make sense to you in this context? I popped up "edit"
>> on the terminal launcher and that's in the Application field. I would,
>> theoretically, add whatever option for gnome-terminal specifies it as a
>> login shell?
>>
>> Testing this, I added --login to the field, per 
>> thispage, but it 
>> didn't ask for a login, nor did it run .profile.
>>
>> Not sure if I'm barking up the proper tree here, natch.
>>
>>
>> On Wednesday, October 16, 2013 10:37:03 AM UTC-5, Thomas wrote:
>>>
>>>  On 10/16/13 8:29 AM, Jimmy Pants wrote:
>>>
>>> ...every time I open a terminal, that is. As I understand it, .profile
>>> is the file to edit in Linux Mint, and it does exist, with some basic code
>>> in it, in my home dir. So, per this 
>>> tutorial,
>>> I added the following to .profile:
>>>
>>> Your terminal is being opened without specifying it as a "login shell".
>>> Not sure which terminal program you are using so you will need to check on
>>> options; for xterm it is the -ls option.
>>>
>>> hth
>>>
>>>   - Tom
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e3e173c4-56a5-4d16-a449-6da333fbb74e%40googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/kDehG6wHqiA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAB%2BAj0uVGKfx_b%2BBX4-h8EA3YPqDipJStL5TRE8fN_gW6dJvCQ%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 

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Bill Freeman
If the program mysql_config is installed on your box, it may be installed
in a directory that is not on your path.  If you can find it on your box
(try the locate and find commands), you can add the directory to your PATH
by hand before running pip (or easy_install).  It only needs to be there
for the runnings of pip that instiall or update MySQL-python so you don't
need to add the directory permanently.  (An alternative is a symbolic link
to it in some directory that is on your path, such as maybe /usr/local/bin
- though this is slightly less certain to work, depending on how clever
mysql_config is - I don't use MySQL, so I don't know for sure.)


On Wed, Oct 16, 2013 at 12:10 PM, Jimmy Pants  wrote:

> I'm trying to do the "Writing Your first Django App" tutorial, and Django
> can't see MySQL-python, though it is installed globally.
>
> I'm not sure if this is a virtualenv problem or what.
>
>
>
> Outside of virtualenv:
>
> jimmy@lilly ~/mysite $ sudo pip install MySQL-python
> [sudo] password for jimmy:
> Requirement already satisfied (use --upgrade to upgrade): MySQL-python in
> /usr/lib/python2.7/dist-packages
> Cleaning up...
>
> *In* my Django virtualenv:
>
> (DJANGO)jimmy@lilly ~/mysite $ pip install MySQL-python
> Downloading/unpacking MySQL-python
>   Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
>   Running setup.py egg_info for package MySQL-python
> Downloading
> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
> Extracting in /tmp/tmpLPLYIS
> Now working in /tmp/tmpLPLYIS/distribute-0.6.28
> Building a Distribute egg in
> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>
> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
> sh: 1: mysql_config: not found
> Traceback (most recent call last):
>   File "", line 16, in 
>   File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py",
> line 18, in 
> metadata, options = get_config()
>   File "setup_posix.py", line 43, in get_config
> libs = mysql_config("libs_r")
>   File "setup_posix.py", line 25, in mysql_config
> raise EnvironmentError("%s not found" % (mysql_config.path,))
> EnvironmentError: mysql_config not found
> Complete output from command python setup.py egg_info:
> Downloading
> http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
>
> Extracting in /tmp/tmpLPLYIS
>
> Now working in /tmp/tmpLPLYIS/distribute-0.6.28
>
> Building a Distribute egg in
> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
>
>
> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
>
> sh: 1: mysql_config: not found
>
> Traceback (most recent call last):
>
>   File "", line 16, in 
>
>   File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py", line
> 18, in 
>
> metadata, options = get_config()
>
>   File "setup_posix.py", line 43, in get_config
>
> libs = mysql_config("libs_r")
>
>   File "setup_posix.py", line 25, in mysql_config
>
> raise EnvironmentError("%s not found" % (mysql_config.path,))
>
> EnvironmentError: mysql_config not found
>
> 
> Cleaning up...
> Command python setup.py egg_info failed with error code 1 in
> /home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
> Storing complete log in /home/jimmy/.pip/pip.log
>
>
>  --
> 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/2679ff82-df1c-403a-89f1-f6e1f62f6a84%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/CAB%2BAj0sNUEyG5cMig_ewzKoNnADJFNjzy3ogwi1Cm9rXMOkSNg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
The file you want (assuming that your shell is bash) is .bashrc because it
is run every time a bash shell is started, even if it is not a login shell.

Note, however, that settings that shouldn't be done multiple times, such as
appending ":$HOME/bin" to the PATH, should be protected with an if so they
only happen once, no matter how many sub-shells you start (such as by
running something in parentheses), so that PATH doesn't grow without
bound.  The WORKON_HOME and PROJECT_HOME settings don't suffer from this
problem because it doesn't hurt to set them again to the same value.  I
don't know about sourceing virtualenvwrapper.sh.  (Guard variables are your
friend.)

For some of this stuff it may also be possible to set the environment of
the X session, making it available in the environment of shells that are
started by the window manager, but you'll have to do your own research on
that.



On Wed, Oct 16, 2013 at 11:54 AM, Jimmy Pants  wrote:

> Does gnome-terminal make sense to you in this context? I popped up "edit"
> on the terminal launcher and that's in the Application field. I would,
> theoretically, add whatever option for gnome-terminal specifies it as a
> login shell?
>
> Testing this, I added --login to the field, per 
> thispage, but it 
> didn't ask for a login, nor did it run .profile.
>
> Not sure if I'm barking up the proper tree here, natch.
>
>
> On Wednesday, October 16, 2013 10:37:03 AM UTC-5, Thomas wrote:
>>
>>  On 10/16/13 8:29 AM, Jimmy Pants wrote:
>>
>> ...every time I open a terminal, that is. As I understand it, .profile is
>> the file to edit in Linux Mint, and it does exist, with some basic code in
>> it, in my home dir. So, per this 
>> tutorial,
>> I added the following to .profile:
>>
>> Your terminal is being opened without specifying it as a "login shell".
>> Not sure which terminal program you are using so you will need to check on
>> options; for xterm it is the -ls option.
>>
>> hth
>>
>>   - Tom
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e3e173c4-56a5-4d16-a449-6da333fbb74e%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/CAB%2BAj0uVGKfx_b%2BBX4-h8EA3YPqDipJStL5TRE8fN_gW6dJvCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Jimmy Pants
I'm trying to do the "Writing Your first Django App" tutorial, and Django 
can't see MySQL-python, though it is installed globally. 

I'm not sure if this is a virtualenv problem or what. 



Outside of virtualenv:

jimmy@lilly ~/mysite $ sudo pip install MySQL-python
[sudo] password for jimmy: 
Requirement already satisfied (use --upgrade to upgrade): MySQL-python in 
/usr/lib/python2.7/dist-packages
Cleaning up...

*In* my Django virtualenv:

(DJANGO)jimmy@lilly ~/mysite $ pip install MySQL-python
Downloading/unpacking MySQL-python
  Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
  Running setup.py egg_info for package MySQL-python
Downloading 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /tmp/tmpLPLYIS
Now working in /tmp/tmpLPLYIS/distribute-0.6.28
Building a Distribute egg in 
/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python

/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg
sh: 1: mysql_config: not found
Traceback (most recent call last):
  File "", line 16, in 
  File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py", 
line 18, in 
metadata, options = get_config()
  File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
  File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
Downloading 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz

Extracting in /tmp/tmpLPLYIS

Now working in /tmp/tmpLPLYIS/distribute-0.6.28

Building a Distribute egg in 
/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python

/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/distribute-0.6.28-py2.7.egg

sh: 1: mysql_config: not found

Traceback (most recent call last):

  File "", line 16, in 

  File "/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python/setup.py", line 
18, in 

metadata, options = get_config()

  File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

  File "setup_posix.py", line 25, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found


Cleaning up...
Command python setup.py egg_info failed with error code 1 in 
/home/jimmy/.virtualenvs/DJANGO/build/MySQL-python
Storing complete log in /home/jimmy/.pip/pip.log


-- 
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/2679ff82-df1c-403a-89f1-f6e1f62f6a84%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Jimmy Pants
Does gnome-terminal make sense to you in this context? I popped up "edit" 
on the terminal launcher and that's in the Application field. I would, 
theoretically, add whatever option for gnome-terminal specifies it as a 
login shell?

Testing this, I added --login to the field, per 
thispage, but it 
didn't ask for a login, nor did it run .profile. 

Not sure if I'm barking up the proper tree here, natch.

On Wednesday, October 16, 2013 10:37:03 AM UTC-5, Thomas wrote:
>
>  On 10/16/13 8:29 AM, Jimmy Pants wrote:
>  
> ...every time I open a terminal, that is. As I understand it, .profile is 
> the file to edit in Linux Mint, and it does exist, with some basic code in 
> it, in my home dir. So, per this 
> tutorial, 
> I added the following to .profile:
>  
> Your terminal is being opened without specifying it as a "login shell". 
> Not sure which terminal program you are using so you will need to check on 
> options; for xterm it is the -ls option.
>
> hth
>
>   - Tom
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e3e173c4-56a5-4d16-a449-6da333fbb74e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: DJANGO and SOAP

2013-10-16 Thread Bill Freeman
It is possible to use urllib2 to deal with headers and use lxml to
create/parse bodies.  More work, and no automatic WSDL processing, but
fully general.  I've had to go that way when the vendor on the other end
did some not strictly legal SOAP things.

ZSI used to be a good SOAP choice, but has sort of merged (last I knew)
with suds, so it probably has the same restrictions.

(I haven't found WSDLs particularly useful, but then in my biggest SOAP
project the functions only parameter and only result was a "String"
containing a separate XML document not described at all by the WSDL, but
which I had to parse/generate.)


On Wed, Oct 16, 2013 at 9:49 AM, Jaimin Patel  wrote:

> Does any of two library mentioned in this SO answers helps -
> http://stackoverflow.com/questions/5167122/django-as-soap-web-service-server
> ?
>
> On Wednesday, October 16, 2013 5:59:21 AM UTC-4, Domagoj Kovač wrote:
>
>> Hi everyone,
>>
>> I have a problem. For the past few days i have been looking for some good
>> SOAP client library and i did not found anything that works properly. The
>> problem is that i have some recursive SOAP function and as i saw, suds has
>> the problem with this types of things, some other libraries brake on that
>> part.
>>
>> So, is there any really good library that has proper documentation and
>> also can work with wsdl?
>>
>  --
> 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/8e624d1d-42b0-499c-908e-b66cad509418%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/CAB%2BAj0sisiyKibEMwOhE6%3DXEo5R9SZ1tFWwzNTeOrTCpn9370A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Thomas Lockhart

On 10/16/13 8:29 AM, Jimmy Pants wrote:
...every time I open a terminal, that is. As I understand it, .profile 
is the file to edit in Linux Mint, and it does exist, with some basic 
code in it, in my home dir. So, per this tutorial 
, I 
added the following to .profile:
Your terminal is being opened without specifying it as a "login shell". 
Not sure which terminal program you are using so you will need to check 
on options; for xterm it is the -ls option.


hth

  - Tom

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/525EB29F.2070008%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Iframe sandbox security

2013-10-16 Thread Robin Lery
I was planning to create an app where the users can create their own blog
page and others can link it in my web, like facebook. And then, I thought
about using iframe with the sandbox attribute to view the page with
the safe filter
in the template. So, is it safe to implement it in this way??? Or is there
any other way around? Please, any help will be much appreciated!

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


having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Jimmy Pants
...every time I open a terminal, that is. As I understand it, .profile is 
the file to edit in Linux Mint, and it does exist, with some basic code in 
it, in my home dir. So, per this 
tutorial, 
I added the following to .profile:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

But I still have to run $ source ~/.profile before I can run workon and the 
rest. I went
so far as to reboot, even...


-- 
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/3149ab9f-b559-42e1-aded-1cbc580b9cc8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread Tom Evans
On Wed, Oct 16, 2013 at 3:20 PM,   wrote:
> Ouch! I should have read your post more carefully! If you don't have any
> other options than to use Apache, you could run it as proxy to gunicorn. Or
> you could use Nginx instead of Apache...

What, precisely, is wrong with Apache httpd/mod_wsgi as a hosting solution?

httpd can be as lean and efficient as nginx in memory usage if you
configure it so, doesn't abandon the httpd ecosystem, and can actually
host wsgi apps itself, rather than requiring yet another webserver in
to the mix.

Especially so, I'd imagine, if that other webserver has, in your words
"some weird import errors which occured only when I was running the
project with `gunicorn_django"

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1%2B6%3Dx9cvGD9QgaK7c%2BY0szH7t8pV%3DzXBbipcowpwP3tLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread rok
Hi, I am not a particular evangelist of one or the other but since we use 
apache+mod_wsgi for several apps throughout the company, we obviously want 
to stick with one, easier for deployment and maintenance. 

On Wednesday, October 16, 2013 5:17:35 PM UTC+2, Tom Evans wrote:
>
> On Wed, Oct 16, 2013 at 3:20 PM,   
> wrote: 
> > Ouch! I should have read your post more carefully! If you don't have any 
> > other options than to use Apache, you could run it as proxy to gunicorn. 
> Or 
> > you could use Nginx instead of Apache... 
>
> What, precisely, is wrong with Apache httpd/mod_wsgi as a hosting 
> solution? 
>
> httpd can be as lean and efficient as nginx in memory usage if you 
> configure it so, doesn't abandon the httpd ecosystem, and can actually 
> host wsgi apps itself, rather than requiring yet another webserver in 
> to the mix. 
>
> Especially so, I'd imagine, if that other webserver has, in your words 
> "some weird import errors which occured only when I was running the 
> project with `gunicorn_django" 
>
> Cheers 
>
> Tom 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/000f4297-bf65-4929-8bee-2d82b030cde2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django summernote not working properly

2013-10-16 Thread Hyun-woo Park
Thank you for reporting. 
See 
http://stackoverflow.com/questions/19347067/django-summernote-not-working-properly/19406459#19406459

2013년 10월 14일 월요일 오전 1시 8분 28초 UTC+9, Kakar 님의 말:
>
> I am using django-summernote as a 
> wysiwyg editor. And till now, I can save the post from the summernote 
> editor and can display it too using the safe filter. But some of its 
> functionalities are not there in my template.
>
>1. There is no image upload button in the editor.
>2. The Code style is displaying fine, but the Quote style is 
>displaying just a regular text.
>
> And finally, is it safe to use safe filter in the templates?
>
> Please help me how do I solve this problem. Or I can't use it in django? 
> Thank you.
>  

-- 
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/18c42328-9bac-473f-8e72-f4981456bdbf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: DJANGO and SOAP

2013-10-16 Thread Jaimin Patel
Does any of two library mentioned in this SO answers helps 
- http://stackoverflow.com/questions/5167122/django-as-soap-web-service-server?

On Wednesday, October 16, 2013 5:59:21 AM UTC-4, Domagoj Kovač wrote:
>
> Hi everyone,
>
> I have a problem. For the past few days i have been looking for some good 
> SOAP client library and i did not found anything that works properly. The 
> problem is that i have some recursive SOAP function and as i saw, suds has 
> the problem with this types of things, some other libraries brake on that 
> part.
>
> So, is there any really good library that has proper documentation and 
> also can work with wsdl? 
>

-- 
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/8e624d1d-42b0-499c-908e-b66cad509418%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Registration in django

2013-10-16 Thread Harjot Mann
On Wed, Oct 16, 2013 at 7:26 PM, Jaimin Patel  wrote:
> you will need to update the registration/forms.py in order to add any
> additional field. When you adding organization name or any other field you
> must be creating some kind of profile for the user, so you should be able to
> store and retrieve the information to display on dashboard or anywhere else.
>
> Also using django-registration doesn't restrict you from modifying and
> adding more forms for your application.


But changing in forms is not doing any change. Its models id coming
from auth.models i.e User. How can I do the changes in it?

-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

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


Re: Django ORM generating the wrong query for recent friends of an user

2013-10-16 Thread Arthur Silva
I still can't find the problem.  Django isn't using the same "friendship" 
joined table for both conditions which makes me wonder if it's related to 
this 
https://docs.djangoproject.com/en/1.5/topics/db/queries/#spanning-multi-valued-relationships

Please help.

On Tuesday, September 24, 2013 10:50:54 AM UTC-3, Arthur Silva wrote:
>
> Here're my models
>
>
> class PingUser(AbstractUser):
> friends = models.ManyToManyField("self", through="Friendship", 
> symmetrical=False)
> 
> class Friendship(TimestampedModel, SerializeMixin):
> STATUS_CHOICES = (
> ("pending", "Pending"),
> ("friend", "Friend"),
> ("favorite", "Favorite")
> )
> user = models.ForeignKey(PingUser, related_name="friendships")
> friend = models.ForeignKey(PingUser, 
> related_name="friendships_reverse")
> status = models.CharField(max_length=20, 
> default=STATUS_CHOICES[0][0], choices=STATUS_CHOICES)
>
> class Meta:
> unique_together = [('user', 'friend')]
>
>
>
> The code I'm using to get the most recent friends of user 4
>
>
> id = 4
> friendships = Friendship.objects.exclude(status="pending").filter(
> ~Q(user__friendships__status="pending"), 
> user__friendships__friend_id=id).order_by("-created_at")
>
>
> I also tried several combinations like grouping all filtering inside one 
> filter() but the query is the same
>
>
> Generated query
>
>
> SELECT `sample_app_friendship`.`id`,
>`sample_app_friendship`.`created_at`,
>`sample_app_friendship`.`updated_at`,
>`sample_app_friendship`.`user_id`,
>`sample_app_friendship`.`friend_id`,
>`sample_app_friendship`.`status`
> FROM `sample_app_friendship`
> INNER JOIN `sample_app_pinguser` ON (`sample_app_friendship`.`user_id` 
> = `sample_app_pinguser`.`id`)
> INNER JOIN `sample_app_friendship` T5 ON (`sample_app_pinguser`.`id` = 
> T5.`user_id`)
> WHERE (NOT (`sample_app_friendship`.`status` = 'pending')
>AND NOT ((`sample_app_friendship`.`user_id` IN
>(SELECT U2.`user_id`
> FROM `sample_app_friendship` U2
> WHERE (U2.`status` = 'pending'
>AND U2.`user_id` IS NOT NULL))
>  AND `sample_app_pinguser`.`id` IS NOT NULL))
>AND T5.`friend_id` = 4)
>
>
>
> The desired query is actually
>
>
> SELECT `sample_app_friendship`.`id`,
>`sample_app_friendship`.`created_at`,
>`sample_app_friendship`.`updated_at`,
>`sample_app_friendship`.`user_id`,
>`sample_app_friendship`.`friend_id`,
>`sample_app_friendship`.`status`
> FROM `sample_app_friendship`
> INNER JOIN `sample_app_pinguser` ON (`sample_app_friendship`.`user_id` 
> = `sample_app_pinguser`.`id`)
> INNER JOIN `sample_app_friendship` T5 ON (`sample_app_pinguser`.`id` = 
> T5.`user_id`)
> WHERE (NOT (`sample_app_friendship`.`status` = 'pending')
>AND (NOT T5.`status` = 'pending')
>AND T5.`friend_id` = 4)
>
> Someone more experienced can shed some light?
>
> 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/e38830e9-51a6-4ed2-afa9-dc2b44c8110f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread the . paper . men


On Wednesday, October 16, 2013 4:18:13 PM UTC+4, rok wrote:
>
> Hi Ivan, thanks for the response. No. we are not using gunicorn, just 
>  apache+mod_wsgi.
>
> moreover, I configured WSGIDaemon option for the host to separate it from 
> the rest of the system and still no luck.
>
> Rok
>
> On Wednesday, October 16, 2013 9:39:28 AM UTC+2, the.pa...@gmail.comwrote:
>>
>> Hi!
>>
>>  Original Message 
>> Subject: Re: ImportError: cannot import name actions
>> Date: Wed, 16 Oct 2013 11:26:33 +0400
>> From: Ivan Kharlamov 
>> To: django-d...@googlegroups.com
>>
>> On 10/15/2013 04:56 PM, rok wrote:
>> > I have recently been testing the 1.6b4 tag with a new app we are
>> > writing, using apache and wsgi. However, I could not get rid of the
>> > following issue happening on every request:
>> > 
>> > ...
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
>> > "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line
>> > 2, in 
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
>> > django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin,
>> > StackedInline, TabularInline, HORIZONTAL, VERTICAL
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
>> > "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6,
>> > in 
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
>> > django.contrib.admin.sites import AdminSite, site
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
>> > "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in
>> > 
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
>> > django.contrib.admin import ModelAdmin, actions
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError:
>> > cannot import name actions
>> > 
>> > by doing the following change, I could get rid of what looked like a
>> > circular import issue:
>> > --- a/django/contrib/admin/sites.py
>> > +++ b/django/contrib/admin/sites.py
>> > @@ -1,6 +1,7 @@
>> >  from functools import update_wrapper
>> >  from django.http import Http404, HttpResponseRedirect
>> > -from django.contrib.admin import ModelAdmin, actions
>> > +from django.contrib.admin import ModelAdmin
>> > +from django.contrib.admin.actions import delete_selected
>> >  from django.contrib.admin.forms import AdminAuthenticationForm
>> >  from django.contrib.auth import REDIRECT_FIELD_NAME
>> >  from django.contrib.contenttypes import views as contenttype_views
>> > @@ -46,7 +47,7 @@ class AdminSite(object):
>> >  self._registry = {}  # model_class class -> admin_class 
>> instance
>> >  self.name = name
>> >  self.app_name = app_name
>> > -self._actions = {'delete_selected': actions.delete_selected}
>> > +self._actions = {'delete_selected': delete_selected}
>> >  self._global_actions = self._actions.copy()
>> >  
>> >  def register(self, model_or_iterable, admin_class=None, **options):
>> > 
>> > Switching to 1.5.4 resolves the issue as well (even though the sites.py
>> > code is the same). What is more, this did not occur in the development
>> > environment when using the runserver run.
>> > 
>> > Any clue?
>>
>> Well, if this doesn't happen in the dev environment and does happen in
>> production, is there any chance that you're using gunicorn via
>> `gunicorn_django` command? If yes, try running the project with
>> `gunicorn` command instead.
>>
>> I have seen some weird import errors which occured only when I was
>> running the project with `gunicorn_django` in conjunction with Django
>> 1.6, but I didn't take time to debug and report them since
>> `gunicorn_django` command is deprecated and switching to `gunicorn`
>> command fixed everything.
>>
>> Still, I have written about them on SO: 
>> http://stackoverflow.com/questions/16369354/why-is-gunicorn-django-not-recommended-anymore/16373778#16373778
>>
>> Hope this helps!
>>
>> Regards,
>> Ivan
>>
>>

Ouch! I should have read your post more carefully! If you don't have any 
other options than to use Apache, you could run it as proxy to gunicorn. Or 
you could use Nginx instead of Apache...
 

-- 
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/8ada7e97-fc4d-4f5d-83f7-14ab7b751123%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: DJANGO and SOAP

2013-10-16 Thread Domagoj Kovač
I actually need a client library, not server library.

-- 
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/bc47576e-b505-4e42-8ccc-b8f3d43b2f94%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django data to Javascript

2013-10-16 Thread Bill Freeman
On Wed, Oct 16, 2013 at 3:39 AM, drakko  wrote:

> ...
>


> But accessing should_have_found_list in template has no problems. I have
> separate JS file that contains functions (event handlers for buttons etc.).
> I can't figure out (total newbie in JS :D ) how to access (or pass)
> should_have_found_list there. (Sorry I wasn't clear enough in my first post)
>

Things that the template context knows are available when the template is
rendered.  That is, when the template is turned into (in this case) an HTML
document (represented as a string).  This happens on the server.

The only thing sent to the browser is that HTML document, notwithstanding
that that stuff in that HTML document may cause the browser to load other
stuff (like images, javascript files, and CSS files).

But, specifically, the template context is not automatically included in
any way.

If you have a template context variables that you wish to reference from
the javascript (which runs in the browser, long after template rendering is
complete) then you must arrange that the HTML document contain, within a
suitable script tag, javascript code that sets a javascript variable to a
javascript literal.  For example, if template context variables "count" and
"name" have, respectively, values 1 and "Joe", you might write something
like this in your template:


   var ct = {{ count }},
nm = "{{ name }}";


Which becomes, in the HTML sent to the bowser:


   var ct = 1,
nm = "Joe";


Now those values are available to the javascript running in the browser as
"ct" and "nm".  (You don't have to use different variable names.  I just
wanted it to be clear which were template context variables and which were
javascript variables).

But note that not all python objects can be sent this way.  You can't, for
example, just send a queryset and expect to be able to use its "filter"
method from javascript.

You have two choices for sending more complex objects who's ultimate parts
are representable as javascript scalars.  If they can be JSON encoded, then
that *IS* a javascript object literal.  Or you can iterate through the
object (and subobjects) rendering each by hand, including suitable
javascript object syntax separators and wrappers, like brackets, braces and
commas.

Note, too, that my first code above does not work if the name variable
contains a double quote, since:

nm = "Joe "the schmoe" Gogo";

isn't valid javascript.  The json built into modern pythons is willing to
encode a string as a suitable javascript object literal, with all necessary
escaping and with the quotes built in (even though this isn't legal JSON -
formally the top level object must be a javascript array or object).  So if
the name template context variable had been created in the view thusly:

...
name = json.dumps(obj.name),
...

then the following is correct:


   var ct = {{ count }},
nm = {{ name }};


Note that the quotes have been removed.

[It might be useful to have a json dumps template filter.  Perhaps there's
one I haven't found.]

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


Re: DJANGO and SOAP

2013-10-16 Thread Jaimin Patel
This might help 
- http://stackoverflow.com/questions/5167122/django-as-soap-web-service-server

On Wednesday, October 16, 2013 5:59:21 AM UTC-4, Domagoj Kovač wrote:
>
> Hi everyone,
>
> I have a problem. For the past few days i have been looking for some good 
> SOAP client library and i did not found anything that works properly. The 
> problem is that i have some recursive SOAP function and as i saw, suds has 
> the problem with this types of things, some other libraries brake on that 
> part.
>
> So, is there any really good library that has proper documentation and 
> also can work with wsdl? 
>

-- 
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/d3966ac8-e4bf-47ae-b201-808ffd34f134%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Registration in django

2013-10-16 Thread Jaimin Patel
you will need to update the registration/forms.py in order to add any 
additional field. When you adding organization name or any other field you 
must be creating some kind of profile for the user, so you should be able 
to store and retrieve the information to display on dashboard or anywhere 
else.

Also using django-registration doesn't restrict you from modifying and 
adding more forms for your application.

On Wednesday, October 16, 2013 9:48:23 AM UTC-4, Harjot Mann wrote:
>
> I am using django-registration in my app and I implemented it 
> correctly but I want to add an another field in it like I want to have 
> the organization name from user and that name I want to display in the 
> dashboard of user. What should I need to do for it? 
> and what if I dont want to use the django-registration module and I 
> want to make my own code for registration and login? 
>
> -- 
> Harjot Kaur Mann 
> Blog: http://harjotmann.wordpress.com/ 
> Daily Dairy: http://harjotmann.wordpress.com/daily-diary/ 
>

-- 
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/2de0b8c9-9b25-48d7-bdfe-052974c25360%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Registration in django

2013-10-16 Thread Harjot Mann
I am using django-registration in my app and I implemented it
correctly but I want to add an another field in it like I want to have
the organization name from user and that name I want to display in the
dashboard of user. What should I need to do for it?
and what if I dont want to use the django-registration module and I
want to make my own code for registration and login?

-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

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


Re: Image browsing in django

2013-10-16 Thread Skyler Dawson
Hi Harjot,

First, I noticed your form action is empty (""). Depending on your browser, 
this can mean different things (some browsers take it as an action that 
gets sent back to the index page), as described in this answer on 
stackoverflow: 
http://stackoverflow.com/questions/1131781/is-it-a-good-practice-to-use-an-empty-url-for-a-html-forms-action-attribute-a

Hopefully you're developing on a more recent browser so this isn't actually 
the issue, but it's still good to know about.

Second, when asking questions, it's best to give us as much information as 
possible, therefore posting your view that is supposed to actually handle 
the form might help us.

Finally, people are donating their time here generously to help you out; 
complaining that no one has an automatic solution is frankly quite silly. 
We don't have your code, you're asking us to remote debug with very little 
information. Debugging is a very important skill, and I don't see you 
posting what other attempts you've made to debug this issue. Anyway, tl;dr 
the internet is not your personal army, etc.



On Wednesday, 16 October 2013 03:45:41 UTC-4, Harjot Mann wrote:
>
> On Wed, Oct 16, 2013 at 1:06 PM, Harjot Mann 
>  
> wrote: 
> > 
> > No same problem,please help me...please help me...please help me..I 
> > have posted this mail 5 days ago and no one is able to solve my 
> > problem. :( I am really disappointed :( 
>
>
> Please tell me the solution. I have to complete my work soon. please. 
>
> -- 
> Harjot Kaur Mann 
> Blog: http://harjotmann.wordpress.com/ 
> Daily Dairy: http://harjotmann.wordpress.com/daily-diary/ 
>

-- 
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/c7e64c29-2146-4575-aa92-318edfa91f05%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: SQL cast for custom model lookup

2013-10-16 Thread Aryeh Leib Taurog
On Tue, Oct 15, 2013 at 10:20:08PM +0200, Aryeh Leib Taurog wrote:
> I'm working with 
> and I'm wondering if there's a way to get django to add an explicit 
> cast to the SQL generated for field lookups.
> 
> I have a model that looks like this:
> 
> class Floats(models.Model):
> arr = FloatArrayField()
> 
> Which translates to the following table definition in postgresql:
> 
> CREATE TABLE "dbarray_floats" (
> "id" serial NOT NULL PRIMARY KEY,
> "arr" double precision[]
> )
> ;
> 
> When I evaluate something along these lines:
> 
> Floats.objects.filter(arr=[3.0, 9.0])
> 
> I get the following error:
> 
> DatabaseError: operator does not exist: double precision[] = numeric[]
> LINE 1: ...ROM "dbarray_floats" WHERE "dbarray_floats"."arr" = ARRAY[3
>  ^
> HINT:  No operator matches the given name and argument type(s). You might 
> need to add explicit type casts.
> 
> It looks to me like psycopg2 is for some reason presenting the query 
> parameter as numeric[], so I would need to somehow slip a type-cast 
> into the SQL statement so that the WHERE clause would look something 
> like this:
> 
> 'WHERE "dbarray_floats"."arr" = %s::double precision[]'
> 
> But there doesn't seem to be any mechanism for a custom model field to 
> influence the way its placeholders are presented in SQL statements.

After closer inspection of the code, I found what I was looking for:

class Extra(object):
def __init__(self, extra, value):
self.extra = extra
self.value = value

def as_sql(self, qn, connection):
return self.extra, [self.value] 

class FloatArrayField(ArrayFieldBase, models.FloatField):
__metaclass__ = ArrayFieldMetaclass
def get_db_prep_lookup(self, lookup_type, value, connection, 
prepared=False):
if not prepared:
value = self.get_prep_lookup(lookup_type, value)
return Extra('%s::double precision[]', value)

This indeed works.

I realize that an exact lookup on floats (in an array or otherwise) is 
generally not good practice, so in any case the best thing here might 
be to simply disallow lookups altogether.  I was more interested in 
learning if there was an easy way to perform the cast.

Regards,
Aryeh Leib

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


Re: def altword_list(self, request, word_id):

2013-10-16 Thread Pepsodent Cola
Hi Leo,

Most of what you describe looks familiar, but I'm not 100% sure that what
you say is what I'm trying to do.  One thing you said though stands out
which was new to me, which was the difference between ListViews and
DetailViews.  I'm not very experienced with those and thus don't understand
them fully yet.

Note that you define a get_queryset() method in AltwordlistView, but I
think it is not called in a DetailedView, only ListView uses it.




Let me try to walk you through visually what I'm trying to do with my messy
and confusing code.  :)

1.)
My ERD diagram.
http://s1289.photobucket.com/user/allergic2facebook/media/Django/Navi_08_zps2a9360d1.png.html

2.)
My Index page list the words that I want in *Filter 2* (from Word table).
 You can basically ignore everything else my main focus is on Filter 2.  I
then click on the word *"( id: 1 ) - Page"* which then sends me to the
AltwordlistView.
http://s1289.photobucket.com/user/allergic2facebook/media/Django/Indexhtml_zps77b085a3.png.html

3.)
The next page I see is *altword_list.html*.  Here I am trying to integrate
the new Filter 8 code into my project but it's not working.  The template
file altword_list.html can't receive any Filter 8 variable from my
AltwordlistView.
http://s1289.photobucket.com/user/allergic2facebook/media/Django/Altword_listhtml_zps8e8ffe4e.png.html

Only my Filter 5 code is closest to what I am trying to achieve.  It just
won't order the votes. :(
Filter 5 code uses get_queryset() so I'm reluctant to throw away that
method from AltwordlistView(generic.DetailView).

On this screenshot only *Filter 8* and *Filter 5* is of interest.  You can
basically ignore the rest which are old filter experiments.



4.)

So I'd fix the whole thing this way:
* get rid of get_queryset()
* get rid of the altword_list() function view
* put something like context['poll_list'] =
Altword.objects.filter(word__pk=word_id).order_by('-votes') in
get_context_data()


I kept the get_queryset() for now because of the above explanation from
Step 3.  Until I see a better replacement code.
But I tried to do what you say by integrating the new Filter 8 code into
get_context_data().

*Views*
http://dpaste.com/1418808/

*altword_list.html*
http://dpaste.com/1418809/


What I get is the below exception, so it seems I'm having issues with
connecting the PK in my View code.  How do I deal with this kind of problem?

Exception Value:  global name 'word_id' is not defined
Exception Location:  Navi/Django/navi/navi_polls/views.py in
get_context_data, line 118










On Wed, Oct 16, 2013 at 12:29 PM, Leonardo Giordani <
giordani.leona...@gmail.com> wrote:

> Well, I tried to understand the code. Correct me if I did not understand
> it:
>
> * you are calling AltwordlistView from r'^altword_list/(?P\d+)/$
> * being a DetailedView on Altword, AltwordlistView extracts the Altword
> with the given pk with a query like Altword.objects.get(pk=pk)
> * you set the context you send to the template, in the get_context_data
>
> There, in get_context_data() you have to initialize all the keywords you
> are going to use in the template. In this case poll_list.
>
> Note that you define a get_queryset() method in AltwordlistView, but I
> think it is not called in a DetailedView, only ListView uses it.
>
> So I'd fix the whole thing this way:
>
> * get rid of get_queryset()
> * get rid of the altword_list() function view
> * put something like context['poll_list'] =
> Altword.objects.filter(word__pk=word_id).order_by('-votes') in
> get_context_data()
>
> If you are trying to show a list of objects, however, I suggest you to try
> and use a ListView, where you can define your queryset, as you tried to do
> with the get_queryset() method.
>
> Try and let me know if something starts to work. Feel free to ask further
> if the matter is not clear.
>
> Cheers,
>
> Leo
>
>
> Leonardo Giordani
> Author of The Digital Cat 
> My profile on About.me  - My GitHub
> page  - My Coderwall 
> profile
>
>
> 2013/10/15 Pepsodent Cola 
>
>>
>> Hi Leo,
>>
>> get_query() function in class AltwordlistView which I refer to as *
>> Filter-5* didn't give me the ordered list result that I wanted.  So
>> somebody on #django IRC helped me to fix that problem by giving me *
>> altword_list()* function which I refer to as *Filter-8*.
>> You can basically ignore all the other Filter codes but I left it there
>> in case it might help you see what I'm trying to do.
>>
>> My main focus right now is to connect the Filter-8 code to my template *
>> altword_list.html* but I don't know how to do it.
>>
>> *urls.py*
>> http://dpaste.com/1417526/
>>
>> *views*
>> http://dpaste.com/1417533/
>>
>> *altword_list.html*
>> http://dpaste.com/1417534/
>>
>>
>>
>>
>>
>> * urls.py
>>
>> from django.conf.urls import patterns, urlfrom navi_polls import 
>> 

Re: ImportError: cannot import name actions

2013-10-16 Thread rok
Hi Ivan, thanks for the response. No. we are not using gunicorn, just 
 apache+mod_wsgi.

moreover, I configured WSGIDaemon option for the host to separate it from 
the rest of the system and still no luck.

Rok

On Wednesday, October 16, 2013 9:39:28 AM UTC+2, the.pa...@gmail.com wrote:
>
> Hi!
>
>  Original Message 
> Subject: Re: ImportError: cannot import name actions
> Date: Wed, 16 Oct 2013 11:26:33 +0400
> From: Ivan Kharlamov 
> To: django-d...@googlegroups.com 
>
> On 10/15/2013 04:56 PM, rok wrote:
> > I have recently been testing the 1.6b4 tag with a new app we are
> > writing, using apache and wsgi. However, I could not get rid of the
> > following issue happening on every request:
> > 
> > ...
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> > "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line
> > 2, in 
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> > django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin,
> > StackedInline, TabularInline, HORIZONTAL, VERTICAL
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> > "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6,
> > in 
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> > django.contrib.admin.sites import AdminSite, site
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> > "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in
> > 
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> > django.contrib.admin import ModelAdmin, actions
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError:
> > cannot import name actions
> > 
> > by doing the following change, I could get rid of what looked like a
> > circular import issue:
> > --- a/django/contrib/admin/sites.py
> > +++ b/django/contrib/admin/sites.py
> > @@ -1,6 +1,7 @@
> >  from functools import update_wrapper
> >  from django.http import Http404, HttpResponseRedirect
> > -from django.contrib.admin import ModelAdmin, actions
> > +from django.contrib.admin import ModelAdmin
> > +from django.contrib.admin.actions import delete_selected
> >  from django.contrib.admin.forms import AdminAuthenticationForm
> >  from django.contrib.auth import REDIRECT_FIELD_NAME
> >  from django.contrib.contenttypes import views as contenttype_views
> > @@ -46,7 +47,7 @@ class AdminSite(object):
> >  self._registry = {}  # model_class class -> admin_class instance
> >  self.name = name
> >  self.app_name = app_name
> > -self._actions = {'delete_selected': actions.delete_selected}
> > +self._actions = {'delete_selected': delete_selected}
> >  self._global_actions = self._actions.copy()
> >  
> >  def register(self, model_or_iterable, admin_class=None, **options):
> > 
> > Switching to 1.5.4 resolves the issue as well (even though the sites.py
> > code is the same). What is more, this did not occur in the development
> > environment when using the runserver run.
> > 
> > Any clue?
>
> Well, if this doesn't happen in the dev environment and does happen in
> production, is there any chance that you're using gunicorn via
> `gunicorn_django` command? If yes, try running the project with
> `gunicorn` command instead.
>
> I have seen some weird import errors which occured only when I was
> running the project with `gunicorn_django` in conjunction with Django
> 1.6, but I didn't take time to debug and report them since
> `gunicorn_django` command is deprecated and switching to `gunicorn`
> command fixed everything.
>
> Still, I have written about them on SO: 
> http://stackoverflow.com/questions/16369354/why-is-gunicorn-django-not-recommended-anymore/16373778#16373778
>
> Hope this helps!
>
> Regards,
> Ivan
>
>

-- 
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/d1a88cb3-19d6-4e6e-8dd7-ec93f7bc4518%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread the . paper . men
Hi!

 Original Message 
Subject: Re: ImportError: cannot import name actions
Date: Wed, 16 Oct 2013 11:26:33 +0400
From: Ivan Kharlamov 
To: django-develop...@googlegroups.com

On 10/15/2013 04:56 PM, rok wrote:
> I have recently been testing the 1.6b4 tag with a new app we are
> writing, using apache and wsgi. However, I could not get rid of the
> following issue happening on every request:
> 
> ...
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line
> 2, in 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin,
> StackedInline, TabularInline, HORIZONTAL, VERTICAL
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6,
> in 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> django.contrib.admin.sites import AdminSite, site
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in
> 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> django.contrib.admin import ModelAdmin, actions
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError:
> cannot import name actions
> 
> by doing the following change, I could get rid of what looked like a
> circular import issue:
> --- a/django/contrib/admin/sites.py
> +++ b/django/contrib/admin/sites.py
> @@ -1,6 +1,7 @@
>  from functools import update_wrapper
>  from django.http import Http404, HttpResponseRedirect
> -from django.contrib.admin import ModelAdmin, actions
> +from django.contrib.admin import ModelAdmin
> +from django.contrib.admin.actions import delete_selected
>  from django.contrib.admin.forms import AdminAuthenticationForm
>  from django.contrib.auth import REDIRECT_FIELD_NAME
>  from django.contrib.contenttypes import views as contenttype_views
> @@ -46,7 +47,7 @@ class AdminSite(object):
>  self._registry = {}  # model_class class -> admin_class instance
>  self.name = name
>  self.app_name = app_name
> -self._actions = {'delete_selected': actions.delete_selected}
> +self._actions = {'delete_selected': delete_selected}
>  self._global_actions = self._actions.copy()
>  
>  def register(self, model_or_iterable, admin_class=None, **options):
> 
> Switching to 1.5.4 resolves the issue as well (even though the sites.py
> code is the same). What is more, this did not occur in the development
> environment when using the runserver run.
> 
> Any clue?

Well, if this doesn't happen in the dev environment and does happen in
production, is there any chance that you're using gunicorn via
`gunicorn_django` command? If yes, try running the project with
`gunicorn` command instead.

I have seen some weird import errors which occured only when I was
running the project with `gunicorn_django` in conjunction with Django
1.6, but I didn't take time to debug and report them since
`gunicorn_django` command is deprecated and switching to `gunicorn`
command fixed everything.

Still, I have written about them on SO: 
http://stackoverflow.com/questions/16369354/why-is-gunicorn-django-not-recommended-anymore/16373778#16373778

Hope this helps!

Regards,
Ivan

-- 
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/7feec2af-b401-49cf-b96e-1132764d2379%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: def altword_list(self, request, word_id):

2013-10-16 Thread Leonardo Giordani
Well, I tried to understand the code. Correct me if I did not understand it:

* you are calling AltwordlistView from r'^altword_list/(?P\d+)/$
* being a DetailedView on Altword, AltwordlistView extracts the Altword
with the given pk with a query like Altword.objects.get(pk=pk)
* you set the context you send to the template, in the get_context_data

There, in get_context_data() you have to initialize all the keywords you
are going to use in the template. In this case poll_list.

Note that you define a get_queryset() method in AltwordlistView, but I
think it is not called in a DetailedView, only ListView uses it.

So I'd fix the whole thing this way:

* get rid of get_queryset()
* get rid of the altword_list() function view
* put something like context['poll_list'] =
Altword.objects.filter(word__pk=word_id).order_by('-votes') in
get_context_data()

If you are trying to show a list of objects, however, I suggest you to try
and use a ListView, where you can define your queryset, as you tried to do
with the get_queryset() method.

Try and let me know if something starts to work. Feel free to ask further
if the matter is not clear.

Cheers,

Leo


Leonardo Giordani
Author of The Digital Cat 
My profile on About.me  - My GitHub
page- My Coderwall
profile 


2013/10/15 Pepsodent Cola 

>
> Hi Leo,
>
> get_query() function in class AltwordlistView which I refer to as *
> Filter-5* didn't give me the ordered list result that I wanted.  So
> somebody on #django IRC helped me to fix that problem by giving me *
> altword_list()* function which I refer to as *Filter-8*.
> You can basically ignore all the other Filter codes but I left it there in
> case it might help you see what I'm trying to do.
>
> My main focus right now is to connect the Filter-8 code to my template *
> altword_list.html* but I don't know how to do it.
>
> *urls.py*
> http://dpaste.com/1417526/
>
> *views*
> http://dpaste.com/1417533/
>
> *altword_list.html*
> http://dpaste.com/1417534/
>
>
>
>
>
> * urls.py
>
> from django.conf.urls import patterns, urlfrom navi_polls import 
> views#___
> urlpatterns = patterns('',
> # ex: /polls/
> url(r'^$', views.IndexView.as_view(), name='index'),
> # ex: /polls/5/
> url(r'^specifics/(?P\d+)/$', views.DetailView.as_view(), 
> name='detail'),
> # ex: /polls/5/results/
> url(r'^(?P\d+)/results/$', views.ResultsView.as_view(), 
> name='results'),
> # ex: /polls/5/vote/
> url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
>
> # ex: /polls/5/
> url(r'^altword_list/(?P\d+)/$', views.AltwordlistView.as_view(), 
> name='altword_list'),)
>
>
>
>
> * views.py
>
> from django.http import HttpResponseRedirectfrom django.shortcuts import 
> render, get_object_or_404from django.core.urlresolvers import reversefrom 
> django.views import genericfrom django.utils import timezone
> from navi_polls.models import Word, 
> Altword#___
> class IndexView(generic.ListView):
> template_name = 'navi_polls/index.html'
> context_object_name = 'latest_poll_list'
>
> def get_queryset(self):# Filter 1
> """Return the last five published polls(not including 
> those set to be published in the future)."""
> return Word.objects.filter(pub_date__lte=timezone.now()
> ).order_by('-pub_date')[:5]
>
> #"""
> #Return the last five published polls
> #(including those set to be published in the future).
> #"""
> #return Word.objects.order_by('-pub_date')[:5]
>
>
> def get_context_data(self, **kwargs):
> context = super(IndexView, self).get_context_data(**kwargs)# Filter 2
> filter_2 = Word.objects.filter(direct_transl_word='')# Filter 4
> filter_4 = Altword.objects.filter(rosword__direct_transl_word='')
>
> context.update({
> "filter_2": filter_2,
> "filter_4": filter_4
> })
> return 
> context#___
>
>
> #___
> class AltwordlistView(generic.DetailView):
> #model = Word
> model = Altword
> template_name = 'navi_polls/altword_list.html'
> context_object_name = 'poll'
>
> def get_queryset(self):
> #"""
>
> #Excludes any polls that aren't published yet.
> #"""
> #return Word.objects.filter(pub_date__lte=timezone.now())
> # Filter 5
> #return Word.objects.filter(direct_transl_word='')
>
> #return Word.objects.filter(direct_transl_word='').order_by('-votes')
>
> return 
> 

DJANGO and SOAP

2013-10-16 Thread Domagoj Kovač
Hi everyone,

I have a problem. For the past few days i have been looking for some good 
SOAP client library and i did not found anything that works properly. The 
problem is that i have some recursive SOAP function and as i saw, suds has 
the problem with this types of things, some other libraries brake on that 
part.

So, is there any really good library that has proper documentation and also 
can work with wsdl? 

-- 
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/72195b69-f159-4b1e-9df0-0b332f5e52d6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Image browsing in django

2013-10-16 Thread Mario Gudelj
I reckon you're not passing request.FILES to your form class together with
request.POST inside your view. Hopefully that's enough info. Typing from a
phone.
On 16/10/2013 6:46 PM, "Harjot Mann"  wrote:

> On Wed, Oct 16, 2013 at 1:06 PM, Harjot Mann 
> wrote:
> >
> > No same problem,please help me...please help me...please help me..I
> > have posted this mail 5 days ago and no one is able to solve my
> > problem. :( I am really disappointed :(
>
>
> Please tell me the solution. I have to complete my work soon. please.
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
> Daily Dairy: http://harjotmann.wordpress.com/daily-diary/
>
> --
> 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/CAB0GQhBv_WoQC-jrQ887tJmd1qzqW6gj%2BiSv9c_Z0JexdaEu-A%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/CAHqTbjmqdEJ5%2BjCH2o9mRe6Y_8nAY6b3YZ%3DUNvMEw08u0FbhQw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Image browsing in django

2013-10-16 Thread Harjot Mann
On Wed, Oct 16, 2013 at 1:06 PM, Harjot Mann  wrote:
>
> No same problem,please help me...please help me...please help me..I
> have posted this mail 5 days ago and no one is able to solve my
> problem. :( I am really disappointed :(


Please tell me the solution. I have to complete my work soon. please.

-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

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


Re: New to Django

2013-10-16 Thread Sithembewena Lloyd Dube
Hey guys,

For those asking how to setup databases with Django, all this is covered in
the section on how to install Django on the main website.

https://docs.djangoproject.com/en/1.5/intro/install/
and, more specifically,
https://docs.djangoproject.com/en/1.5/topics/install/#database-installation

Cheers.


On Wed, Oct 16, 2013 at 5:04 AM, Bryan Kim Artificio <
bryankim.artifi...@gmail.com> wrote:

> HI,
>
> good day!
>
> i would like to know id there's a way to connect the postgresSQL with
> django?
>
> regards,
>
>
> On Tuesday, October 15, 2013 1:55:01 PM UTC+8, Mahantesh U wrote:
>>
>> Hi All,
>>
>>   I am new to Django framework. I worked on Flask framework using python.
>> Please share the sites to learn Django easily.
>>
>> Thanks
>> Mahantesh
>>
>  --
> 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/d6099d99-2967-4686-b20a-7be9d2257327%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Regards,
Sithu Lloyd Dube

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+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/CAH-SnCBByhWds5xaMMQk7d6U%2BtQp744Pf%2Bgph_O4J-t_CF-u3A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django data to Javascript

2013-10-16 Thread drakko
Thanks for help. I will try some of these ideas :)

I don't understand why you are JSON encoding form.field_mapping for the 
> fields template variable.
>
This was like that when I got this code. I am just continuing to develop 
this app. 

But accessing should_have_found_list in template has no problems. I have 
separate JS file that contains functions (event handlers for buttons etc.). 
I can't figure out (total newbie in JS :D ) how to access (or pass) 
should_have_found_list there. (Sorry I wasn't clear enough in my first post)

Drakko

otrdiena, 2013. gada 15. oktobris 18:02:43 UTC+2, larry@gmail.com 
rakstīja:
>
> On Tue, Oct 15, 2013 at 9:54 AM, Scot Hacker  > wrote:
>
>>
>>
>> On Tuesday, October 15, 2013 8:45:09 AM UTC-7, larry@gmail.com wrote:
>>>
>>>  

>>> You can embed js anywhere in your template, e.g.:
>>>
>>> {% for shbf in should_have_found_list %}
>>> 
>>> my_js_function(shbf);
>>> 
>>> {% endfor %} 
>>>
>>
>> I think you meant to write:
>>
>> my_js_function({{shbf}});
>>
>
> Yes - not enough coffee yet.
>  
>
>>
>> Another take on this, should you need it, is to send JSON directly over 
>> from the django view or model method into the template. Here's how I solved 
>> that recently:
>>
>> importance_options = 
>> json.dumps(dict(BundleNode.importance_options))
>>
>> That will convert a Django queryset into a JSON object. Then, in your JS 
>> template, something like:
>>
>> var $options_obj = {{importance_options|safe}};
>>
>> Season to taste.
>>
>> ./s
>>
>>  
>
otrdiena, 2013. gada 15. oktobris 18:02:43 UTC+2, larry@gmail.com 
rakstīja:
>
> On Tue, Oct 15, 2013 at 9:54 AM, Scot Hacker  > wrote:
>
>>
>>
>> On Tuesday, October 15, 2013 8:45:09 AM UTC-7, larry@gmail.com wrote:
>>>
>>>  

>>> You can embed js anywhere in your template, e.g.:
>>>
>>> {% for shbf in should_have_found_list %}
>>> 
>>> my_js_function(shbf);
>>> 
>>> {% endfor %} 
>>>
>>
>> I think you meant to write:
>>
>> my_js_function({{shbf}});
>>
>
> Yes - not enough coffee yet.
>  
>
>>
>> Another take on this, should you need it, is to send JSON directly over 
>> from the django view or model method into the template. Here's how I solved 
>> that recently:
>>
>> importance_options = 
>> json.dumps(dict(BundleNode.importance_options))
>>
>> That will convert a Django queryset into a JSON object. Then, in your JS 
>> template, something like:
>>
>> var $options_obj = {{importance_options|safe}};
>>
>> Season to taste.
>>
>> ./s
>>
>>  
>
otrdiena, 2013. gada 15. oktobris 18:02:43 UTC+2, larry@gmail.com 
rakstīja:
>
> On Tue, Oct 15, 2013 at 9:54 AM, Scot Hacker  > wrote:
>
>>
>>
>> On Tuesday, October 15, 2013 8:45:09 AM UTC-7, larry@gmail.com wrote:
>>>
>>>  

>>> You can embed js anywhere in your template, e.g.:
>>>
>>> {% for shbf in should_have_found_list %}
>>> 
>>> my_js_function(shbf);
>>> 
>>> {% endfor %} 
>>>
>>
>> I think you meant to write:
>>
>> my_js_function({{shbf}});
>>
>
> Yes - not enough coffee yet.
>  
>
>>
>> Another take on this, should you need it, is to send JSON directly over 
>> from the django view or model method into the template. Here's how I solved 
>> that recently:
>>
>> importance_options = 
>> json.dumps(dict(BundleNode.importance_options))
>>
>> That will convert a Django queryset into a JSON object. Then, in your JS 
>> template, something like:
>>
>> var $options_obj = {{importance_options|safe}};
>>
>> Season to taste.
>>
>> ./s
>>
>>  
>
otrdiena, 2013. gada 15. oktobris 18:02:43 UTC+2, larry@gmail.com 
rakstīja:
>
> On Tue, Oct 15, 2013 at 9:54 AM, Scot Hacker  > wrote:
>
>>
>>
>> On Tuesday, October 15, 2013 8:45:09 AM UTC-7, larry@gmail.com wrote:
>>>
>>>  

>>> You can embed js anywhere in your template, e.g.:
>>>
>>> {% for shbf in should_have_found_list %}
>>> 
>>> my_js_function(shbf);
>>> 
>>> {% endfor %} 
>>>
>>
>> I think you meant to write:
>>
>> my_js_function({{shbf}});
>>
>
> Yes - not enough coffee yet.
>  
>
>>
>> Another take on this, should you need it, is to send JSON directly over 
>> from the django view or model method into the template. Here's how I solved 
>> that recently:
>>
>> importance_options = 
>> json.dumps(dict(BundleNode.importance_options))
>>
>> That will convert a Django queryset into a JSON object. Then, in your JS 
>> template, something like:
>>
>> var $options_obj = {{importance_options|safe}};
>>
>> Season to taste.
>>
>> ./s
>>
>>  
>

-- 
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 

Re: Image browsing in django

2013-10-16 Thread Harjot Mann
On Wed, Oct 16, 2013 at 12:51 PM, Sanjay Bhangar
 wrote:
> It is enctype='multipart/form-data' and not encoding='multipart/form-data'
>
> Hope that helps - all the best,
> Sanjay


No same problem,please help me...please help me...please help me..I
have posted this mail 5 days ago and no one is able to solve my
problem. :( I am really disappointed :(

-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

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


Re: New to Django

2013-10-16 Thread Nigel Legg
Yes - there is a section in the tutorials and documentation on connecting
to databases, including PostgreSQL.

Cheers, Nigel
07914 740972



On 16 October 2013 04:04, Bryan Kim Artificio
wrote:

> HI,
>
> good day!
>
> i would like to know id there's a way to connect the postgresSQL with
> django?
>
> regards,
>
> On Tuesday, October 15, 2013 1:55:01 PM UTC+8, Mahantesh U wrote:
>>
>> Hi All,
>>
>>   I am new to Django framework. I worked on Flask framework using python.
>> Please share the sites to learn Django easily.
>>
>> Thanks
>> Mahantesh
>>
>  --
> 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/d6099d99-2967-4686-b20a-7be9d2257327%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/CADeX7vxKFE1v%2BQUjRuMpPS5EKAnOb6-tPtq%3DrY4O25J28eubLg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Image browsing in django

2013-10-16 Thread Sanjay Bhangar
Harjot,

It is enctype='multipart/form-data' and not encoding='multipart/form-data'

Hope that helps - all the best,
Sanjay

On Wed, Oct 16, 2013 at 10:11 AM, Harjot Mann  wrote:
> On Mon, Oct 14, 2013 at 9:48 PM, Harjot Mann  wrote:
>> I have not done anything special in views..it just contains a simple
>> form saving code.
>> Should I need to do anything there?
>
>
> Please reply. I am waiting :(
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
> Daily Dairy: http://harjotmann.wordpress.com/daily-diary/
>
> --
> 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/CAB0GQhDC1MstEPp3LD_zgdAS0QMsoL3p-2pO3HhRvu6OPW14mQ%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/CAG3W7ZESsGnKdaC3_oSjk2JwtG-eriR_HKLbS5G29BEcVWnhuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: deploy ?

2013-10-16 Thread Diogene Laerce




You can use nxinx with uwsgi even with several domain names, nginx 
takes care of that, you just run several uwsgi/gunicorn processes on 
different tcp ports or unix sockets, and nginx will just select the 
one that fits for its domain name (set in config) of course you need 
to set it properly..


Anyways, when you want to host multiple python sites with 
nginx/something, I'd recommend uwsgi with supervisor .. which will 
help you manage the apps really easy ... of course you can use 
gunicorn instead of uwsgi ... it is up to you ...


So I will go for : nginx + uwsgi + supervisor + django !


Ok everything runs fine now ! Except :..

If I well understood uwsgi is supposed to update every code changes so
that I don't need to restart the all bundle but it still does not work : 
I do

need to restart everything ? Actually I need to kill all processes first and
after restart everything ?

/debian squeeze + nginx 1.2.1 (extra package) + uwsgi 1.9.18.1 +
supervisor 3.0a.8/

--
“One original thought is worth a thousand mindless quotings.”
“Le vrai n'est pas plus sûr que le probable.”

  Diogene Laerce

--
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/525E301D.4000108%40yahoo.fr.
For more options, visit https://groups.google.com/groups/opt_out.