mkdir temp
cd temp
git clone https://github.com/python/cpython.git
./configure --prefix=$HOME/bin/python
make
make install
# удалить симлинк python3 на python3.6
rm /home/$USERNAME/bin/python/bin/python3
export PATH=$PATH:/home/$USERNAME/bin/python/bin
python3.6 -V
> Python 3.6.0a3+
# справка по созданию виртуального окружения
python3.6 -m venv -h
import time
from datetime import date, timedelta, datetime
tomorrow = date.today() + timedelta(days=1)
tomorrow_needed_time = datetime(tomorrow.year ,tomorrow.month, tomorrow.day, 2, 0)
unixtime = time.mktime(tomorrow_needed_time.timetuple())
from ckeditor.widgets import CKEditorWidget
from django import forms
class PostEditForm(forms.Form):
content = forms.CharField(widget=CKEditorWidget, label='')
<form ...>
{{ post_form.media }}
...
</form>
def view(request):
post_form= PostEditForm(request.POST)
context = {
"post_form" : post_form,
}
return render(request, 'template.html', context)
src/
- project/
- - settings.py
- - wsgi.py
- someapp/
- - templates/
- - - someapp/
- - - - hello.html
- - static/
- - - css/
- - - - bootstrap.min.css
- - - js/
- - - - app.js