SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
DISQUS
                         Tools and Stu



                           David Cramer
                          twitter.com/zeeg




Friday, July 15, 2011
django-debug-toolbar




Friday, July 15, 2011
$ pip install django-debug-toolbar

                        # settings.py
                        INSTALLED_APPS = (
                          'debug_toolbar',
                        )

                        MIDDLEWARE_CLASSES = (
                          'debug_toolbar.middleware.DebugToolbarMiddleware',
                        )

                        INTERNAL_IPS = ('127.0.0.1',)




Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
Extending the Toolbar


                        class SettingsVarsDebugPanel(DebugPanel):
                            """
                            A panel to display all variables in django.conf.settings
                            """
                            name = 'SettingsVars'
                            has_content = True

                            def nav_title(self):
                                return _('Settings')

                            def title(self):
                                return _('Settings')

                            def content(self):
                                context = self.context.copy()
                                context.update({
                                    'settings': get_safe_settings(),
                                })
                                return as_string('debug_toolbar/panels/settings.html', context)




Friday, July 15, 2011
Extending the Toolbar




                        	   DEBUG_TOOLBAR_PANELS = (
                        	       'debug_toolbar.panels.version.VersionDebugPanel',
                        	       'debug_toolbar.panels.timer.TimerDebugPanel',
                        	       'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
                        	       'debug_toolbar.panels.headers.HeaderDebugPanel',
                        	       'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
                        	       'debug_toolbar.panels.template.TemplateDebugPanel',
                        	       'debug_toolbar.panels.sql.SQLDebugPanel',
                        	       'debug_toolbar.panels.signals.SignalDebugPanel',
                        	       'debug_toolbar.panels.logger.LoggingPanel',
                        	   )




Friday, July 15, 2011
Werkzeug
                        w/ django-devserver




Friday, July 15, 2011
$ pip install django-devserver

                        # settings.py
                        INSTALLED_APPS = (
                          'devserver',
                        )

                        $ python manage.py runserver




Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
•     SQL Queries (Realtime and Summarized)
                  •     Profiling (Execution time, Memory Usage)
                  •     Cache usage summary
                  •     Ajax requests
                  •     Session information
                  •     Write your own!




Friday, July 15, 2011
class AjaxDumpModule(DevServerModule):
                            """
                            Dumps the content of all AJAX responses.
                            """

                            logger_name = 'ajax'

                            def process_response(self, request, response):
                                if request.is_ajax():
                                    self.logger.info(response.content)




Friday, July 15, 2011
Extending the Toolbar




                        	   DEVSERVER_MODULES = (
                                 'devserver.modules.sql.SQLSummaryModule',
                                 'devserver.modules.ajax.AjaxDumpModule’,
                                 'devserver.modules.profile.ProfileSummaryModule',
                                 'devserver.modules.request.SessionInfoModule',
                                 'devserver.modules.profile.MemoryUseModule',
                                 'devserver.modules.profile.LeftOversModule',
                                 'devserver.modules.cache.CacheSummaryModule',
                        	   )




Friday, July 15, 2011
Sentry




Friday, July 15, 2011
$ pip install django-sentry

                        # settings.py
                        INSTALLED_APPS = (
                          'sentry',
                          'sentry.client',
                        )




Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
# settings.py
                        MIDDLEWARE_CLASSES = (
                          'sentry.client.middleware.SentryResponseErrorIdMiddleware',
                        )



                        # 500.html
                        <p>Sorry friends, something’s not working.</p>

                        {% if request.sentry.id %}
                            <p>If you need assistance, you may reference this error
                               as <strong>{{ request.sentry.id }}</strong>.</p>
                        {% endif %}




Friday, July 15, 2011
Friday, July 15, 2011
•     Builtin support for Celery
                  •     Server/Client (clients can be any language)
                  •     2.x powered by Flask/Redis (no Django)




Friday, July 15, 2011
Gargoyle




