Day 10 Dev Notes
More refactoring again, renaming content
to post
in various part of the code. I also made a couple of small functional changes:
- Added a
author_display_name
property to the Post model. All this does right now is show the first name if it's set, otherwise it shows the username, but this could be more configurable in the future. - I move the Markdown extensions that are loaded, into the settings file as a constant called
MARKDOWN_EXTENSIONS
. I may use this to help decide whether to load the Pygments CSS file since that's only needed if thecodehilite
extension is used. But that's something to think about another day, since there are some other concerns with making this too configurable.
I don't think I need to make too many more changes in its current state. My next focus will to convert djpress
into a reusable package.
Update
Also added support for Markdown tables by adding it to the MARKDOWN_EXTENSIONS
constant. Amazingly, Github Copilot predicted that I wanted to add tables
as the next value as soon as I had added the comma at the end of the list. Sometimes these LLM bots are pretty clever.
Env Name | Env Value |
---|---|
SECRET_KEY | The Django secret key to add to the settings.py file. |
DEBUG | Ensure this is set to False in production. |
ALLOWED_HOSTS | List of allowed hosts, e.g. example.com,www.example.com . |
EMAIL_HOST | Name or IP address of the SMTP server. |
EMAIL_PORT | The port of the SMTP server. |
EMAIL_HOST_USER | The username to authenticate with the SMTP server. |
EMAIL_HOST_PASSWORD | The password for the SMTP server username. |
EMAIL_USE_TLS | Either True or False to use TLS. |
DEFAULT_FROM_EMAIL | The email address to send emails from . |
DB_ENGINE | The database engine to use. |
DB_NAME | The database name to connect to. If using SQLite, this will be the filename without the extension. |
DB_HOST | Name or IP address of the database server. |
DB_PORT | The port of the database server. |
DB_USER | The username to authenticate with the database server. |
DB_PASSWORD | The password for the database server username. |
WHITENOISE_STATIC | Boolean value that turns on Whitenoise for serving static content. |
ADMIN_URL | The path to the Admin site so it can be hidden from easily being guessed. |