#spaceless#django
Removes whitespace between #HTML#tags. This includes tab characters and newlines.
Example usage:
{% spaceless %}
<p>
<a href="foo/">Foo</a>
</p>
{% endspaceless %}
This example would return this HTML:
<p><a href="foo/">Foo</a></p>
https://docs.djangoproject.com/en/1.11/ref/templates/builtins/#spaceless
http://gregblogs.com/how-django-reactjs-and-browserify/
how-#django-#reactjs#Django_REST_Framework -and-#browserify
https://stackoverflow.com/questions/30288351/how-to-setup-django-1-8-to-use-jinja2
The #Jinja template folder for app dirs defaults to #jinja2 not the standard templates folder.
So try the following directory structure and #Django will locate your Jinja #templates:
mysite
mysite
myapp
jinja2
myapp
index.html
manage.py
And instead of: return render(request, 'myapp/index.html') you should write: return render(request, 'index.html')
How #Django knows to #UPDATE vs. #INSERT
when you call #save (), #Django follows this algorithm:
If the object’s primary key attribute is set to a value that evaluates to True (i.e., a value other than None or the empty string), Django executes an UPDATE.
If the object’s primary key attribute is not set or if the UPDATE didn’t update anything, Django executes an INSERT.
Using the Django authentication system
This document explains the usage of Django’s #authentication system in its default configuration. This configuration has evolved to serve the most common project needs, handling a reasonably wide range of tasks, and has a careful implementation of #passwords and #permissions. For projects where authentication needs differ from the default, #Django supports extensive extension and customization of authentication.
https://docs.djangoproject.com/es/1.11/topics/auth/default/
https://docs.djangoproject.com/en/1.11/ref/contrib/syndication/
The syndication #feed framework
#Django comes with a high-level syndication-feed-generating framework that makes creating #RSS and #Atom feeds easy.
To create any syndication feed, all you have to do is write a short Python class. You can create as many feeds as you want.
Django also comes with a lower-level feed-generating API. Use this if you want to generate feeds outside of a Web context, or in some other lower-level way.
An #apphook allows you to attach a #Django application to a page. For example, you might have a news application that you’d like integrated with #django_cms . In this case, you can create a normal django CMS page without any content of its own, and attach the news application to the page; the news application’s #content will be delivered at the page’s URL.
http://docs.django-cms.org/en/release-3.3.x/how_to/apphooks.html
https://staltz.com/djangoconfi-mongoengine/#/
using #MongoDB as your primary #Django database, #python3. #learn#example
http://www.aparat.com/v/nVaRe
Using a combination of #Django and #Django_REST_Framework, we will build a Restaurant Menu that can be managed via a #REST_API. Starting from the install of the Django REST Framework, we will build our way to a functional #API that meets the needs of developers and #end_users.
http://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication
#Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token that it was signed with. The permission and throttling policies can then use those credentials to determine if the request should be permitted.
#REST framework provides a number of authentication schemes out of the box, and also allows you to implement custom schemes.
#Django_REST_Framework#Django#DRF
https://django-localflavor.readthedocs.io/en/latest/
#django- #localflavor is a collection of assorted pieces of code that are useful for particular #countries or #cultures. These are called the “local flavor” add-ons and live in the localflavor package.
Asynchronous
#celery
celeryproject.org
Distributed task queue.
#flower
pypi.python.org/pypi/flower
Tool for monitoring and management of Celery tasks.
#django-channels
pypi.python.org/pypi/django-channels
Official Django websockets interface, can also be used as task queue.
#rq
pypi.python.org/pypi/rq
RQ is a simple, lightweight, library for creating background jobs, and processing them.
#django-rq
pypi.python.org/pypi/django-rq
A simple app that provides django integration for RQ (Redis Queue).
#django-background-#tasks
github.com/arteria/django-background-tasks
Database backed asynchronous task queue.