
Sending e-mail Although Python makes sending e-mail relatively easy via the smtplib library, Django provides a couple of light wrappers over it. These wrappers are provided to make sending e-mail extra quick, to make it easy to test e-mail sending during development, and to provide support for platforms that can’t use SMTP. The code lives in the django.core.mail module. Quick example In two lines: from django.core.mail import send_mail send_mail('Subject here', 'Here is the message.', 'from@example.com', ['to@example.com'], fail_silently=False) Mail is sent using the SMTP host and port specified in the EMAIL_HOST and EMAIL_PORT settings. Note The character set of e-mail sent with django.core.mail will be set to the value of your DEFAULT_CHARSET setting. send_mail() send_mail(subjectmessagefrom_emailrecipient_listfail_silently=Falseauth_user=Noneauth_password=Noneconnection=None) The simplest way to send e-mail is using django.core.mail.send_mail(). send_mass_mail() (subject, message, from_email, recipient_list)
Model instance reference A few object methods have special purposes. __unicode__ Model.__unicode__() The __unicode__() method is called whenever you call unicode() on an object. Django uses unicode(obj) (or the related function, str(obj)) in a number of places. For example: from django.db import models class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) def __unicode__(self): return '%s %s' % (self.first_name, self.last_name) If you define a __unicode__() method on your model and not a __str__() method, Django will automatically provide you with a __str__() that calls __unicode__() and then converts the result correctly to a UTF-8 encoded string object. __str__ Model. The __str__() method is called whenever you call str() on an object. from django.db import models class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) def __str__(self): return '%s %s' % (self.first_name, self.last_name) <! Note
A Detailed Django Tutorial: Blog Basics Part IV This is the last part of this 4 part series by Jeff Hui. If you wish, you can download the entire tutorial without having it split up. Today we’ll be learning the gist of Django, a pythonic web framework. If you’ve never dealt with (or even seen) python code before, I recommend skimming through python’s official tutorial. if myvariable == True: print “myvariable is True” print “Always printed” One other thing to note is that boolean variables are True and False (case-sensitive). Table of Contents Comments What’s a blog without comments? ‘django.contrib.comments’, Then we need to map it to a url. (r’^comments/’, include(‘django.contrib.comments.urls’)), Now we can start adding comments to our posts. Listing page Edit posts/post_list.html to match the following: Detail Page Edit post_detail.html and add the following after the include tag: The get_comments_list tag does what it says. Finally, we’ll add a comment form so users can post new comments. <hr/> <h3>Your comment</h3> Final Result Homepage
Outputting PDFs with Django This document explains how to output PDF files dynamically using Django views. This is made possible by the excellent, open-source ReportLab Python PDF library. The advantage of generating PDF files dynamically is that you can create customized PDFs for different purposes – say, for different users or different pieces of content. For example, Django was used at kusports.com to generate customized, printer-friendly NCAA tournament brackets, as PDF files, for people participating in a March Madness contest. Install ReportLab Download and install the ReportLab library from Test your installation by importing it in the Python interactive interpreter: If that command doesn't raise any errors, the installation worked. Write your view The key to generating PDFs dynamically with Django is that the ReportLab API acts on file-like objects, and Django's HttpResponse objects are file-like objects. Here's a "Hello World" example: Complex PDFs Other formats
Custom template tags and filters Django’s template system comes with a wide variety of built-in tags and filters designed to address the presentation logic needs of your application. Nevertheless, you may find yourself needing functionality that is not covered by the core set of template primitives. You can extend the template engine by defining custom tags and filters using Python, and then make them available to your templates using the {% load %} tag. Code layout Custom template tags and filters must live inside a Django app. If they relate to an existing app it makes sense to bundle them there; otherwise, you should create a new app to hold them. The app should contain a templatetags directory, at the same level as models.py, views.py, etc. Your custom tags and filters will live in a module inside the templatetags directory. For example, if your custom tags/filters are in a file called poll_extras.py, your app layout might look like this: polls/ models.py templatetags/ __init__.py poll_extras.py views.py
Web Design Video and Development Tutorial Library // Think Vitamin Membership Gmail and Django - ltslashgt Did a bit of running around today to get Django sending email via Gmail. It’s simple once you figure it out. If you’re running 0.96, upgrade to the latest development version or apply the patch from ticket #2897. 0.96 does not support TLS, which Gmail requires. EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'youremail@gmail.com' EMAIL_HOST_PASSWORD = 'yourpassword' EMAIL_PORT = 587 You can use the shell to test it: >>> from django.core.mail import send_mail >>> send_mail('Test', 'This is a test', to=['youremail@somewhere.com']) Edit: Bryan commented that send_mail is deprecated. >>> from django.core.mail import EmailMessage >>> email = EmailMessage('Hello', 'World', to=['youremail@somewhere.com']) >>> email.send()
Configuring other mail clients - Gmail Help Google Apps-gebruikers moeten de standaardinstructies volgen tenzij anders aangegeven, waarbij 'jouw_domein.nl' moet worden vervangen door de feitelijke domeinnaam. Door veel clients worden de geschikte IMAP-instellingen voor je account automatisch geconfigureerd, maar bevestig dat de instellingen voor de verbinding die door de client worden geconfigureerd dezelfde zijn als degenen die hieronder worden vermeld. Als je een client gebruikt die hieronder niet wordt vermeld, kun je de volgende informatie gebruiken om IMAP te configureren. Als je problemen hebt, neem je contact op met de afdeling klantenservice van je e-mailclient voor verdere instructies. Server voor inkomende berichten (IMAP); hiervoor is SSL vereist imap.gmail.com Poort: 993 SSL vereist? Ja Server voor uitgaande berichten (SMTP); hiervoor is TLS vereist smtp.gmail.com Poort: 465 of 587 SSL vereist? Als je client geen SMTP-verificatie ondersteunt, kun je met deze client geen e-mail verzenden vanaf je Gmail-adres.
PDF Toolkit documentation — reportlab v2.4 documentation Navigation Next topic package reportlab.pdfgen This Page Show Source Quick search Enter search terms or a module, class or function name. ReportLab PDF Toolkit documentation¶ API references and more for the ReportLab PDF Toolkit Contents: Sphinx is being used for the automated API references. © Copyright 2010, Robinson, Becker, Watters and many more. jespern / django-piston / wiki / Home – Bitbucket Get the latest version (0.2.3) here. NEW: Discussion group is hosted on Google Groups. A mini-framework for Django for creating RESTful APIs. Piston is a relatively small Django application that lets you create application programming interfaces (API) for your sites. It has several unique features: Ties into Django's internal mechanisms. NB: OAuth ships with piston for now, but you are not required to use it. Documentation But, examples speak louder than documentation: Fully functional example urls.py: And as for handlers.py: And that's all there's to it. Getting Help Piston is well documented and has an ever-growing FAQ. Go read the Documentation.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
2025-08-03 18:45
by raviii Aug 4
by raviii Oct 1
Ethnography - is the study of human behaviour and relations within a cultural context. The approach has become subject to debate, partly because of our contemporary awareness that simplistic notions of culture (such as those which satisfied the early anthropologists working in 'foreign' settings) can be misleading- indeed, the very notion of 'culture' is increasingly recognised to be problematic.
Found in: Davies, M. (2007) Doing a Successful Research Project: Using Qualitative or Quantitative Methods. Basingstoke, Hampshire, England, United Kingdom: Palgrave Macmillan. ISBN: 9781403993793. by raviii Jul 31
Ethnography - A qualitative research methodology used to observe people in their natural and uncontrolled social and cultural settings.
Found in: Glossary of Key Terms: by raviii Jul 31
Ethnography: a qualitative research methodology, which places great emphasis on trying to reveal and understand the way respondents look at the world. It is often associated with the use of participant observation.
Found in: 2012 - (Oliver) Succeeding With Your Literature Review by raviii Apr 10
it's a way of getting involved with the people who are using the knowledge by raviii Mar 1
revealing how people describe and structure their world. it uses observation, and in depth interviews by raviii Mar 1
emphasising the everyday experience of individuals by raviii Mar 1
Ethnographic techniques were initially developed in sociology by raviii Mar 1