Friday, July 15, 2011
$ pip install gargoyle

                        # settings.py
                        INSTALLED_APPS = (
                          'gargoyle',
                        )




Friday, July 15, 2011
Friday, July 15, 2011
from gargoyle import gargoyle

                        def my_view(request):
                            if gargoyle.is_active('awesome', request):
                                return 'new happy version :D'
                            else:
                                return 'old sad version :('




Friday, July 15, 2011
class HostConditionSet(ConditionSet):
                            hostname = String()

                            def can_execute(self, instance):
                                return instance is None

                            def get_field_value(self, instance, field_name):
                                if field_name == 'hostname':
                                    return socket.gethostname()

                        gargoyle.register(HostConditionSet())




Friday, July 15, 2011
Friday, July 15, 2011
Wrap Up




Friday, July 15, 2011
DISQUS
                          Questions?




                          psst, we’re hiring
                         jobs@disqus.com

Friday, July 15, 2011
References


                  •     Debug Toolbar
                        https://github.com/django-debug-toolbar/django-debug-toolbar
                  •     Devserver
                        https://github.com/dcramer/django-devserver
                  •     Werkzeug
                        https://github.com/mitsuhiko/werkzeug
                  •     Gargoyle
                        https://github.com/disqus/gargoyle
                  •     Sentry
                        https://github.com/dcramer/django-sentry (1.x)
                        https://github.com/dcramer/sentry (2.x)




                                             code.disqus.com

Friday, July 15, 2011

Mais conteúdo relacionado

Destaque

Learning Pool's Public Sector Learning Conference 2010
Learning Pool's Public Sector Learning Conference 2010Learning Pool's Public Sector Learning Conference 2010
Learning Pool's Public Sector Learning Conference 2010Paul McElvaney
 
Social media school webversie
Social media school webversieSocial media school webversie
Social media school webversieSjef Kerkhofs
 
Collaboration for successful e-learning in Worcestershire
Collaboration for successful e-learning in WorcestershireCollaboration for successful e-learning in Worcestershire
Collaboration for successful e-learning in WorcestershirePaul McElvaney
 
Dr Andrew Larner - Maintaining & Improving Services in a time of Austerity
Dr Andrew Larner - Maintaining & Improving Services in a time of AusterityDr Andrew Larner - Maintaining & Improving Services in a time of Austerity
Dr Andrew Larner - Maintaining & Improving Services in a time of AusterityPaul McElvaney
 
How To Make Doughnut!
How To Make Doughnut!How To Make Doughnut!
How To Make Doughnut!Natsumi0922
 
Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.
Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.
Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.Paul McElvaney
 
Managing Live Chats Webinar
Managing Live Chats WebinarManaging Live Chats Webinar
Managing Live Chats WebinarPaul McElvaney
 
Webanalytics2.0 sem jvol2
Webanalytics2.0 sem jvol2Webanalytics2.0 sem jvol2
Webanalytics2.0 sem jvol2Sonika Mishra
 
Preso zeeman smc013 01 25-47
Preso zeeman smc013 01 25-47Preso zeeman smc013 01 25-47
Preso zeeman smc013 01 25-47Sjef Kerkhofs
 
LB Lambeth's Andrew Jacobs on Technology as the Enabler
LB Lambeth's Andrew Jacobs on Technology as the EnablerLB Lambeth's Andrew Jacobs on Technology as the Enabler
LB Lambeth's Andrew Jacobs on Technology as the EnablerPaul McElvaney
 
CasóRio Tati - 23.06.07
CasóRio Tati - 23.06.07CasóRio Tati - 23.06.07
CasóRio Tati - 23.06.07Jubrac Jacui
 
Learning Pool: Work life balance 1 the secrets to building confidence resili...
Learning Pool: Work life balance 1  the secrets to building confidence resili...Learning Pool: Work life balance 1  the secrets to building confidence resili...
Learning Pool: Work life balance 1 the secrets to building confidence resili...Paul McElvaney
 
