<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.kalen.pw/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.kalen.pw/feed.php">
        <title>wiki.kalen.pw development:python:django</title>
        <description></description>
        <link>https://wiki.kalen.pw/</link>
        <image rdf:resource="https://wiki.kalen.pw/lib/tpl/SimpleDoku/images/favicon.ico" />
       <dc:date>2026-05-01T04:11:36+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.kalen.pw/doku.php?id=development:python:django:deploy&amp;rev=1625004165&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.kalen.pw/doku.php?id=development:python:django:models&amp;rev=1625005107&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.kalen.pw/lib/tpl/SimpleDoku/images/favicon.ico">
        <title>wiki.kalen.pw</title>
        <link>https://wiki.kalen.pw/</link>
        <url>https://wiki.kalen.pw/lib/tpl/SimpleDoku/images/favicon.ico</url>
    </image>
    <item rdf:about="https://wiki.kalen.pw/doku.php?id=development:python:django:deploy&amp;rev=1625004165&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-06-29T15:02:45+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Deploy</title>
        <link>https://wiki.kalen.pw/doku.php?id=development:python:django:deploy&amp;rev=1625004165&amp;do=diff</link>
        <description>Deploy

----------

	*  Set up virtualenv
	*  Install gunicorn pip install gunicorn
	*  Set ALLOWED_HOSTS = 'domain.com' in project/settings.py
	*  Set STATIC_ROOT = os.path.join(BASE_DIR, 'static') in project/settings.py
	*  Collect static images to one directory</description>
    </item>
    <item rdf:about="https://wiki.kalen.pw/doku.php?id=development:python:django:models&amp;rev=1625005107&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-06-29T15:18:27+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Models</title>
        <link>https://wiki.kalen.pw/doku.php?id=development:python:django:models&amp;rev=1625005107&amp;do=diff</link>
        <description>Models

Methods, tips, and tricks for working with Django Models

----------

Query


from ..models import Post

# all posts
posts = Post.objects.all()
# filtered by field
posts = Post.objects.filter(pub_date__year=2020) # can chain additional .filter() 
# queries are done lazily and won't be ran until necessary
posts = posts.filter(pub_date__month=12)

print(posts) # now the query actually runs</description>
    </item>
</rdf:RDF>
