Re: I screwed up my django site using touch

2013-03-08 Thread frocco
Thanks Sam

On Friday, March 8, 2013 2:13:36 PM UTC-5, Sam Solomon wrote:
>
> Here is something that may help:
>
> import importlib
>
> from django.conf import settings
>
> for app in settings.INSTALLED_APPS:
> views_name = "%s.views" % app
> try:
> importlib.import_module(views_name)
> except ImportError:
> pass
> except:
> print "Could not import %s" % views_name
> raise
>
> (This is assuming all views are named views.py and in the root of your 
> "installed apps")
>
> I just ran this from django shell but you could also make it a management 
> command.
>
> On Thursday, March 7, 2013 7:45:19 AM UTC-8, ke1g wrote:
>>
>> And a last stop gap, assuming the server is *nix, the find command will 
>> find all files
>> with changes newer than a given time (though the syntax can be squirrelly.
>>
>> On Thu, Mar 7, 2013 at 10:42 AM, Shawn Milochik wrote:
>>
>>> On Thu, Mar 7, 2013 at 10:38 AM, frocco  wrote:
>>> > Thanks you, I think I will only use Pycharm now to help prevent this 
>>> issue
>>> > again.
>>> > I hope future versions will offer better trace.
>>>
>>>
>>> Even better, use version control, such as git. Then your editor will
>>> be irrelevant and it will be trivial to find and revert any changes.
>>>
>>> --
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>

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




Re: I screwed up my django site using touch

2013-03-08 Thread Sam Solomon
Here is something that may help:

import importlib

from django.conf import settings

for app in settings.INSTALLED_APPS:
views_name = "%s.views" % app
try:
importlib.import_module(views_name)
except ImportError:
pass
except:
print "Could not import %s" % views_name
raise

(This is assuming all views are named views.py and in the root of your 
"installed apps")

I just ran this from django shell but you could also make it a management 
command.

On Thursday, March 7, 2013 7:45:19 AM UTC-8, ke1g wrote:
>
> And a last stop gap, assuming the server is *nix, the find command will 
> find all files
> with changes newer than a given time (though the syntax can be squirrelly.
>
> On Thu, Mar 7, 2013 at 10:42 AM, Shawn Milochik 
>  > wrote:
>
>> On Thu, Mar 7, 2013 at 10:38 AM, frocco  
>> wrote:
>> > Thanks you, I think I will only use Pycharm now to help prevent this 
>> issue
>> > again.
>> > I hope future versions will offer better trace.
>>
>>
>> Even better, use version control, such as git. Then your editor will
>> be irrelevant and it will be trivial to find and revert any changes.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread Bill Freeman
And a last stop gap, assuming the server is *nix, the find command will
find all files
with changes newer than a given time (though the syntax can be squirrelly.

On Thu, Mar 7, 2013 at 10:42 AM, Shawn Milochik  wrote:

> On Thu, Mar 7, 2013 at 10:38 AM, frocco  wrote:
> > Thanks you, I think I will only use Pycharm now to help prevent this
> issue
> > again.
> > I hope future versions will offer better trace.
>
>
> Even better, use version control, such as git. Then your editor will
> be irrelevant and it will be trivial to find and revert any changes.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread Shawn Milochik
On Thu, Mar 7, 2013 at 10:38 AM, frocco  wrote:
> Thanks you, I think I will only use Pycharm now to help prevent this issue
> again.
> I hope future versions will offer better trace.


Even better, use version control, such as git. Then your editor will
be irrelevant and it will be trivial to find and revert any changes.

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




Re: I screwed up my django site using touch

2013-03-07 Thread frocco
Thanks you, I think I will only use Pycharm now to help prevent this issue 
again.
I hope future versions will offer better trace.

On Thursday, March 7, 2013 10:14:38 AM UTC-5, ke1g wrote:
>
> Yes.  I'm not happy with the stack trace either.  The trouble is that the 
> import mechanism got the error, and
> it does not deign to mention the file path or even the module path.  That 
> is potentially a shortcoming in Django,
> since django.utils.importlib presumably could have caught this exception 
> and decorated the error message
> with better file information.
>
> As far as this instance goes, you may or may not get better information 
> under runserver, assuming that you
> have shell access to the server.  If you truely can't figure out what 
> view.py you changed at or before line 29,
> you can always patch 
> /home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py to provide 
> you
> with better information (I'd stick in a try-except and put a 
> pdb.set_trace() in the except path and go under
> runserver, but printing to sys.stderr or, if logging is configured, error 
> level logging, may serve you better.
>
> Bill
>
> On Thu, Mar 7, 2013 at 9:58 AM, frocco wrote:
>
>> The problem with the stack trace, is that I could not tell what views.py 
>> it was talking about.
>> I use PyCharm, but at work I think I used notepad++ to make a quick 
>> change.
>>
>> I understand now that is is a python problem, but what bothers me is that 
>> I could not resolve it via the trace.
>> I may have been reading it wrong, but nothing it said pointed me to the 
>> views.py that was in error.
>> I wish I had the full trace again so I could post it.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread frocco
Thanks, I did not know this.

On Thursday, March 7, 2013 10:01:28 AM UTC-5, Roberto López López wrote:
>
>
> If you are using pycharm, you just need to use the local history to 
> check which indents you have changed. 
>
> (right click over the file you want to check - local history - show 
> history - ...) 
>
>
> On 03/07/2013 03:58 PM, frocco wrote: 
> > The problem with the stack trace, is that I could not tell what views.py 
> > it was talking about. 
> > I use PyCharm, but at work I think I used notepad++ to make a quick 
> change. 
> > 
> > I understand now that is is a python problem, but what bothers me is 
> > that I could not resolve it via the trace. 
> > I may have been reading it wrong, but nothing it said pointed me to the 
> > views.py that was in error. 
> > I wish I had the full trace again so I could post it. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
>
>
>
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread Bill Freeman
Yes.  I'm not happy with the stack trace either.  The trouble is that the
import mechanism got the error, and
it does not deign to mention the file path or even the module path.  That
is potentially a shortcoming in Django,
since django.utils.importlib presumably could have caught this exception
and decorated the error message
with better file information.

As far as this instance goes, you may or may not get better information
under runserver, assuming that you
have shell access to the server.  If you truely can't figure out what
view.py you changed at or before line 29,
you can always patch
/home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py to provide
you
with better information (I'd stick in a try-except and put a
pdb.set_trace() in the except path and go under
runserver, but printing to sys.stderr or, if logging is configured, error
level logging, may serve you better.

Bill

On Thu, Mar 7, 2013 at 9:58 AM, frocco  wrote:

> The problem with the stack trace, is that I could not tell what views.py
> it was talking about.
> I use PyCharm, but at work I think I used notepad++ to make a quick change.
>
> I understand now that is is a python problem, but what bothers me is that
> I could not resolve it via the trace.
> I may have been reading it wrong, but nothing it said pointed me to the
> views.py that was in error.
> I wish I had the full trace again so I could post it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread Roberto López López

If you are using pycharm, you just need to use the local history to
check which indents you have changed.

(right click over the file you want to check - local history - show
history - ...)


On 03/07/2013 03:58 PM, frocco wrote:
> The problem with the stack trace, is that I could not tell what views.py
> it was talking about.
> I use PyCharm, but at work I think I used notepad++ to make a quick change.
> 
> I understand now that is is a python problem, but what bothers me is
> that I could not resolve it via the trace.
> I may have been reading it wrong, but nothing it said pointed me to the
> views.py that was in error.
> I wish I had the full trace again so I could post it.
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  



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




Re: I screwed up my django site using touch

2013-03-07 Thread frocco
The problem with the stack trace, is that I could not tell what views.py it 
was talking about.
I use PyCharm, but at work I think I used notepad++ to make a quick change.

I understand now that is is a python problem, but what bothers me is that I 
could not resolve it via the trace.
I may have been reading it wrong, but nothing it said pointed me to the 
views.py that was in error.
I wish I had the full trace again so I could post it.

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




Re: I screwed up my django site using touch

2013-03-07 Thread Bill Freeman
It's not a Django thing.  It is a python thing.

Python, as you probably know, determines statement nesting by the amount
that the line is indented, that is, the width of the whitespace between the
beginning of the line and the first non-whitespace character.

The error message says that it has found a line that is indented less than
the (most recent non-empty, non-comment) line before it, and the amount
that it is indented is not the same as any line before it since the most
recent line that is indented less than it is.

Basically, python  can't tell which block the statement is part of.

You must nest all statements that are part of the same block by exactly the
same amount.

if some_condition:
a = b
  b = 3

In the above code the b = 3 line would trigger this exception.  The a = b
line defines the indentation level for the block controlled by the if (8
spaces).  So is the b = 3 line supposed to be in the if block or not?  If
it were indented 8 spaces, it would be controlled by the condition.  If it
were indented 4 spaces, like the if, it would be after the end of the if
block, that is, it would be executed regardless of the condition.  But it
is indented 6 spaces, and python objects.

A common problem leading to errors like this is using an editor you are not
familiar with, or one that is not correctly configured for editing python
(such as making a "quick change" on the server using vi or vim).  This
occurs because of varying treatment of the TAB key, and of TAB characters
in the file.  My editors are all configured to insert enough spaces to get
to the next multiple of 4, the indentation step that I like) when I press
the TAB key, at least when they are editing a file with extension ".py".
If there are and TAB characters in the file, they display that as taking
you to the next multiple of 8 columns, because that is how python
interprets them, unless you jump through some small hoops to tell it
otherwise (bad idea if there is any possibility that someone else will ever
edit or read your file).  (8 is the tradition default ASCII tab stop from
the 1960s, if not longer.)  Sadly, many modern editors (including modern
default configurations of vi and vim) have taken to believing that tabstops
occur every 4 columns, and that they can achieve them with TAB characters,
rather than the equivalent number of spaces.

So if the "if" statement in the code above were indented using a TAB
character, and the editor displayed that as going the fourth column, and
the a = b line were indented with two TAB characters, being displayed as
going to the eighth column, and the b = 3 line were indented with one TAB
character and four spaces, it would appear to be indented exactly the same
as the a = b line.  But python, by default, would interpret the "if" as
being indented by 8 columns, the a = b line by 16 columns, and the b = 3
line by 12 columns, and you would see the kind of indentation error you are
getting for the b = 3 line, despite the fact that it "looks right" in your
editor.

So configure your python editors to always convert TAB characters in files
to the corresponding number of spaces (either when read or when written),
to always display TAB characters as taking you to the next multiple of 8
columns, and to interpret the TAB key as meaning to insert spaces only to
take you to your favorite indentation step (I suggest 4 columns, but tastes
vary).  (vim can certainly be configured like this, emacs's python mode is
like this by default, and any programing editor that knows about python
should  do this too.  The editor built into idle, which comes with windows
python, and can be installed on other systems, does this as well, but it's
a wimpy editor.)  That way if you ever have to edit your file on an
unfamiliar editor, it will look right, and if you avoid the TAB key and
manually insert or remove the correct number of spaces, things will
continue to work.

Bill

On Thu, Mar 7, 2013 at 9:06 AM, frocco  wrote:

> I do not understand what the error indentation means.
> I am new to django, coming from PHP.
> I was using touch, because unlike PHP, I wanted changes to show without
> kicking users off.
> now I am afraid to use touch.
>
>
> On Thursday, March 7, 2013 8:54:15 AM UTC-5, Roberto López López wrote:
>
>>
>> Check the history of the files you've touched, and rollback all
>> indentation changes.
>>
>>
>>
>> On 03/07/2013 02:49 PM, frocco wrote:
>> > Hello,
>> >
>> > I am not sure what happened, I did a touch wsgi and then a touch
>> wsgi.py
>> > I got an error afterwards and could not recover from it. I could not
>> > find the views.py it was complaining about.
>> > I tried to reload the site from a backup and still had errors. I ended
>> > up recreating the site on webfaction and uploading each app until it
>> was
>> > working.
>> >
>> >
>> >   IndentationError at /
>> >
>> > unindent does not match any outer indentation level (views.py, line 29)
>> >
>> > Django Version:

Re: I screwed up my django site using touch

2013-03-07 Thread j_syk
It's not a problem with wsgi. The problem is incorrect syntax in line 29 of 
your views.py file. Check that line and make sure that each line is at the 
same indentation or is properly indented (4 spaces). If you can't figure 
this out, post a couple lines from that area of your views.py file and we 
can help with the syntax and formatting.


On Thursday, March 7, 2013 8:06:04 AM UTC-6, frocco wrote:
>
> I do not understand what the error indentation means.
> I am new to django, coming from PHP.
> I was using touch, because unlike PHP, I wanted changes to show without 
> kicking users off.
> now I am afraid to use touch.
>
>
> On Thursday, March 7, 2013 8:54:15 AM UTC-5, Roberto López López wrote:
>>
>>
>> Check the history of the files you've touched, and rollback all 
>> indentation changes. 
>>
>>
>>
>> On 03/07/2013 02:49 PM, frocco wrote: 
>> > Hello, 
>> > 
>> > I am not sure what happened, I did a touch wsgi and then a touch 
>> wsgi.py 
>> > I got an error afterwards and could not recover from it. I could not 
>> > find the views.py it was complaining about. 
>> > I tried to reload the site from a backup and still had errors. I ended 
>> > up recreating the site on webfaction and uploading each app until it 
>> was 
>> > working. 
>> > 
>> > 
>> >   IndentationError at / 
>> > 
>> > unindent does not match any outer indentation level (views.py, line 29) 
>> > 
>> > Django Version:1.5 
>> > Exception Type:IndentationError 
>> > Exception Value: 
>> > 
>> > unindent does not match any outer indentation level (views.py, line 29) 
>> > 
>> > Exception Location: 
>> > /home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py in 
>> > import_module, line 35 
>> > Python Executable:/usr/local/bin/python 
>> > Python Version:2.7.3 
>> > Python Path: 
>> > 
>> > ['/home/frocco/webapps/ntw', 
>> >  '/home/frocco/webapps/ntw/myproject', 
>> >  '/home/frocco/webapps/ntw/lib/python2.7', 
>> >  '/home/frocco/lib/python2.7/pip-1.2.1-py2.7.egg', 
>> >  '/home/frocco/lib/python2.7', 
>> >  '/usr/local/lib/python27.zip', 
>> >  '/usr/local/lib/python2.7', 
>> >  '/usr/local/lib/python2.7/plat-linux2', 
>> >  '/usr/local/lib/python2.7/lib-tk', 
>> >  '/usr/local/lib/python2.7/lib-old', 
>> >  '/usr/local/lib/python2.7/lib-dynload', 
>> >  '/usr/local/lib/python2.7/site-packages', 
>> >  '/usr/local/lib/python2.7/site-packages/PIL'] 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> > Groups "Django users" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> > an email to django-users...@googlegroups.com. 
>> > To post to this group, send email to django...@googlegroups.com. 
>> > Visit this group at http://groups.google.com/group/django-users?hl=en. 
>> > For more options, visit https://groups.google.com/groups/opt_out. 
>> >   
>> >   
>>
>>
>> -- 
>> Kind regards, 
>>
>> Roberto L�pez L�pez 
>>
>>
>> System Developer 
>> Parallab, Uni Computing 
>> H�yteknologisenteret, Thorm�hlensgate 55 
>> N-5008 Bergen, Norway 
>> Tel:(+47) 555 84091 
>>
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread Roberto López López


In python indentation really matters. Two consecutive lines, with
different indentation, do not belong to the same execution block. So:

def function(self):
   this_code_belong_to_the_function()
   this_code_also()
   if(True):
   this_as_well()
this_doesnt()

And code indented using tabs is not the same as code indented with
spaces. For sake of simplicity, people tend to use just 4 spaces instead
of tabs (somebody mentioned that some days ago on the mailing list if I
remember well). You can configure that in your editor/ide.





On 03/07/2013 03:06 PM, frocco wrote:
> I do not understand what the error indentation means.
> I am new to django, coming from PHP.
> I was using touch, because unlike PHP, I wanted changes to show without
> kicking users off.
> now I am afraid to use touch.
> 
> 
> On Thursday, March 7, 2013 8:54:15 AM UTC-5, Roberto López López wrote:
> 
> 
> Check the history of the files you've touched, and rollback all
> indentation changes.
> 
> 
> 
> On 03/07/2013 02:49 PM, frocco wrote:
> > Hello,
> >
> > I am not sure what happened, I did a touch wsgi and then a touch
> wsgi.py
> > I got an error afterwards and could not recover from it. I could not
> > find the views.py it was complaining about.
> > I tried to reload the site from a backup and still had errors. I
> ended
> > up recreating the site on webfaction and uploading each app until
> it was
> > working.
> >
> >
> >   IndentationError at /
> >
> > unindent does not match any outer indentation level (views.py,
> line 29)
> >
> > Django Version:1.5
> > Exception Type:IndentationError
> > Exception Value:
> >
> > unindent does not match any outer indentation level (views.py,
> line 29)
> >
> > Exception Location:
> > /home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py in
> > import_module, line 35
> > Python Executable:/usr/local/bin/python
> > Python Version:2.7.3
> > Python Path:
> >
> > ['/home/frocco/webapps/ntw',
> >  '/home/frocco/webapps/ntw/myproject',
> >  '/home/frocco/webapps/ntw/lib/python2.7',
> >  '/home/frocco/lib/python2.7/pip-1.2.1-py2.7.egg',
> >  '/home/frocco/lib/python2.7',
> >  '/usr/local/lib/python27.zip',
> >  '/usr/local/lib/python2.7',
> >  '/usr/local/lib/python2.7/plat-linux2',
> >  '/usr/local/lib/python2.7/lib-tk',
> >  '/usr/local/lib/python2.7/lib-old',
> >  '/usr/local/lib/python2.7/lib-dynload',
> >  '/usr/local/lib/python2.7/site-packages',
> >  '/usr/local/lib/python2.7/site-packages/PIL']
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to django-users...@googlegroups.com .
> > To post to this group, send email to django...@googlegroups.com
> .
> > Visit this group at
> http://groups.google.com/group/django-users?hl=en
> .
> > For more options, visit https://groups.google.com/groups/opt_out
> .
> >  
> >  
> 
> 
> -- 
> Kind regards,
> 
> Roberto L�pez L�pez
> 
> 
> System Developer
> Parallab, Uni Computing
> H�yteknologisenteret, Thorm�hlensgate 55
> N-5008 Bergen, Norway
> Tel:(+47) 555 84091
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  


-- 
Kind regards,

Roberto López López


System Developer
Parallab, Uni Computing
Høyteknologisenteret, Thormøhlensgate 55
N-5008 Bergen, Norway
Tel:(+47) 555 84091

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




Re: I screwed up my django site using touch

2013-03-07 Thread frocco
I do not understand what the error indentation means.
I am new to django, coming from PHP.
I was using touch, because unlike PHP, I wanted changes to show without 
kicking users off.
now I am afraid to use touch.


On Thursday, March 7, 2013 8:54:15 AM UTC-5, Roberto López López wrote:
>
>
> Check the history of the files you've touched, and rollback all 
> indentation changes. 
>
>
>
> On 03/07/2013 02:49 PM, frocco wrote: 
> > Hello, 
> > 
> > I am not sure what happened, I did a touch wsgi and then a touch wsgi.py 
> > I got an error afterwards and could not recover from it. I could not 
> > find the views.py it was complaining about. 
> > I tried to reload the site from a backup and still had errors. I ended 
> > up recreating the site on webfaction and uploading each app until it was 
> > working. 
> > 
> > 
> >   IndentationError at / 
> > 
> > unindent does not match any outer indentation level (views.py, line 29) 
> > 
> > Django Version:1.5 
> > Exception Type:IndentationError 
> > Exception Value: 
> > 
> > unindent does not match any outer indentation level (views.py, line 29) 
> > 
> > Exception Location: 
> > /home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py in 
> > import_module, line 35 
> > Python Executable:/usr/local/bin/python 
> > Python Version:2.7.3 
> > Python Path: 
> > 
> > ['/home/frocco/webapps/ntw', 
> >  '/home/frocco/webapps/ntw/myproject', 
> >  '/home/frocco/webapps/ntw/lib/python2.7', 
> >  '/home/frocco/lib/python2.7/pip-1.2.1-py2.7.egg', 
> >  '/home/frocco/lib/python2.7', 
> >  '/usr/local/lib/python27.zip', 
> >  '/usr/local/lib/python2.7', 
> >  '/usr/local/lib/python2.7/plat-linux2', 
> >  '/usr/local/lib/python2.7/lib-tk', 
> >  '/usr/local/lib/python2.7/lib-old', 
> >  '/usr/local/lib/python2.7/lib-dynload', 
> >  '/usr/local/lib/python2.7/site-packages', 
> >  '/usr/local/lib/python2.7/site-packages/PIL'] 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
>
>
> -- 
> Kind regards, 
>
> Roberto L�pez L�pez 
>
>
> System Developer 
> Parallab, Uni Computing 
> H�yteknologisenteret, Thorm�hlensgate 55 
> N-5008 Bergen, Norway 
> Tel:(+47) 555 84091 
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread Bill Freeman
You were, I presume, touching wsgi to force a reload, in order to pick up
recent changes that you made.  One of those recent changes was to some
view.py (sadly the statcktrace doesn't tell us which one, but it's one that
you recently changed), and you made an indentation error (perhaps you let a
tab character slip into the file?), on line 29, when you changed it.

On Thu, Mar 7, 2013 at 8:54 AM, Roberto López López wrote:

>
> Check the history of the files you've touched, and rollback all
> indentation changes.
>
>
>
> On 03/07/2013 02:49 PM, frocco wrote:
> > Hello,
> >
> > I am not sure what happened, I did a touch wsgi and then a touch wsgi.py
> > I got an error afterwards and could not recover from it. I could not
> > find the views.py it was complaining about.
> > I tried to reload the site from a backup and still had errors. I ended
> > up recreating the site on webfaction and uploading each app until it was
> > working.
> >
> >
> >   IndentationError at /
> >
> > unindent does not match any outer indentation level (views.py, line 29)
> >
> > Django Version:   1.5
> > Exception Type:   IndentationError
> > Exception Value:
> >
> > unindent does not match any outer indentation level (views.py, line 29)
> >
> > Exception Location:
> > /home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py in
> > import_module, line 35
> > Python Executable:/usr/local/bin/python
> > Python Version:   2.7.3
> > Python Path:
> >
> > ['/home/frocco/webapps/ntw',
> >  '/home/frocco/webapps/ntw/myproject',
> >  '/home/frocco/webapps/ntw/lib/python2.7',
> >  '/home/frocco/lib/python2.7/pip-1.2.1-py2.7.egg',
> >  '/home/frocco/lib/python2.7',
> >  '/usr/local/lib/python27.zip',
> >  '/usr/local/lib/python2.7',
> >  '/usr/local/lib/python2.7/plat-linux2',
> >  '/usr/local/lib/python2.7/lib-tk',
> >  '/usr/local/lib/python2.7/lib-old',
> >  '/usr/local/lib/python2.7/lib-dynload',
> >  '/usr/local/lib/python2.7/site-packages',
> >  '/usr/local/lib/python2.7/site-packages/PIL']
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users?hl=en.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
>
> --
> Kind regards,
>
> Roberto López López
>
>
> System Developer
> Parallab, Uni Computing
> Høyteknologisenteret, Thormøhlensgate 55
> N-5008 Bergen, Norway
> Tel:(+47) 555 84091
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: I screwed up my django site using touch

2013-03-07 Thread Roberto López López

Check the history of the files you've touched, and rollback all
indentation changes.



On 03/07/2013 02:49 PM, frocco wrote:
> Hello,
> 
> I am not sure what happened, I did a touch wsgi and then a touch wsgi.py
> I got an error afterwards and could not recover from it. I could not
> find the views.py it was complaining about.
> I tried to reload the site from a backup and still had errors. I ended
> up recreating the site on webfaction and uploading each app until it was
> working.
> 
> 
>   IndentationError at /
> 
> unindent does not match any outer indentation level (views.py, line 29)
> 
> Django Version:   1.5
> Exception Type:   IndentationError
> Exception Value:  
> 
> unindent does not match any outer indentation level (views.py, line 29)
> 
> Exception Location:
> /home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py in
> import_module, line 35
> Python Executable:/usr/local/bin/python
> Python Version:   2.7.3
> Python Path:  
> 
> ['/home/frocco/webapps/ntw',
>  '/home/frocco/webapps/ntw/myproject',
>  '/home/frocco/webapps/ntw/lib/python2.7',
>  '/home/frocco/lib/python2.7/pip-1.2.1-py2.7.egg',
>  '/home/frocco/lib/python2.7',
>  '/usr/local/lib/python27.zip',
>  '/usr/local/lib/python2.7',
>  '/usr/local/lib/python2.7/plat-linux2',
>  '/usr/local/lib/python2.7/lib-tk',
>  '/usr/local/lib/python2.7/lib-old',
>  '/usr/local/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/site-packages',
>  '/usr/local/lib/python2.7/site-packages/PIL']
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  


-- 
Kind regards,

Roberto López López


System Developer
Parallab, Uni Computing
Høyteknologisenteret, Thormøhlensgate 55
N-5008 Bergen, Norway
Tel:(+47) 555 84091

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