Wing4.0 is a Django release. Here are the details. You should be able to find out what you need there. So I think I'll just put up some pictures.
Normal view method with a quick test class T to put in the context
Awesome!!! Breakpoints in a template.
While parked on that breakpoint, use the Debug Probe (pictured) and Call Stack (not pictured)
Note the test_func actually was called
-
With respect: you need THOUSANDS of USD to have breakpoints, simple 100USD is not enough. For THAT money I would prefer to pay Windows Server license for life and have Visual Studio with breakpoints + IronPython + MVC2. That's a joke, I just spent 30 minutes of my life checking this C R A P out and this is basically "disappointing of the decade"
- Anna -
Damn it, i was not aware of Wing4 ! This is what i've been looking for.
- YngwieMalmsteen -
very awesome
- Daz
Overview
The graph_models command of Django-Extensions will draw you a nice DB schema for your defined models.py. It's simple to use this to rapidly model your DB.
Steps
- In a Django application, make some changes to models.py
- Run this in an application directory (change 'yourapp') in your Django project to generate and display a graph
python manage.py graph_models -o yourapp_models.png yourapp
- Now you can view the graph with a png viewer - firefox will work
firefox myapp_models.png
- make changes to models.py, and repeat
Error: One or more models did not validate:
myapp.m1_to_m2: "type": CharFields require a "max_length" attribute that is a positive integer.
-
Great app !
- YngwieMalmsteen
If you want to use the python method locale.currency() to format numbers, you need to make sure you aren't set to the 'C' locale.
You can use the following and serve the code up with Django runserver with no problem. The Python documentation says that this call '...sets the locale...user’s default setting (typically specified in the LANG environment variable).'
locale.setlocale(locale.LC_ALL, '')
locale.currency(10.50)
If you use Apache, and WSGI to serve up your Django App, you need to include the locale value explicitly. Otherwise you may find the error: Currency formatting is not possible using the 'C' locale.
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
locale.currency(10.50) # $10.50 USD
Incidentally, for my code to be internationalized, I will need to set the locale based on a User preference anyway, so relying on the server environment's setting would not be correct even if it worked.
-
I've found a more complete locale example that might be worth looking at: http://djangosnippets.org/snippets/1825/
- EyePulp -
Just what I needed. Thank!
- Vasili
One of the powerful features of WingIDE is that you can debug python code, even web applications and Django, with an interactive debugger that is fast and very feature full.
In this article I discuss how I use it with Django. Suppose you have a unit test that hits a relational DB. With Django you can run python manage.py test, to run these tests. When you test this way, Django will do the following
- Create a test database, syncdb your tables, and load any data fixtures
- Run the tests
- Drop the test database
WingIDE has a Unit Testing interface, but it only allows you to run the tests. In other words, it only runs Step 2 above. I have found no easy way to have Wing do Step 1, then run your selected tests within Wing's Testing system, then do Step 3. I'm working on a way to do this, and will blog about it someday. For now, I run the Django Test system through Wing Debug system, and not through the testing system. Like this.
- In your Django project, in Wing, Choose to edit the file properties for manage.py.
- In the 'Debug' tab of this dialog, and the 'Run Arguments' box type test (and optionally the app name to run tests just for that app).
- Now choose to Debug manage.py by right clicking on that file and choosing Debug Selected
This will cause WingIDE to run the Django test framework. Output will go into the Debug I/O panel. Wing will even stop at breakpoints and enter the debugger.
The advantages of this method
The tests can be run either on the commandline or within WingIDE without any changes or hacks to the source and it is simple to set up.
The disadvantages of this method
You don't get to use the rich Wing interface for running tests which would allow you to run individual tests on demand. Beware too that you might be using manage.py to run the Django runserver within WingIDE. That is also configured in the manage.py Debug dialog. You can only configure one argument to manage.py at a time.
-
Debugging unit tests is very useful.
- YngwieMalmsteen
I do like Wing but Django's integration is too weak. Running tests should be more ergonomic and template tags should be colorized.
btw thank you for sharing your knowledge :)

I generally try to just mock everything up using backend model interaction to recreate the expected conditions.
Fixtures are OK for hard coded invariant data but that's rare. If you have a 20K row table in production and have a edge case that needs testing, generally, I want the smallest test case possible so that my test runner maintains some speed since it's all "manual" test kick offs for me.
- Chris Green