Ict Presentation
Ict PresentationIct Presentation
Ict Presentationamoi286
 

Destaque (20)

Learning Pool's Public Sector Learning Conference 2010
Learning Pool's Public Sector Learning Conference 2010Learning Pool's Public Sector Learning Conference 2010
Learning Pool's Public Sector Learning Conference 2010
 
Social media school webversie
Social media school webversieSocial media school webversie
Social media school webversie
 
Collaboration for successful e-learning in Worcestershire
Collaboration for successful e-learning in WorcestershireCollaboration for successful e-learning in Worcestershire
Collaboration for successful e-learning in Worcestershire
 
Dr Andrew Larner - Maintaining & Improving Services in a time of Austerity
Dr Andrew Larner - Maintaining & Improving Services in a time of AusterityDr Andrew Larner - Maintaining & Improving Services in a time of Austerity
Dr Andrew Larner - Maintaining & Improving Services in a time of Austerity
 
Vov meeting
Vov meeting Vov meeting
Vov meeting
 
How To Make Doughnut!
How To Make Doughnut!How To Make Doughnut!
How To Make Doughnut!
 
Weather qube
Weather qubeWeather qube
Weather qube
 
Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.
Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.
Learning Pool's Lindsey Rees on 'How to create bespoke e-learning'.
 
Managing Live Chats Webinar
Managing Live Chats WebinarManaging Live Chats Webinar
Managing Live Chats Webinar
 
Webanalytics2.0 sem jvol2
Webanalytics2.0 sem jvol2Webanalytics2.0 sem jvol2
Webanalytics2.0 sem jvol2
 
Preso zeeman smc013 01 25-47
Preso zeeman smc013 01 25-47Preso zeeman smc013 01 25-47
Preso zeeman smc013 01 25-47
 
LB Lambeth's Andrew Jacobs on Technology as the Enabler
LB Lambeth's Andrew Jacobs on Technology as the EnablerLB Lambeth's Andrew Jacobs on Technology as the Enabler
LB Lambeth's Andrew Jacobs on Technology as the Enabler
 
CasóRio Tati - 23.06.07
CasóRio Tati - 23.06.07CasóRio Tati - 23.06.07
CasóRio Tati - 23.06.07
 
Bookevent
BookeventBookevent
Bookevent
 
Learning Pool: Work life balance 1 the secrets to building confidence resili...
Learning Pool: Work life balance 1  the secrets to building confidence resili...Learning Pool: Work life balance 1  the secrets to building confidence resili...
Learning Pool: Work life balance 1 the secrets to building confidence resili...
 
Lezing VakdagDM
Lezing VakdagDMLezing VakdagDM
Lezing VakdagDM
 
Have You Ever Noticed
Have You Ever NoticedHave You Ever Noticed
Have You Ever Noticed
 
Lecture 14
Lecture 14Lecture 14
Lecture 14
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Ict Presentation
Ict PresentationIct Presentation
Ict Presentation
 

Semelhante a Tools for Development and Debugging in Python

Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и DjangoMoscowDjango
 
Django’s nasal passage
Django’s nasal passageDjango’s nasal passage
Django’s nasal passageErik Rose
 
Joomla! Components - Uma visão geral
Joomla! Components - Uma visão geralJoomla! Components - Uma visão geral
Joomla! Components - Uma visão geralFábrica Livre
 
Javascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & AngularJavascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & AngularErik Guzman
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP pluginsPierre MARTIN
 
Node conf - building realtime webapps
Node conf - building realtime webappsNode conf - building realtime webapps
Node conf - building realtime webappsHenrik Joreteg
 
MT_01_unittest_python.pdf
MT_01_unittest_python.pdfMT_01_unittest_python.pdf
MT_01_unittest_python.pdfHans Jones
 
Automated testing in Drupal
Automated testing in DrupalAutomated testing in Drupal
Automated testing in DrupalArtem Berdishev
 
