This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from example import ( | |
f401_unused) | |
@f821_undefined_name | |
def c901_too_complex(x): | |
if x > 1: | |
if x > 2: | |
if x > 3: | |
if x > 4: | |
if x > 5: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="font"> | |
<edit name="autohint" mode="assign"><bool>true</bool></edit> | |
<edit name="antialias" mode="assign"><bool>true</bool></edit> | |
<edit name="hinting" mode="assign"><bool>true</bool></edit> | |
<edit name="hintstyle" mode="assign"><const>hintfull</const></edit> | |
<edit name="rgba" mode="assign"><const>rgb</const></edit> | |
</match> | |
</fontconfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from tornado import httpserver, ioloop, wsgi | |
from saleor.wsgi import application | |
container = wsgi.WSGIContainer(application) | |
server = httpserver.HTTPServer(container) | |
server.listen(8000) | |
ioloop.IOLoop.current().start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from tornado import httpserver, ioloop, wsgi | |
from saleor.wsgi import application | |
container = wsgi.WSGIContainer(application) | |
server = httpserver.HTTPServer(container) | |
server.bind(8000) | |
server.start(0) | |
ioloop.IOLoop.current().start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from cherrypy import wsgiserver | |
from saleor.wsgi import application | |
server = wsgiserver.CherryPyWSGIServer( | |
('0.0.0.0', 8000), application, numthreads=10) | |
try: | |
server.start() | |
except KeyboardInterrupt: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from meinheld import server | |
from saleor.wsgi import application | |
server.listen(('0.0.0.0', 8000)) | |
server.run(application) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.template.response import TemplateResponse | |
from django.views.generic import View | |
class MyClassBasedView(View): | |
def __init__(self, foo='bar'): | |
self._foo = foo | |
def get(self, request): | |
context = {'foo': self._foo} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.views.generic import View | |
from django.template.response import TemplateResponse | |
def get(request): | |
return TemplateResponse(request, 'index.html') | |
my_class_based_view = View.as_view(get=get) | |
# TypeError: You tried to pass in the get method name as a keyword argument to View(). Don't do that. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.views.generic import View | |
from django.template.response import TemplateResponse | |
def get(request): | |
return TemplateResponse(request, 'index.html') | |
my_class_based_view = View.as_view(http_method_not_allowed=get) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.views.generic import View | |
from django.template.response import TemplateResponse | |
def get(request): | |
return TemplateResponse(request, 'index.html') | |
my_class_based_view = View.as_view(dispatch=get) |