Services Blog Français

yourlabs django uwsgi spooler

| by jpic | python django uwsgi django-uwsgi-spooler

https://github.com/yourlabs/django-uwsgi-spooler

Finnaly a Django app to wrap around uWSGI’s builtin spooler ! I should have done this years ago, but I was expecting to make a boring module, it turned out a lot more exciting than expected ! First things first, django-uwsgi-spooler has only one expectation from your callbacks: be an importable function and take a task argument. The only other expectation is that you can use the Task model it provides, for example: Task(callback_name=‘yourmodule.yourcallback’, env=myvars).spool() Find more up to date information in the README. What’s the catch ? SECURITY Task model has a PickleField for you to pass data Well, hitting the database to update the task information (progress and output) is highly sub-optimal. So, the product needs going through another iteration, to make it use cache as safely as possible and still persist the data (progress, output) from the cache into the database after the task is over. But still, if you have CRUDLFA+ then it will offer a CRUD interface out of the box. For the moment it’s basic Task model visualisation, but I’m excited because of the possibilities it opens, such as: creating tasks in the admin, using other tasks as template, cancelling tasks… Have fun !

Read More

CHIP: a python's functional implementation of ReactJS

| by jpic | python best-practice

https://github.com/tbinetruy/CHIP

Python’s functional implementation of ReactJS, fast moving and very promising, by YourLabs Dev Team ! Thomas Binetruy has taken over jpic’s PoC of React in Python, which I’ve also seen an implementation attempt in the v2 branch of django-material. This is part of the milestone of migrating from MaterializeCSS to Material Design Components Web in CRUDLFA+. But know that YourLabs has never released any Django form rendering plugin so far. It never appealed to me, but with this thingie we’re entering that game. Right now it seems like “at last” there is a great tool to metaprogram JS, and this could even completely replace the need for ReactJS, and have components communicate between each other both on the server and client. We’ll push tests with the python-webpack-loader and things like that until we reach the point where we want to feature freeze. Will let you know when we release 1.0, but we are not sure were to stop as we move forward in the implementation. With LOVE

Read More

tom giraud's setup

| by jpic | love

image

Setup by Tom Giraud, scene techie, hacker who did the k8s setup @ yourlabs. YourLabs is proud to have network admins doing this kind of setups for a living ;)

Pip exception TypeError: parse() got an unexpected keyword argument 'transport_encoding'

| by jpic | python pip

I had an old html5lib installed with –user, that would break globally installed pip from my Arch Linux system. Posting the solution that worked for me here because i couldn’t find it elsewhere:

pip uninstall html Uninstalling html5lib-0.9999999: Would remove: /home/jpic/.local/lib/python3.6/site-packages/html5lib-0.9999999-py3.6.egg-info /home/jpic/.local/lib/python3.6/site-packages/html5lib/* Proceed (y/n)? y Successfully uninstalled html5lib-0.9999999

Then, pip install --user worked again.

The full traceback was:

Traceback (most recent call last): File “/usr/lib/python3.6/site-packages/pip/_internal/basecommand.py”, line 228, in main status = self.run(options, args) File “/usr/lib/python3.6/site-packages/pip/_internal/commands/install.py”, line 291, in run resolver.resolve(requirement_set) File “/usr/lib/python3.6/site-packages/pip/_internal/resolve.py”, line 103, in resolve self._resolve_one(requirement_set, req) File “/usr/lib/python3.6/site-packages/pip/_internal/resolve.py”, line 257, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File “/usr/lib/python3.6/site-packages/pip/_internal/resolve.py”, line 210, in _get_abstract_dist_for self.require_hashes File “/usr/lib/python3.6/site-packages/pip/_internal/operations/prepare.py”, line 245, in prepare_linked_requirement req.populate_link(finder, upgrade_allowed, require_hashes) File “/usr/lib/python3.6/site-packages/pip/_internal/req/req_install.py”, line 307, in populate_link self.link = finder.find_requirement(self, upgrade) File “/usr/lib/python3.6/site-packages/pip/_internal/index.py”, line 484, in find_requirement all_candidates = self.find_all_candidates(req.name) File “/usr/lib/python3.6/site-packages/pip/_internal/index.py”, line 442, in find_all_candidates for page in self._get_pages(url_locations, project_name): File “/usr/lib/python3.6/site-packages/pip/_internal/index.py”, line 587, in _get_pages page = self._get_page(location) File “/usr/lib/python3.6/site-packages/pip/_internal/index.py”, line 705, in _get_page return HTMLPage.get_page(link, session=self.session) File “/usr/lib/python3.6/site-packages/pip/_internal/index.py”, line 833, in get_page inst = cls(resp.content, resp.url, resp.headers) File “/usr/lib/python3.6/site-packages/pip/_internal/index.py”, line 753, in init namespaceHTMLElements=False, TypeError: parse() got an unexpected keyword argument ’transport_encoding'

Read More
Previous Page 11 of 32 Next Page

They trust us

Contact

logo