lots of changes

Added a creation_time field to thinks - using the modified time on the
  filesystem wasn't reliable.

Styled the login page.

The index shows the most recent thinks at the top.

Allow authentication by an Authorization header, with a token specified
in settings.py.

Lots of improvements to the editor, including showing the log, and a
form to install Elm packages when editing .elm files.

The Makefile for a project is automatically run each time a file is saved.
This commit is contained in:
Christian Lawson-Perfect 2025-02-07 07:02:35 +00:00
parent 3d5c0c6c73
commit 500eb38774
13 changed files with 1474 additions and 396 deletions

View file

@ -10,6 +10,7 @@ class Think(models.Model):
slug = models.SlugField()
category = models.CharField(max_length=100, blank=True, null=True)
creation_time = models.DateTimeField(auto_now_add=True)
is_template = models.BooleanField(default=False)
@ -58,6 +59,11 @@ class Think(models.Model):
return log
@property
def creation_time(self):
return make_aware(datetime.fromtimestamp(self.root.stat().st_ctime))
def as_json(self):
return {
'slug': self.slug,
'category': self.category,
'absolute_url': self.get_absolute_url(),
'readme': self.get_readme(),
'creation_time': self.creation_time,
}