Behind the curtain - How Django handles a request
Behind the curtain - How Django handles a requestBehind the curtain - How Django handles a request
Behind the curtain - How Django handles a requestDaniel Hepper
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And DrupalPeter Arato
 
Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0James Thomas
 
7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOS7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOSJorge Ortiz
 
JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentalsBastian Feder
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksLohika_Odessa_TechTalks
 
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with MagentoMagento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magentovarien
 
Magento's Imagine eCommerce Conference 2011 - Unit Testing with Magento
Magento's Imagine eCommerce Conference 2011 - Unit Testing with MagentoMagento's Imagine eCommerce Conference 2011 - Unit Testing with Magento
Magento's Imagine eCommerce Conference 2011 - Unit Testing with MagentoMagentoImagine
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Adam Štipák
 
EPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur PurnamaEPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur PurnamaEnterprise PHP Center
 

Semelhante a Tools for Development and Debugging in Python (20)

Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и Django
 
Django’s nasal passage
Django’s nasal passageDjango’s nasal passage
Django’s nasal passage
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Joomla! Components - Uma visão geral
Joomla! Components - Uma visão geralJoomla! Components - Uma visão geral
Joomla! Components - Uma visão geral
 
Javascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & AngularJavascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & Angular
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP plugins
 
Node conf - building realtime webapps
Node conf - building realtime webappsNode conf - building realtime webapps
Node conf - building realtime webapps
 
MT_01_unittest_python.pdf
MT_01_unittest_python.pdfMT_01_unittest_python.pdf
MT_01_unittest_python.pdf
 
Automated testing in Drupal
Automated testing in DrupalAutomated testing in Drupal
Automated testing in Drupal
 
Behind the curtain - How Django handles a request
Behind the curtain - How Django handles a requestBehind the curtain - How Django handles a request
Behind the curtain - How Django handles a request
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And Drupal
 
Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0
 
7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOS7 Stages of Unit Testing in iOS
7 Stages of Unit Testing in iOS
 
JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentals
 
Deep dive into Oracle ADF
Deep dive into Oracle ADFDeep dive into Oracle ADF
Deep dive into Oracle ADF
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
 
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with MagentoMagento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
 
Magento's Imagine eCommerce Conference 2011 - Unit Testing with Magento
Magento's Imagine eCommerce Conference 2011 - Unit Testing with MagentoMagento's Imagine eCommerce Conference 2011 - Unit Testing with Magento
Magento's Imagine eCommerce Conference 2011 - Unit Testing with Magento
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
 
EPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur PurnamaEPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur Purnama
 

Mais de zeeg

Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deploymentzeeg
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)zeeg
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disquszeeg
 
Sentry (SF Python, Feb)
Sentry (SF Python, Feb)Sentry (SF Python, Feb)
Sentry (SF Python, Feb)zeeg
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
Db tips & tricks django meetup
Db tips & tricks django meetupDb tips & tricks django meetup
Db tips & tricks django meetupzeeg
 

Mais de zeeg (6)

Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deployment
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disqus
 
