Saturday, October 22, 2016

Re: How to: Django development and debugging

On Thursday, October 20, 2016 at 8:30:45 PM UTC-4, Don Thilaka Jayamanne
wrote:
>
> Hi Everyone, I'm the author of a Python plugin for the VS Code
> editor (https://github.com/DonJayamanne/pythonVSCode
> <https://github.com/DonJayamanne/pythonVSCode>). Basically it
> provides intellisense, code navigation, debugging (django, multi
> threads, etc), data science and the like.
>
> When it comes to debugging django applications, today the
> extension disables (doesn't support) live reloading of django
> applications.
>

I take this to mean reload the dev server when code changes. I think
that is critical for development.
Also critical for me is the debug page delivered when settings.DEBUG is
True. I suppose that is independent of the IDE.

>
> I'm thinking of having a look at this particular area. Before I do
> so, I'd like to get an idea of how developers actually develop and
> debug django applications.
>
> Most of the people i've spoken to say they develop as follows:
> - Fire up the django application with live reloadÂ
>

No. I write a unit test (or tests) then do manage.py test
Assuming the tests fail I start coding
>
> - Start codeing
>

When the unit tests all pass

> - Test in the browser
>
Yes
>
> - Very rarely would they debug an application
>

Very rarely necessary to step through code looking at variables etc to
discover why something isn't working. My bugs are pretty obvious. I have
stepped through code but usually to see what the framework is doing for
one reason or another.

> - i.e. majority of the time they don't launch the application in
> debug modeÂ
>

Always in development

Very rarely in staging and then only temporarily to see what is going
wrong on the non-dev platform.

Never in production (same platform as staging)

>
> How do you work on django applications?
>

* Plain text editor with Python syntax highlighting to write code
* Scripted launching of manage.py with different backends, settings,
databases as required
* Commit to my own branch in svn
* Merge to trunk
* Run unit tests
* Repeat until all unit tests are working
* Commit trunk in svn
* Svn commences a Buildbot deployment on staging which succeeds if the
tests all work
* Occasionally create a production tag from trunk in svn
* Manually edit a script on production to deploy the tag

HTH

Mike

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/647b6a73-2271-8e04-2400-0412ce855268%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment