curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y build-essential
sudo apt-get install -y nodejs
In [3]: len(u"я дома".encode('cp1251'))
Out[3]: 6
In [4]: len("я дома")
Out[4]: 11
def add_slide(request):
slide_form = SlideForm()
image_slide_form = ImageSlideForm()
return render(request, "add_slide.html",
{'slide_form': slide_form,
'image_slide_form': image_slide_form})
<form>
{% csrf_token %}
{{ slide_form.as_p }}
{{ image_slide_form.as_p }}
<button type="submit">submit</button>
</form>
npm install
gulp
db_table =
- ето для натягивания джанго на уже существующую бд, структуру которой нельзя менятьclass Article(models.Model):
title = models.CharField(max_length=200)
text = models.TextField()
created = models.DateTimeField()
likes = models.IntegerField(default=0)
category = models.ForeignKey(Category)
def __str__(self): return self.title
class ArticleAdmin(admin.ModelAdmin):
fields = ['category', 'title', 'text', 'created']
likes = models.PositiveIntegerField(default=0, editable=False)
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<meta charset="utf-8">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
Можете подсказать, в чем именно дело?нет
less /var/log/syslog
grep "foo=bar" /var/log/syslog | less
User/group names must match [a-z_][a-z0-9_-]*[$]
Все экземпляры LXC используют один экземпляр ядра операционной системы.