- May 2023
-
-
'handlers': { 'console': { 'level': 'INFO', 'class': 'logging.StreamHandler', 'stream': sys.stdout, 'formatter': 'verbose' }, },
It's as simple as adding "sys.stdout" to the "stream" attribute.
-
-
codeinthehole.com codeinthehole.com
-
16 August 2011
This is a pretty old article, from 2011. Note that it refers to Python 2.6 and 2.7. Today, Python is up to version 3.12.
-
- Dec 2022
-
-
A Django project is a high-level unit of organization that contains logic that governs your whole web application. Each project can contain multiple apps. A Django app is a lower-level unit of your web application. You can have zero to many apps in a project, and you’ll usually have at least one app. You’ll learn more about apps in the next section.
Tags
Annotators
URL
-
-
www.pythoncheatsheet.org www.pythoncheatsheet.org
-
stackoverflow.com stackoverflow.com
- Oct 2022
-
ordinarycoders.com ordinarycoders.com
-
learndjango.com learndjango.com
- Mar 2022
-
medium.com medium.com
-
Pushing the Django ORM to its limits
-
-
lqez.github.io lqez.github.io
-
Django QuerySet 기능 간단하게 살펴보기
Tags
Annotators
URL
-
- Jun 2021
-
www.b-list.org www.b-list.org
-
Worse still is the issue of “service” layers requiring you to basically build your own ORM. To really do a backend-agnostic service layer on top of the Django ORM, you need to replace or abstract away some of its most fundamental and convenient abstractions. For example, most of the commonly-used ORM query methods return either instances of your model classes, or instances of Django’s QuerySet class (which is a kind of chained-API results wrapper around a query). In order to avoid tightly coupling to the structure and API of those Django-specific objects, your service layer needs to translate them into something else — likely generic iterables to replace QuerySet, and some type of “business object” instance to replace model-class instances. Which is a non-trivial amount of work even in patterns like Data Mapper that are designed for this, and even more difficult to do in an Active Record ORM that isn’t.
I see what this guy means and he has a point. However, I don't think about reimplementing these things when talking about services on Django. I want a centralized place to store business logic (not glue queries) and avoid multiple developers writing the same query multiple times in multiple places. The name "service" here sucks.
-
A second problem is that when you decide to go the “service” route, you are changing the nature of your business. This is related to an argument I bring up occasionally when people tell me they don’t use “frameworks” and never will: what they actually mean, whether they realize it or not, is “we built and now have to maintain and train our developers on our own ad-hoc private framework, on top of whatever our normal business is”. And adopting the service approach essentially means that, whatever your business was previously, now your business is that plus developing and maintaining something close to your own private ORM.
I don't think these two things are even close to be the same thing. Django's ORM is not replaced by services, from what I know services are the ORM with the difference that they are concentrated in a module.
-
-
www.dabapps.com www.dabapps.com
-
This isn't about writing boilerplate setter properties for each field in the model, but rather about writing methods that encapsulate the point of interaction with the database layer. View code can still inspect any field on the model and perform logic based on that, but it should not modify that data directly. We're ensuring that there is a layer at which we can enforce application-level integrity constraints that exist on top of the integrity constraints that the database provides for us.
Addresses the issue raise on this tweet. We are not writing getters and setters out of obligation or convention.
-
- Jun 2020
-
www.educative.io www.educative.io
-
The philosophy behind Flask is that it gives only the components you need to build an app so that you have the flexibility and control. In other words, it’s un-opinionated. Some features it offers are a build-int dev server, Restful request dispatching, Http request handling, and much more.
Flask isn't as full of features as Django (which makes him lighter), but it still offers:
- build-int dev server
- Restful request dispatching
- HTTP request handling
- much more...
Tags
Annotators
URL
-
- May 2020
- Apr 2020
-
stackoverflow.com stackoverflow.com
-
def save(self, *args, **kwargs): return
def delete(self, *args, **kwargs): return
from django.db import models
class MyReadOnlyModel(models.Model): class Meta: managed = False
-
-
code.visualstudio.com code.visualstudio.com
-
To use Gunicorn as your web server, it must be included in the requirements.txt file as an app dependency. It does not need to be installed in your virtual environment/host machine.
-
- Mar 2020
-
djangoforbeginners.com djangoforbeginners.com
Tags
Annotators
URL
-
- Feb 2020
-
agiliq.com agiliq.com
- Nov 2019
-
github.com github.com
-
REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', 'PAGE_SIZE': 100 }
-
- Oct 2019
- Mar 2019
-
stackoverflow.com stackoverflow.com
- Nov 2018
-
github.com github.com
-
- Oct 2018
-
lincolnloop.com lincolnloop.com
- Sep 2018
- Aug 2018
- Dec 2017
-
stackoverflow.com stackoverflow.com
- Sep 2017
- May 2017
-
www.cdr-stats.org www.cdr-stats.org
Tags
Annotators
URL
-
- Apr 2017
-
-
It is great to know that Python comes out on top as a more versatile language .
-
-
simpleisbetterthancomplex.com simpleisbetterthancomplex.com
- Mar 2017
-
docs.djangoproject.com docs.djangoproject.com
-
Use alternate settings module when running tests
Tags
Annotators
URL
-
- Feb 2017
-
www.dabapps.com www.dabapps.com
-
Never write to a model field or call save() directly. Always use model methods and manager methods for state changing operations.
-
- Jan 2017
-
stackoverflow.com stackoverflow.com
-
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
-
-
-
sudo apt-get install libxml2-dev libxslt-dev python-dev lib32z1-dev
-
- Aug 2016
-
www.djangoproject.com www.djangoproject.com
-
1.8 LTS 1.8.14 December 1, 2015 Until at least April 2018
Django 1.8 LTS support until at least April 2018
-