Content
- Mounting means putting elements into the DOM.
Content
Click ⭐if you like the project. Pull Request are highly appreciated.
| No. | Questions |
|---|---|
| 1 | Why python is not support Overloading concept? |
| /* | |
| * Handle Django serializers errors and return error in html (ul/li) format. | |
| * | |
| * Error structure examples | |
| * // The most simple case | |
| * { detail: "Authentication is required" } | |
| * | |
| * // Simple form validation error | |
| * { title: ["This field is required."], "description": ["This field is required."]} | |
| * |
| from django.db import models | |
| class AbstractDateTime(models.Model): | |
| ''' | |
| Abstract model for created_on and updated_on field in models | |
| ''' | |
| created_on = models.DateTimeField(auto_now_add=True) | |
| updated_on = models.DateTimeField(auto_now=True) |
| # setting.py file | |
| ''' | |
| JS logger configuration used in application | |
| ''' | |
| LOGGING = { | |
| 'version': 1, | |
| 'disable_existing_loggers': True, | |
| 'formatters': { | |
| 'standard': { |
| ''' | |
| Ref blog | |
| - https://www.programiz.com/python-programming/user-defined-exception | |
| - https://stackoverflow.com/questions/1319615/proper-way-to-declare-custom-exceptions-in-modern-python | |
| ''' | |
| # Basic use | |
| class CustomError(Exception): | |
| pass |
| pip install boto3 | |
| python manage.py runserver | |
| pip install awscli | |
| aws --version | |
| aws configure # set configuration of user | |
| aws s3 ls # get listing of all buckets | |
| aws s3 ls s3://imageprocess-python/ # access certain bucket |
| # check attachment files | |
| # find_distance.py | |
| import os | |
| from datetime import datetime | |
| import googlemaps | |
| from django.conf import settings | |
| from packages.common_func import get_or_none, convert_float | |
| from network.models import Distance, LatLong |
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Sat Jun 8 17:19:13 2019 | |
| @author: 63315 | |
| """ | |
| import googlemaps | |
| from datetime import datetime |