get Django url content with urllib2

2011-08-11 Thread Igor Nemilentsev
Hello everyone. I try: content = urllib2.urlopen('http://localhost:8080/').read() from inside some Django view(function) and http://localhost:8080/ is same Django server. This command do not give me any answer but hang on. But if url is foreign it is working. Is there some cycle problem? Is it

Re: Django 1.3 - Question about static files

2011-03-26 Thread Igor Nemilentsev
On 26-03-2011, Sandro Dutra wrote: >Hello everyone! >I'm using Python 2.7.x with Django 1.3 and I've some questions about >the new way to set the static files for the dev server. >abspath = lambda *p: os.path.abspath(os.path.join(*p)) >PROJECT_ROOT = abspath(os.path.dirname(__file__)) >(...) >ME

request in model

2011-03-14 Thread Igor Nemilentsev
I am new in Django. I am looking for a solution for my problem. I want to have a base model class inheriting all other model classes from that class. In the base model class I want to check some permissions for users. So, need pass request to model class so that to have request.user.