Sentry (SF Python, Feb)
Sentry (SF Python, Feb)Sentry (SF Python, Feb)
Sentry (SF Python, Feb)
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Db tips & tricks django meetup
Db tips & tricks django meetupDb tips & tricks django meetup
Db tips & tricks django meetup
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Tools for Development and Debugging in Python

  • 1. DISQUS Tools and Stu David Cramer twitter.com/zeeg Friday, July 15, 2011
  • 3. $ pip install django-debug-toolbar # settings.py INSTALLED_APPS = ( 'debug_toolbar', ) MIDDLEWARE_CLASSES = ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) INTERNAL_IPS = ('127.0.0.1',) Friday, July 15, 2011
  • 8. Extending the Toolbar class SettingsVarsDebugPanel(DebugPanel): """ A panel to display all variables in django.conf.settings """ name = 'SettingsVars' has_content = True def nav_title(self): return _('Settings') def title(self): return _('Settings') def content(self): context = self.context.copy() context.update({ 'settings': get_safe_settings(), }) return as_string('debug_toolbar/panels/settings.html', context) Friday, July 15, 2011
  • 9. Extending the Toolbar DEBUG_TOOLBAR_PANELS = ( 'debug_toolbar.panels.version.VersionDebugPanel', 'debug_toolbar.panels.timer.TimerDebugPanel', 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', 'debug_toolbar.panels.headers.HeaderDebugPanel', 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', 'debug_toolbar.panels.template.TemplateDebugPanel', 'debug_toolbar.panels.sql.SQLDebugPanel', 'debug_toolbar.panels.signals.SignalDebugPanel', 'debug_toolbar.panels.logger.LoggingPanel', ) Friday, July 15, 2011
  • 10. Werkzeug w/ django-devserver Friday, July 15, 2011
  • 11. $ pip install django-devserver # settings.py INSTALLED_APPS = ( 'devserver', ) $ python manage.py runserver Friday, July 15, 2011
  • 14. SQL Queries (Realtime and Summarized) • Profiling (Execution time, Memory Usage) • Cache usage summary • Ajax requests • Session information • Write your own! Friday, July 15, 2011
  • 15. class AjaxDumpModule(DevServerModule): """ Dumps the content of all AJAX responses. """ logger_name = 'ajax' def process_response(self, request, response): if request.is_ajax(): self.logger.info(response.content) Friday, July 15, 2011
  • 16. Extending the Toolbar DEVSERVER_MODULES = ( 'devserver.modules.sql.SQLSummaryModule', 'devserver.modules.ajax.AjaxDumpModule’, 'devserver.modules.profile.ProfileSummaryModule', 'devserver.modules.request.SessionInfoModule', 'devserver.modules.profile.MemoryUseModule', 'devserver.modules.profile.LeftOversModule', 'devserver.modules.cache.CacheSummaryModule', ) Friday, July 15, 2011
  • 18. $ pip install django-sentry # settings.py INSTALLED_APPS = ( 'sentry', 'sentry.client', ) Friday, July 15, 2011
  • 21. # settings.py MIDDLEWARE_CLASSES = ( 'sentry.client.middleware.SentryResponseErrorIdMiddleware', ) # 500.html <p>Sorry friends, something’s not working.</p> {% if request.sentry.id %} <p>If you need assistance, you may reference this error as <strong>{{ request.sentry.id }}</strong>.</p> {% endif %} Friday, July 15, 2011
  • 23. Builtin support for Celery • Server/Client (clients can be any language) • 2.x powered by Flask/Redis (no Django) Friday, July 15, 2011
  • 25. $ pip install gargoyle # settings.py INSTALLED_APPS = ( 'gargoyle', ) Friday, July 15, 2011
  • 27. from gargoyle import gargoyle def my_view(request): if gargoyle.is_active('awesome', request): return 'new happy version :D' else: return 'old sad version :(' Friday, July 15, 2011
  • 28. class HostConditionSet(ConditionSet): hostname = String() def can_execute(self, instance): return instance is None def get_field_value(self, instance, field_name): if field_name == 'hostname': return socket.gethostname() gargoyle.register(HostConditionSet()) Friday, July 15, 2011
  • 31. DISQUS Questions? psst, we’re hiring jobs@disqus.com Friday, July 15, 2011
  • 32. References • Debug Toolbar https://github.com/django-debug-toolbar/django-debug-toolbar • Devserver https://github.com/dcramer/django-devserver • Werkzeug https://github.com/mitsuhiko/werkzeug • Gargoyle https://github.com/disqus/gargoyle • Sentry https://github.com/dcramer/django-sentry (1.x) https://github.com/dcramer/sentry (2.x) code.disqus.com Friday, July 15, 2011