GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: django/contrib/admin/templates/admin/change_list.html | |
=================================================================== | |
--- django/contrib/admin/templates/admin/change_list.html (revisión: 16133) | |
+++ django/contrib/admin/templates/admin/change_list.html (copia de trabajo) | |
@@ -27,6 +27,18 @@ | |
(function($) { | |
$(document).ready(function($) { | |
$("tr input.action-select").actions(); | |
+ | |
+ $('#display-filter').click(function(event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @author http://djangosnippets.org/users/chrsgrrtt/ | |
* @link Taken from http://djangosnippets.org/snippets/2160/ | |
* @updated by Artur Barseghyan (fixed) | |
* | |
* Original readme: | |
* Using jQuery UI to add "drag and drop" reordering of items in the admin list view. The model must have an "order" | |
* field to store the order value in. | |
* | |
* Add the following to your model admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://djangosnippets.org/snippets/2398/ | |
from django.core.management.base import BaseCommand | |
from django.db.models import get_models, get_app | |
from django.contrib.auth.management import create_permissions | |
class Command(BaseCommand): | |
args = '<app app ...>' | |
help = 'reloads permissions for specified apps, or all apps if no args are specified' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var detectBrowser = function(){ | |
var ua = navigator.userAgent, tem, | |
M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; | |
if (/trident/i.test(M[1])) { | |
tem= /\brv[ :]+(\d+)/g.exec(ua) || []; | |
return 'IE ' + (tem[1] || ''); | |
} | |
if (M[1] === 'Chrome') { | |
tem = ua.match(/\bOPR\/(\d+)/); | |
if (tem != null) return 'Opera ' + tem[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A test to see whether the tld module recognizes all the valid domains. | |
""" | |
import requests # http://docs.python-requests.org/en/latest/ | |
import tld # https://pypi.python.org/pypi/tld | |
# Mozilla curated db of tlds. Used by tld module | |
tlds = requests.get("https://publicsuffix.org/list/effective_tld_names.dat") | |
valid_urls = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logger = logging.getLogger('django.db.backends') | |
logger.setLevel(logging.DEBUG) | |
logger.addHandler(logging.StreamHandler()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-setuptools | |
sudo easy_install virtualenv | |
sudo easy_install virtualenvwrapper | |
mkdir ~/.virtualenvs | |
echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When you render the forms media, it puts all JS and CSS files in one place. Quite often you want to | |
have CSS to be rendered in the top of the page and JS at the bottom. | |
Below - a Django template filter to render the media files (JS and CSS) separately, instead of all | |
together in just one place. | |
In that way you can do the following in your template: | |
.. code-block:: html |
OlderNewer