This guide walks you through building your first complete Pytigon application from scratch.
A simple task management application with: - A database table for tasks - List and edit views - A form for creating/editing tasks - Basic permissions
pytigon create my_tasks
cd my_tasks
This creates the project structure with a default application.
Create prj/my_tasks/models.py:
from django.db import models
from pytigon_lib.schdjangoext.models import JSONModel
class Task(JSONModel):
title = models.CharField(max_length=200)
description = models.TextField(blank=True)
priority = models.IntegerField(default=0)
completed = models.BooleanField(default=False)
due_date = models.DateField(null=True, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ['priority', '-created_at']
def __str__(self):
return self.title
Create prj/my_tasks/apps.py:
APPS = ['my_tasks']
PUBLIC = True
Pytigon's schdevtools IDE can generate views automatically, or you can define them manually in the .prj project file. The IDE approach:
pytigon runpytigon run
Visit http://localhost:8000/ and navigate to your application. You should see:
- A list view showing all tasks
- Add/edit/delete buttons
- Your configured columns
In schdevtools, go to Forms and create a form for the Task model:
See the Quick Start guide for broader overview, and the Developer Tools section for IDE documentation.