stephan.poetschner + django   194

Matthias Kestenholz
Hey! I am Matthias. I work at Feinheit and I like family time, open source development and biking.
creatives  django  switzerland 
april 2018 by stephan.poetschner
Save an Auto Generated PDF File to Django model | Coding For Entrepreneurs
from io import BytesIO
from django.core.files import File
from .utils import render_to_pdf

class YourModel(models.Model):
slug = models.CharField(max_length=120)
pdf = models.FileField(upload_to='pdfs/', null=True, blank=True)

# to generate and save your pdf to your model

def generate_obj_pdf(instance_id):
obj = YouModel.objects.get(id=instance_id)
context = {'instance': obj}
pdf = render_to_pdf('your/pdf/template.html', context)
filename = "YourPDF_Order{}.pdf" %(obj.slug), File(BytesIO(pdf.content)))
april 2018 by stephan.poetschner
Working with forms | Django documentation | Django
{{ form.non_field_errors }}
<div class="fieldWrapper">
{{ form.subject.errors }}
<label for="{{ form.subject.id_for_label }}">Email subject:</label>
{{ form.subject }}
<div class="fieldWrapper">
{{ form.message.errors }}
<label for="{{ form.message.id_for_label }}">Your message:</label>
{{ form.message }}
<div class="fieldWrapper">
{{ form.sender.errors }}
<label for="{{ form.sender.id_for_label }}">Your email address:</label>
{{ form.sender }}
<div class="fieldWrapper">
{{ form.cc_myself.errors }}
<label for="{{ form.cc_myself.id_for_label }}">CC yourself?</label>
{{ form.cc_myself }}
django  forms 
january 2018 by stephan.poetschner
Loading Django FileField and ImageFields from the file system
Programmatically push a file from the local file system or remotely via a URL into a Django model. Using a Python shell, a one off script, or a Django management command.
django  filefield  upload 
august 2015 by stephan.poetschner
georgewhewell/django-sheets · GitHub
Use Google Sheets as context variables in Django templates
django  data 
january 2015 by stephan.poetschner
Cookiecutter template with vagrant, salt and Django
django  python 
november 2014 by stephan.poetschner
PostgreSQL locking context managers and functions for Django.
january 2014 by stephan.poetschner
Django friendly finite state machine support
django  python 
december 2013 by stephan.poetschner
Python Stdnet — python stdnet 0.8.2 documentation
Object data mapper and advanced query manager for non relational databases.

Django ORM Like Syntax
python  database  django 
november 2013 by stephan.poetschner
importd is the fastest way to django. No project creation, no apps, no, just an import.
django  python 
february 2013 by stephan.poetschner
Quickstart — django-classymail 1.0-alpha documentation
class WelcomeMail(ClassyMail):
subject = _("Welcome to our website. Thanks for joining us!")

builder = WelcomeMail()
# prints 'Welcome to our website. Thanks for joining us!'
django  email 
february 2013 by stephan.poetschner
ddanier/django_imagequery · GitHub
With ImageQuery you are able to write image manipulations without needing
to learn some low-level API for the most use cases. It allows you to:
* simple manipulation like rescaling
* combining images
* handling text (note: fonts must be available locally)
* even more like creating drop shadows (using the alpha mask)
django  images  python 
december 2012 by stephan.poetschner
« earlier      
per page:    204080120160

Copy this bookmark: