teleren/devto huggingface dataset:
Django Custom user model
Tags: python, django, webdev
Published: 2022-08-08 11:18:21

n django we can create Custom user Model using AbstractBas


eUser. If, however, we wan't to use an email address instead of a username as the user identifier, you have to extend AbstractBaseUser.

Requirements:-

we know Python and Django frameworks.

we used Django 3.9 and python 3

Getting started:-

First, we create a folder called User and then install virtual environments using pip3 install virtualenv


we create a virtual environment using virtualenv venv and then install Django in virtual environment


Now we create a Django project using django-admin startproject Pro and then we create a app inside Project called Pro using python3 manage.py stratapp app


We install our app inside project folder in settings.py in INSTALLED_APPS


Now we create models inside app in models.py file first we import AbstractBaseUser and BaseUserManger from django.contrib.auth.models, from django.contrib.auth.models import AbstractBaseUser, BaseUserManger

then we create a Account class and inherit AbstractBaseUser and create fields in Account class like first_name, last_name, username, email, phone and add some required fields like date_joined, last_logging, is_admin, is_staff, is_active, is_superuser


After creating Account class now we set logging field, currently by default logging field is username, but in our application we want user can logging by using email not username so now we replace username to email USERNAME_FIELD = ‘email’ , REQUIRED_FIELD = [‘username’, ‘email’] and some permission to admin


Next step we create Account manager that manage users account so we create a MyAccountManager() class and inherit BaseUserManager and create a method for users called create_user() and create users.



Once we create class create_user now we create class for superuser create_superuser in MyAccountManager for manage users account


Next, we use the makemigration command to establish a Django database and for utilise models in our database to use migrate command.

once the database has been created, create a superuser and log in to our database.

Use the createsuperuser command to create superuser. then we enter details

of superuser and we can login using email


Source code: Github
How can I limit an object size before it is looped in vue/nuxt?
Tags: beginners, vue, javascript, nuxt
Published: 2022-08-08 11:10:00

Sometimes for design requirements we have to minimize response object size or we can say response data. More clearly - Suppose, from API we receive 40 objects as response but I need only four of them. That's the one of reason GraphQL invented. GraphQL provide only those amount of data which is needed. Whatever we can slice our total response into our desire amount before printing by simply put `array slice` functionality in `v-for` loop-

> v-for="obj in obj.slice([from:int value],[to:int value]) 
```js
v-for="(i,index) in i.slice(0,4)" :key="index"
```
Thank you 💓
How to Design a Call History UI Using the Angular ListView Component
Tags: angular, webdev
Published: 2022-08-08 11:09:09

Learn how to customize Syncfusion [Angular Listview](https://www.syncfusion.com/angular-ui-components/angular-listview) items with icons or images using the template property. I have explained a few built-in classes to customize the template content such as an avatar with multiple lines in each list item and showed you how to customize the list header using the headerTemplate property. I also enabled the group header and customized the group title using the groupTemplate property.

Download an example from GitHub: [https://github.com/SyncfusionExamples/how-to-customize-the-angular-listview-using-templates](https://github.com/SyncfusionExamples/how-to-customize-the-angular-listview-using-templates)

Product overview: [https://www.syncfusion.com/angular-ui-components/angular-listview](https://www.syncfusion.com/angular-ui-components/angular-listview)

{% youtube 1rcADJsclVY %}
Spacebar Speed test is Preformed
Tags: beginners, kohiclicktest, cpsclickertest
Published: 2022-08-08 11:02:55

Hi, Everyone! I have made [this site](http://kohiclicks.com/) first time in HTML, and CSS can anyone take look at how I can further improve this site? but all is good from my side. thank

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/48004kp40hky09c6ur37.png)

```
<div class="hero">

  <div class="banner-info">
    <div class="speed-image">
      <img src="images/speed.svg" style="width: 140px;">
    </div>

    <div class="heading-banner">
      <h1>Spacebar Speed Test</h1>
      <h5 style="color:white">This test suggests you how fast you can press a spacebar!</h5>
    </div>

    <div class="container counter-section">
      <div class="row">
        <div class="col-md-12 time-count">
          <h6><img src="images/clock.svg" style="padding-right: 13px; width:40px"><span
              style="color:#fcb700; padding-right: 5px;">Time: </span>
            <span class="timer" style="width: 100px;text-align: left;padding-left: 10px"><span
                id="seconds">00</span>:<span id="milliseconds">000</span></span>
          </h6>
        </div>
        <!-- <div class="col-md-6 click-digit">
          <h3 style="font-weight: 800;">02</h3>
        </div> -->
      </div>
    </div>

    <div class="container playhere-section" id="play_section">
      <div class="play-area" id="play-area">
        <div class="pixels play_area" id="play_area">0 pixels per second</div>
      </div>
      <div class="play-button" id="play-button">
        <button class="btn playbutton btn-lg active" role="button" id="play_btn" aria-pressed="true">Click Here</button>
      </div>
    </div>
  </div>
</div>
```
Undo Git Commit mistakes
Tags: git, bash, tutorial, beginners
Published: 2022-08-08 10:47:00

If you find yourself in a situation where you have committed to a branch using a name and email that was not your intention to use in the first place then you might think that there isn’t much you can do to fix the mistake.

The truth is that you can fix that by running the following git commands (this was done on linux shell):

```
git filter-branch -f --env-filter '
OLD_NAME="XXXXX"
NEW_NAME="XXXXXX"
NEW_EMAIL="XXXXXXX@XXXXXX"
OLD_EMAIL="XXXXXXs@XXXXXX"
if [ "$GIT_AUTHOR_NAME" = "$OLD_NAME" ]
then
 export GIT_COMMITTER_NAME="$NEW_NAME"
 export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
 export GIT_AUTHOR_NAME="$NEW_NAME"
 export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
fi
' --tag-name-filter master -- --branches --tags
```
Replace the fields marked with XXXX and execute this.

Don’t forget to push your code. You might have to use the –force option. After this you will have your commits fixed.

But please don’t forget, the best way to avoid this is to properly configure your name and email using git config:

```
git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"
```
And it’s done. Enjoy!
Top Podcasts For Developer's You Must Know
Tags: javascript, podcast, webdev, beginners
Published: 2022-08-08 10:43:24

🌟 Syntax 🌟

🌟 PodRocket 🌟

🌟 Developer Tea 🌟

🌟 Developer Tea 🌟

🌟 HTTP 203 🌟

🌟 ShopTalk Show 🌟

🌟 Code Newbie 🌟

🌟 CodePen Radio 🌟

🌟React Podcast 🌟

🌟 JavaScript Jabber 10. The Changelog 🌟

Follow @devkshitij7  
For More Amazing Posts....
Laravel tip! How to pass an array of data in parameters to an API rest endpoint
Tags: laravel, endpoint, api
Published: 2022-08-08 10:41:00

Little trick to pass a data table to your method with laravel. 

```
/*
* Url schema
* http://127.0.0.1:8000/api/messages/?message[]=450&message[]=451&message[]=452
*/ 

//Endpoint
Route::delete('messages/{message?}', [MessageController::class, 'delete']);

// Methode delete of MessageController
public function delete(Request $request){
  $messageIds = $request->message;

  Message::delete($messageIds);
}
// The variable $messageIds will be an array containing the ids of the messages 
// to be deleted by the function, when you use dd($messageIds) you can see! 

array:3 [
  0 => "450",
  1 => "451",
  2 => "452"
]

```
How do i use multer's upload.array(fieldname[, maxCount]) for a nested object inside a mongoose subdocument
Tags: multer, express, mongoose, javascript
Published: 2022-08-08 10:39:25

How do i use multer's upload.array(fieldname[, maxCount]) for a nested object inside a mongoose subdocument

**link**: [](https://stackoverflow.com/questions/73276471/how-do-i-use-multers-upload-arrayfieldname-maxcount-for-a-nested-object-in)
How to Google Like a Pro
Tags: tip, beginners
Published: 2022-08-08 10:39:00

### Search for a specific site

- Put "site:" in front of a site or domain.
- **Example:** site:dev.to React Native Custom Hooks
- **Hint:** Don’t put spaces between the symbol or word and your search term. A search for site:dev.to will work, but site: dev.to won’t.

---

### Fill missing words or phrases

- Use Asterisk * to fill missing words or phrases.
- **Example:** How to * in React Native

---

### Exclude words from your search

- Put - in front of a word you want to leave out. 
- **Example:** React Native -navigation

---

### Search for an exact match

- Put a word or phrase inside quotes.
- **Example:** "React Native Navigation"

---

### Search within a range of numbers

- Put .. between two numbers.
- **Example:** Javascript 2017..2022

---

### Combine searches

- Put "OR" between each search query. 
- **Exmaple:** Javascript OR Typescript

---

Important: Not all search operators return exhaustive results. 

Thank you for reading ♥
5️⃣ Free Excel-Like JS Libraries Used For Showing Big Data You Must Know 👨‍💻 A Thread 🧵
Tags: excel, javascript, webdev, beginners
Published: 2022-08-08 10:38:56



🌟 Luckysheet 🌟

🌟 React Data Grid 🌟

🌟 Frappe Database 🌟

🌟 JSspreadsheets🌟

🌟 Handsontable 🌟

Follow @devkshitij7 
For More Amazing Posts...
HTML dropdown list of Nigerian banks with bank codes
Published: 2022-08-08 10:31:10

 <select required class="form-control" id="bankCodes">
                           
                                                     
                         <option value="044">Access Bank</option>                           
                         <option value="023">Citi Bank</option>
                         <option value="559">Coronation Merchant Bank</option>
                          <option value="050">EcoBank</option>
                          <option value="560">FBNQUEST Merchant Bank</option>
                          <option value="070">Fidelity Bank</option>
                                                                                                                           
                          <option value="011">First Bank of Nigeria</option>
                         <option value="214">First City Monument Bank (FCMB)</option>
                         <option value="501">FSDH Merchant Bank</option>
                          <option value="103">Globus Bank</option>
                         <option value="562">Greenwich Merchant Bank</option>
                         
                         <option value="058">Guarantee Trust Bank (GTB)</option>
                        <option value="030">Heritage Bank</option>
                        <option value="301">Jaiz Bank</option>

                        <option value="082">Keystone Bank</option>
                         <option value="303">Lotus Bank</option>
                          <option value="561">Nova Merchant Bank </option>
                       <option value="076">Polaris Bank</option>
                       <option value="101">Providus Bank</option>
                       <option value="502">Rand Merchant Bank </option>
                       <option value="221">Stanbic IBTC Bank</option>
                        <option value="068">Standard Chartered Bank</option>
                        <option value="232">Sterling Bank </option>
                        <option value="100">Suntrust Bank </option>
                        <option value="302">Taj Bank</option>                                                                                                                         
                      <option value="102">Titan Trust Bank</option>                                     
                       <option value="032">Union Bank Plc</option>
                      <option value="033">United Bank for Africa (UBA)</option>
                      <option value="215">Unity Bank</option>
                       <option value="035">Wema Bank</option>
                       <option value="057">Zenith Bank</option>                         
                           
                        </select>
My first coaching call
Tags: webdev, programming, career
Published: 2022-08-08 10:30:10

A few months ago, I got reached out for help. When I read the contents of the message, I was merely surprised. 

## The Surprise

The message said, "Hi, I am XX, I really wish to start my coding journey. I really wish someone could guide me. I am willing to pay about 100$ if you can jump on a half hour call for the job!"

There are many reasons why this message was surprising. 
- This was unlike other contract or freelance work, that I was used to doing. Over the time, I have worked with various tech and on various projects to provide solutions and keep learning. But I could also teach is something I discovered then.
- Being self taught myself, I have been active in many communities. In these years, I have had to ask for help and guidance from several people and even helped a lot of people to be a better dev! It was surprising that there are people willing to pay just for the guidance (not even teaching coding)
- At this point, there are so many resources out there on internet, that it's hard to believe that someone would need anything else to get started at this point!

## The Call

After jumping on the call, I found out the person was a freshman just like me. He was having a hard time deciding what he wanted to do and how he could start out. 
To prepare for the call, I jotted down each field that someone starting out would be interested. From game dev, to mobile dev, to devops, I wrote down everything that I had ever researched about on a paper, ready to present it all.
When we started out, we had a very friendly and casual conversation about our ideals and principles in life and we were about. This gave me a clearer idea about what he exactly wanted and made it easier for him to open up. I, then, opened up a list of roles and careers related to it. 
We then went over each, and eliminated each depending upon things like learning curve, industrial requirements and more. 

## The Final Decision

After going through each option and discussing fallbacks and advantages of each. We decided that Web Development would be perfect to start with. I feel the best feeling for someone who's learning how to code is when they get the chance to make a project out of what they are learning. It was much easier to eliminate other options. For example, if you are a game dev, you also need to have a basic grasp on graphic designing which adds to the learning curve (speaking from experience). Or let's say, starting with something complicated such as web3 for a newbie did not seem like a good option.

## Conclusion

Keep your ears, eyes and messages open for opportunities. Most of all don't be afraid to ask for help (even if you have to pay for it). In this big world of internet, where the endless tutorials can be overwhelming, you can always make your path easier by asking someone who has already done it.
API for Expense Tracker Apps
Tags: api
Published: 2022-08-08 10:15:28

Expense tracking is extensively popular in managing both personal and business finances. But while personal financing does not seem like a huge burden, when it comes to managing expenses for the whole company, the automation of this process is inevitable. 

A lot of money is usually spent on business travel and entertainment and the employer need to keep an eye on the company’s money. Employees, on the other hand, need to claim their expenses to get reimbursement. Apart from the process of reporting expenses itself, the necessary procedures and policies need to be followed. Sometimes the expenses are analyzed in order to avoid overspending or to rationalize the existing habits. These actions are very time-consuming, mistake-prone, and to be honest rather boring for both parties. That’s when technology comes to the rescue.

A good expense tracker will need to integrate with different types of software such as travel management, time tracking, payroll and others. Even text recognition might be of great help.
Most of these functions (as well as some extra) can be acquired with the use of various APIs. For example, for foreign travel your app will have to be able to convert currencies (you can use Currency Converter API or Currency Exchange API). There is also Receipt Extraction API that retrieves the information from receipts. It will considerably decrease the amount of work done and save the time. Another method of automation is email parsing. Again, the data is not entered manually, but rather collected from incoming emails and structured to a known format.

AwardWallet offers Email Parsing API to extract information from emails and use it to track travel expenses. Instead of sending tickets and confirmations to human resources, the user forwards them to the provided email and then everything is done automatically. The required information about the cost of the trip is divided into categories and converted into JSON format. The process takes mere seconds, but the result saves many working hours and allows for a seamless workflow. 
AwardWallet supports most known email formats and continues to add more if necessary.
Medium Alternative: My dream open source project, did it go well?
Tags: rails, opensource, webdev, showdev
Published: 2022-08-08 10:04:00

As a developer, I always dreamt of having an open source project that people actually can use and contribute to, so one day I thought why not make it happen in real?

I was initially a Python/Django developer and got to learn React and Next JS, developed 3 web apps with that knowledge, currently in production, actually functioning.

And while going on a trip to Pokhara with one of my developer friends, introduced me to the cool features of Ruby on Rails, that how one can very quickly make SPAs without any hustle, no worries for DB, form submission, authentication/authorization, web sockets and much other stuff. And that actually was true.

After coming back from the trip, I started learning Ruby. As I was from a Python background, learning the very basics of Ruby wasn't that hard.

Then, I started seeking the Rails 7 tutorials, I was surprised that most of the tutorials were pretty latest. But yeah, some tutorials were from like 2015 to 2018.

I used my googling skills to learn Rails and developed some basic web apps with Ruby on Rails, i.e. Todo App and Chat App. Yeah chat app is pretty basic for Rails because the feature called ActionCable/broadcast does the whole WebSocket stuff on its own.

## The idea bombing
After digging some more, I suddenly remembered my dream open source project, and then why not do it with Rails? I started the project, named it, and started developing it. It's Deviser Club (currently in production).

> https://github.com/Bishwas-py/deviser-club

Deviser Club is my new Ruby on Rails open-source project that I've been talking about this long. It's a multi-blogging platform where you can create posts and quick tweets, like, bookmark, publish content and a few more other stuff.

It might have a medium-like look, so you can call it an open-source medium alternative.
So, yeah.

## The first pull request
The first pull request made me feel very precious because the request was from a nicely popular Rails developer, Yaroslav Shmarov.
Till now, I have got 5 pull requests, 12 stars, 2 forks and 1 watch.


## The probable pause
My SAT exams are in coming December, and I really wanna get into preparation for my exam, but this project is so addictive that I am struggling hard to get out. As most of the students here in Nepal have a dream of studying in the USA, so do I. That's why I might have to pause this project for some while. But let's see, what so on.
Answer to every question
Tags: javascript, tutorial, discuss
Published: 2022-08-08 09:57:35

I had traveled all the way here to Palermo, a city that I adore, in order to witness the revitalization of this magnificent hotel, which had been a symbol of the Belle Époque. However, it was impossible to escape the presence of the Florios anywhere on the property, including the rooms, [super mario bros](https://supermariobros.io) the elegant dining halls, and the dreamy tiered gardens that overlooked the bay. I found that I was reflecting on how those delirious days and nights spent among their famous guests had eventually given way to heartbreak, which ultimately led to the family being banished from the Villa Igiea.

Palermo is the most underestimated and underappreciated city in all of Italy. A visit there would satisfy my need for adventure more than a week in Florence ever could. It is disorderly, swaggering, seductive, unruly, and endlessly charming all at the same time. It veers between gritty backstreet neighborhoods and grand monuments of soaring beauty all throughout its length. Goethe once said that a trip to Sicily was essential to gaining a true appreciation for Italy. He referred to it as the "answer to every question."

Sicily was the geographical epicenter of the world a thousand years ago. The island is home to relics from multiple civilizations, including those of the Phoenicians, the Romans, the Greeks, the Carthaginians, the Arabs, and the Bourbons. As soon as the Normans arrived, they appropriated the practice of making mosaics in the Byzantine style and gave those shimmering surfaces a uniquely Norman flavor. The interior of the large Norman cathedral in the town of Monreale is flooded with golden light, while the mosaics inside the Capella Palatina in the heart of Palermo are widely regarded as some of the greatest works of art ever created in Europe.

Palermo was a royal capital in the same way that Milan, Florence, and Venice were, and the city is filled with palaces in the same way that Manhattan is filled with skyscrapers. At each and every turn, there is yet another enormous heap of debris. Some of them have been repurposed as museums, while others have degenerated into dilapidated tenements piled high with dirty laundry. However, many of these manors are still home to their original noble families.

In the early decades of the 19th century, the enterprising Florios entered this antique world, which is exquisitely evoked in the novel "The Leopard" written by Giuseppe di Lampedusa. They followed in the footsteps of many other prosperous business families by marrying into an increasingly destitute aristocracy, thereby exchanging their wealth for social cachet. Ignazio's father, Ignazio Sr., had married a Sicilian baroness. Ignazio himself proposed to Francesca Paola Jacona della Motta dei Baroni di San Giuliano, commonly known as Donna Franca. The fact that her family came from a less fortunate background had nothing to do with any of her father's objections. He was more concerned about the reputation that Ignazio had for being a womanizer.
Newer Solutions for Old Problems
Published: 2022-08-08 09:29:33

---
title: Newer Solutions for Old Problems
published: true
description: 
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5u3ufxkjfobqq68a66vx.png
# Use a ratio of 100:42 for best results.
canonical_url: 'https://kevwe.com/weekly/202232'
---
You gave up your (professional) life to Enterprisey software ecosystems. You live and breathe a certain language, library or $deity forbid - framework.

Then you wake up one day and discover there is some new language that can give you, for a smaller cost in time and effort, exactly what you formerly needed and have built yourself with great effort.

The temptation of the rewrite is strong, but you need to resist: it's not worth at this point.

But it's still a good teaching. Be humble, some parts of the future can (hopefully) be better one day:

https://kevwe.com/weekly/202232