Services Blog Français

breve demonstration de certains des developpements

| by jpic | python crudlfap

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

crudlfap

| by jpic | python django crudlfap

image

In the first screen we see that two posts in the list have a different button in the Actions column. The first row is a post that I’m the owner of, therefore the Actions shows a button for a dropdown menu. The second row is a post that I’m not owner of, but that has been published, so, I only have the detail link on that row. In the second screenshot, using the checkboxes reveals possible groupped actions on the bottom of the screen, here “Delete objects” which serves as reference action. In the third screenshot, we see how the DeleteObjects view relied on a secure queryset which only shows posts I’m owner of. It also draws a message about the post that I don’t own, and that I have checked for delete. Note that this is the feature that comes only in closed-source django-material, which we cannot use in Open Source governmental projects unfortunnately.

Read More

Put a nextjs server in front of django

| by jpic | python django nextjs react django-appwatch

image

How to put a NextJS server in front of Django with django-appwatch In this article, we’ll get started on a new Django project with NextJS in front of Django. We choose to put NextJS in front of Django because NextJS is an isomorphic UI framework for React, that’s pretty simple to use. - Create your Django project as usual, - Do in your repo: yarn add next react - Install django-appwatch with pip install django-appwatch, - Add appwatch to INSTALLED_APPS, - Run command manage.py appwatch pages:./pages The appwatch command will watch the pages/ subdirectories for each app, and build a pages directory aggregating them in the same way we have templates or static files. If you have added your project to INSTALLED_APPS, you can create a pages/index.js file in the project module, otherwise in an app that you include. The NextJS server will pick it up: ./node_module/.bin/next will start the server on port 3000. If you also want to add a components subdirectory to Django apps for React components, mount them into the ./pages/components dir so they will be importable from ./components from within your page templates: manage.py appwatch pages:./pages components:./pages/components. As for what to code in Django, I highly recommend a GraphQL endpoint. If you’re making a generic frontend module, you could have connectors like Crudl.io which supports both DRF and GraphQL. As for the UI toolkit, we want to start a fork of Crudl.io based on NextJS and Material-UI soon, appwatch will do great to manage per app templates ;)

Announcing YourLabs BtoC Service

| by jpic | shop

It’s an honnour to announce our new BtoC product at YourLabs: a computer repair shop.

What makes it different from other computer repair shop is that we’re going to expose OEM and data center provisionning technologies to end users.

In our shop, you will be able to discuss with a Level 1 staff who’s job is:

  • reassure the user that we are going to find a satisfying solution for their problem, their way,
  • connect the machine they bring to the ethernet cable and boot on PXE,
  • open a live OS and backup user files on the NAS,
  • or/then, open an installer (also from PXE) and format the machine with a fresh os,
  • open a live OS and restore user files from the NAS,
  • call on a level 2 for advanced diagnosis if necessary,
  • open tickets for users, take hardware in/out, and help users with their tickets

Power users will be able to service their products theirselves at our shop, in a chilly atmosphere encouraging working in pair, making new friends and share passion :)

Read More

open source software djnext

| by jpic | python django javascript react djnext best-practice

https://git.yourlabs.org/oss/djnext

Django-NextJS Isomorphic UI Development with Decorator pattern for Django with: - nextjs out of the box experience for frontend development, - rendering of nextjs pages with context in Django with NextJS template engine. For fun & profit ## Run the example project Run this commands as non root:: git clone https://git.yourlabs.org/oss/djnext cd djnext pip install –user –editable .[dev] yarn install djnext watchstatic # maintains nextjs pages/ directory for yarn dev yarn dev # run localhost:3000 djnext dev # run localhost:8000 ## Choose NextJS page template in Django Example project lives in src/djnext_example, see src/djnext_example/artist/urls.py:: CreateView.as_view( model=Artist, fields=[’name’], success_url=reverse_lazy(‘artist_list’), template_name=‘create.js’, ) The template backend you added will make a request to the nextjs server you have on port 3000 with yarn dev. ## Watchstatic command Run your manage.py watchstatic or yourproject watchstatic if your project has an entrypoint. This will watch static/ directories of all apps in INSTALLED_APPS, and build static_root/ directory. Also, it creates a symlink from static_root/pages to pages/, so that yarn dev will find it. On port 8000 we don’t yet have auto frontend code reload, but you have it on port 3000 wit h watchstatic running at the same time. ## Install in your project Add to ‘djnext’ to INSTALLED_APPS, add dict(BACKEND='djnext.Backend') to TEMPLATES. .. note:: To have the dev command, add crudlfap to INSTALLED_APPS. ## About This project was made possible thanks to Thomas Binetruy, frontend engineer intervening as pair programing on this R&D; project for a long time now ;) With LOVE from POITOU CHARENTE ∞

Previous Page 12 of 32 Next Page

They trust us

Contact

logo