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_nam

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" % vie

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 wil

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

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 err

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

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 an

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 vi

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 be

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 fou

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 w

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

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

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 ta

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 vie

I screwed up my django site using touch

2013-03-07 Thread frocco
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 webfac