Services
Blog
Français
A variable looks like this:
export FOO=barTo get a variable in your interactive shell, source the script that contains it as such:
source script_that_contains_FOO
echo $FOOA function looks like this:
function foo() {
echo foo
}To run a function in your interactive shell, source the script and call the function like this:
source script_that_contains_foo
fooTo debug something that’s wrapped in a bash function or script, set the -x option. To de-activate debugging, set +x. Example:
Check out the new applications documentation for Django 1.7 !
It’s still quite cryptic what will “holding app metadata” be really able to do. For starters it enables changing the name of an app in the admin without any hack. It will probably make installing and customizing apps easier, ie.:
Wait and see, anyway, big thanks to Aymeric Augustin and all participants in this pull request.
Another problem you might run into when testing Django apps with Selenium on Travis:
======================================================================
ERROR: tearDownClass (autocomplete_light.tests.widget.WidgetTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/yourlabs/django-autocomplete-light/autocomplete_light/tests/widget.py", line 29, in tearDownClass
super(WidgetTestCase, cls).tearDownClass()
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/django/test/testcases.py", line 1148, in tearDownClass
cls.server_thread.join()
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/django/test/testcases.py", line 1072, in join
self.httpd.shutdown()
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/django/test/testcases.py", line 959, in shutdown
"Failed to shutdown the live test server in 2 seconds. The "
RuntimeError: Failed to shutdown the live test server in 2 seconds. The server might be stuck or generating a slow response.
Apparently, two seconds are not enough wait for travis, sometimes. Unfortunnately, the 2 seconds wait is hard-coded into Django, not to mention that it’s in another thread which makes it even harder to fix in our projects.
Read MoreIn this article we’ll explore a gotcha with Python 2 and 3 support on the long run, using Selenium as an example.
Selenium is an automated testing tool enabling the tests to control a temporary browser GUI - Firefox by default. You can use it to automate functional testing.
Selenium 2.37 had Python 2 and 3 support. But a little before the 2.38 release, some non-Python3-compatible code was commited. This was released in selenium 2.38 and the package was still registered as Python3-compatible.
Read MoreDjango 1.5.4 security release is out. It limits password lengths so that people don’t upload 1Mb passwords (limit for nginx default config). Imagine 1000*1Mb to hash ? That could potentially cause a DoS.
Update your django installs.
This is how your site_base.html template could contain:
For development, we host the project on some small server. It is running via ./manage.py runserver just for our customer to be able to see what’s going on. Also, this enables our designer to hack the project via SFTP without having to deploy the website locally.
Currently we are working with a new designer who found out that GitHub’s editor was pretty cool because it saves him from doing backups himself.
Read Moredjango-responsive-admin and django-suit are interesting new themes for Django admin.
Andrew Godwin, Django core dev and author of django-south, submitted a pull request for django to include schema migration features.
Pretty cool webcam usage demonstrated in pure HTML5