The most common commands so I don't forget!
- list files
ls
- list all files (including .dot files)
ls -a
- list all files (with long format)
ls -l
- make directory
mkdir [opt] dir
var link = $(".btn"); | |
link.click( | |
function(event){ | |
//eliminate the default function | |
event.preventDefault(); | |
$.ajax({ | |
url: '/formulario/', | |
data: $('#new-form').serialize(), | |
type: "POST", |
{% extends 'base.html' %} | |
{% load staticfiles %} | |
{% load selectize_tags %} | |
{% block extra_css %} | |
{% selectize_tags_media 'css' %} | |
{% endblock extra_css %} | |
{% block content %} | |
<form class="form-horizontal" action="." method="post"> |
""" | |
The purpose of this function files is to keep all the helpfull | |
functions constanlly used in a django base project. | |
""" | |
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger | |
def paginated_list(request, object_class, list_length, order=None, *args, **kwargs): | |
""" | |
The purpose of this function is to generate the list of all the |
class MyCommonlyUsedModel(models.Model): | |
class Meta: | |
managed = False | |
db_table = 'app_largetable' | |
f1 = models.Field(...) | |
f2 = models.Field(...) | |
# A model that allows the migrations framework to also manage the table | |
# Not sure if this actually works, but would allow for a more DRY approach | |
class MyManagedModel(MyCommonlyUsedModel): |
SQLite3 Cheat Sheet
Download from: http://www.sqlite.org/download.html Getting Started: http://www.sqlite.org/sqlite.html Documentation: http://www.sqlite.org/docs.html
#models.py | |
#Stdlib imports | |
import datetime | |
#Django core Imports | |
from django.db import models | |
from django.contrib.auth.models import ( | |
BaseUserManager, AbstractBaseUser, PermissionsMixin | |
) |
Thanks to [Serafeim Papastefanos] for authoring this tutorial. Please note that the installation process is in flux; most of the steps here should soon be unnecessary.
[Wagtail] is a new Open Source [Django]-based CMS. In this 20 minute tutorial we will see how you can create a blog from scratch using Wagtail. If you want to see some more examples of usage please take a look at the [wagtaildemo] GitHub project.
To follow this tutorial you will need to have [Python] 2.7 installed with a working version of [pip] and [virtualenv].
Installing the wagtail dependencies