#myuserapp/models.py
class MyUser(AbstractUser):
....
#app1/models.py
from myuserapp.models import MyUser
class MyThingInApp1(models.Model):
user = models.ForeignKey(MyUser)
....
#app2/models.py
from myuserapp.models import MyUser
class MyThingInApp2(models.Model):
user = models.ForeignKey(MyUser)
def delay(self, seconds):
return gen.Task(ioloop.IOLoop.instance().add_timeout, time.time() + seconds)
@gen.coroutine
def foo(self):
yield self.delay(5)
class AsyncHandler(RequestHandler):
@asynchronous
def get(self):
http_client = AsyncHTTPClient()
http_client.fetch("http://example.com",
callback=self.on_fetch)
def on_fetch(self, response):
do_something_with_response(response)
self.render("template.html")
yield tornado.gen.Task(tornado.ioloop.IOLoop.current().add_timeout, time.time() + 2)
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri; # enforce https
# rewrite ^(.*) https://www.example.com$uri permanent;
}
лично мне pycharm не нравится, вот http://www.sublimetext.com/ + плагин Jade(если память не изменяет)