技術情報
- 2022年06月14日
- 技術情報
7 Django Packages Developers Should Know
Today, I would like to share about 7 Django packages that developers should know. Let’s take a look.
1. Django REST framework
It is to build any HTTP-based REST API, providing powerful and flexible tools as well as impressive usability, authentication policies, serialization, and extensive documentation.
2. Django GUID
It is a library enabling matching a single HTTP request with all messages coming from logs. Django GUID is WSGI-supported and also ASGI-supported.
3. Django Debug Toolbar
It is a toolbar that helps debug a Django application in the browser, offering many built-in as well as third-party panels. It works on Django versions 2.2, 3.0, and 3.1.
4. Sentry
It is a service meant to monitor a running application and errors that occur when it’s working.
5. Graphene-Django
It’s about making Django data available through an interface based on GraphQL. Some tips on how to add GraphQL functionality to a Django project may be found here.
6. Django Channels
WebSocket async support in Django, available via several locations. User-friendly, flexible, allowing for customizability.
7. Django-baton
A handy, cutting-edge, responsive, and user-friendly interface for a Django admin, based on Bootstrap 5. It was created with Python, JavaScript, SCSS, HTML, and some other languages.
This is all for now. Hope you enjoy that.
By Asahi
waithaw at 2022年06月14日 10:00:00
- 2022年06月13日
- 技術情報
Taking screenshots for your web app
To take screenshots of your website without using third-party services, we recommend using the html2canvas library. You can use this script to take a “screenshot” of a web page or part of it directly in the user’s browser.
As mentioned above, use the html2canvas library to take screenshots of the elements in the DOM. You can download this library with npm using the following command
npm install html2canvas
Or you can just include the asset file like this
<script src="/path/to/html2canvas.min.js"></script>
You can visit to the official Github repo here. I will add some samples working around to capture or download the screenshot.
Taking Screenshot
html2canvas(document.body).then(function(canvas) {
var base64img = canvas.toDataURL("image/png");
window.open(base64img);
});
Downloading with blob method
html2canvas(document.body).then(function(canvas) {
canvas.toBlob(function(blob) {
window.saveAs(blob, "ss.png");
});
});
But you have to be aware of this blob method might not be available for all browsers. If you want to use the blob method , you may have to use this canvas-blob library to be able to support at all browsers.
Yuuma
yuuma at 2022年06月13日 10:00:00
- 2022年06月10日
- 技術情報
知っておいていただきたいこと – 7
今回も、Laravelの知っておいた方がいいとおもったことをいくつか紹介します。
#Laravel #Implicit Binding
Implicit Bindingは、ルートやコントローラのアクションで定義されたEloquentモデルを自動的に解決します。
Laravel 5.3で導入されましたが、もっと多くの人に知ってもらいたい素晴らしい機能です。
//Implicit route model binding
Route::get('api/posts/{post}', function (App\Post $post) {
return $post->title;
});
ということで、今回はこれで終わります。
金曜担当 – Ami
asahi at 2022年06月10日 10:00:00
- 2022年06月07日
- 技術情報
3 Ways to group routes in laravel
Today, I would like to share about 3 ways to group routes in laravel. Let’s take a look.
1. Route::resource
We can create a resource controller and group routes for CRUD actions of that controller as follow.
Route::resource('books', BookController::class);
2. Route groups within another route group
We can groups routes within another route groups like nested ones.
Route::middleware('auth')->group(function() {
Route::middleware('admin')->prefix('admin')->group(function() {
Route::get(...)
});
Route::middleware('member')->prefix('member')->group(function() {
Route::get(...)
});
});
3. Route::controller() in Laravel 9
In laravel 9, we can group the routes without repeating controller name for the same controller.
Route::controller(PostController::class)->group(function() {
Route::get('posts', 'getPosts');
Route::put('posts/update', 'updatePost');
Route::delete('posts/delete/{id}', 'deletePost');
});
This is all for now. Hope you enjoy that.
By Asahi
waithaw at 2022年06月07日 10:00:00
- 2022年05月31日
- 技術情報
Differences Between Free SSL and Paid SSL
Today, I would like to share about differences between free and paid SSL. Let’s take a look.
When we deploy our website or web applications in production, we have to install SSL certificates for our website’s security. They come both free and paid. The followings are the differences of free and paid SSL.
1. Free SSL certificates only support DV (Domain Validation), not for EV(Extended Validation) and OV(Organization Validation).
2. Free SSL certificates validate only the ownership of the domain whereas paid SSL certificates verify the business identity of the website and with OV & EV certificates, it has in-depth verification by the certificate authority(CA).
3. Free SSL certificates are issued for 30-90 days and paid SSL certificates are for 1-2 years.
4. Free SSL certificates do not provide warranty when there are something wrong or errors on certificates authentication. But paid SSL certificates provide warranty limits.
5. Free SSL cerificate authorities(CAs) do not support customer services whereas paid SSL certificate authorities(CAs) support customer services.
This is all for now. Hope you enjoy that.
By Asahi
waithaw at 2022年05月31日 10:00:00