Giter Site home page Giter Site logo

writertools's Introduction

Writer Tools

A Django project for my writer tools website.

Roadmap

Development

Check out the code and run:

python ./manage.py devsetup

This will create a virtual environment and install requirements. Note that the version of Python used to run devsetup will be the one used in your virtual environment.

Dependency Management

This project includes pip-tools for dependency management. There are two requirements files: requirements.in provides the acceptable ranges of packages to install in a production environment (or any other environment); requirements-dev.in provides packages to install in development environments. Both of these have corresponding "pin" files: requirements.txt and requirements-dev.txt.

To add a new dependency, add it to the correct .in file, and then run manage.py pipsync to regenerate the pin files and synchronize your current virtual environment with the new pin files.

Any arguments passed to manage.py pipsync will be passed through to the underlying pip-compile command. For example, to bump to the latest Django patch release use manage.py pipsync --upgrade-package django. See the pip-tools docs for complete details.

The pin files are not included in the template repository, but will be generated when you run manage.py devsetup. This ensures you will get the latest version of Django and related packages when starting a new project.

writertools's People

Contributors

veselosky avatar dependabot[bot] avatar

Stargazers

Meet Rajesh Gor avatar

Watchers

 avatar

writertools's Issues

Infrastructure Build

  • EC2 instance
  • Elastic IP
  • Cloudflare configuration

MAYBE: Script creation of a new deployment environment. (?)

EC2 Instance

Started via console, Ubuntu 22.04 on t4g.small (special deal, t4g.small is Free Tier for all users through 2023-12). Allocated 12GB of gp3 storage (gp3 is cheaper and faster than gp2, see blog post.

Apache modules on by default: access_compat alias authn* authz* autoindex deflate dir env filter mime negotiation reqtimeout setenvif status

Apache modules MUST enable: proxy proxy_http rewrite
Rewrite is required for redirect http->https in a way that's compatible with Let's Encrypt's ACME protocl.
Proxy and proxy_http are needed to pass requests to gunicorn.

Apache modules maybe enable: expires headers http2 include

sudo apt update && sudo apt upgrade
# Note: initial updates included a kernel update, so reboot was required.
APT_PACKAGES="apache2 python3 python3-pip python3-venv sqlite3"
APACHE_MODULES="headers proxy proxy_http rewrite"

sudo apt install $APT_PACKAGES
sudo a2enmod $APACHE_MODULES
sudo /etc/init.d/apache2 restart

# Let's Encrypt recommend install certbot from snap, not system packages, for latest
sudo snap install core 
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot

# Create /run/gunicorn for gunicorn heartbeat https://docs.gunicorn.org/en/latest/settings.html#worker-tmp-dir
sudo install -o www-data -g www-data -m 0775 -d /run/gunicorn

# Let's treat our adm group as web admins.
# Allow adm to start/stop/restart apache (for deployments), enable or disable modules, sites, and confs
# with the a2* scripts, and run programs (gunicorn) as www-data
cat <<'EOF' > ./50-adm
%adm ALL=(root) NOPASSWD: /etc/init.d/apache2, /usr/sbin/a2*
%adm ALL=(www-data) NOPASSWD: ALL
EOF
sudo install -m 0400 ./50-adm /etc/sudoers.d/50-adm
# We'll also allow them to install/remove confs and vhosts by making those dirs writeable
sudo chgrp adm /etc/apache2/conf-available /etc/apache2/sites-available
sudo chmod 2775 /etc/apache2/conf-available /etc/apache2/sites-available

# Create a user to own our app. Note the user has disabled password and needs keys to log in.
sudo adduser --disabled-password --gecos "Django user" django

# Apache's logs are readable by adm, process runs as www-data
sudo usermod -aG adm,www-data django

# Allow user to login via ssh using any keys that have access to your Github account
sudo -u django bash <<"EOF"
mkdir -p -m 0700 /home/django/.ssh
touch /home/django/authorized_keys
chmod 0600 /home/django/authorized_keys
curl  https://github.com/veselosky.keys >> /home/django/.ssh/authorized_keys
EOF

Data Load: Reading for Writers

  • Load the Reading for Writers database with the list of books from Evernote Books for Writers
  • Add Books2Read link for each book (can this be automated?)
  • Add each book to Bookshop.org shop (can this be automated?)

Deployment Automation

  • GenericSite test and release workflow (upload to S3)
  • Writer Tools test and release workflow (upload to S3)
  • Apache configuration file
  • gunicorn config file
  • Bootstrap the installation (initial deployment)
  • Script to deploy new version.
  • Web hook receiver to run deployment script (authenticated)
  • Github web hook to notify deployment service when new release is available (with auth token)

Initial site buildout

  • Site tagline: in one line, what's your value proposition?
  • Home page copy (pre-content). In one paragraph, what's Webquills about? Who do we serve, what problem do we solve, and how?
  • Blog: Articles featured on home page.

Initial deployment

Don't bother automating yet, just document the steps and get it done. Configure for Webquills.com. Leave Webquills.net pointed at old static blog.

Third party accounts for Reading for Writers

  • Affiliate code for Amazon
  • Affiliate code for Apple
  • Affiliate code for Kobo
  • Books2Read account, configure with affiliate codes
  • Bookshop.org Shop: affiliate revenue for paper books

Content Strategy

Document the content strategy:

  • Identify sidebar modules
  • Identify home page modules
  • Identify email templates needing copy
  • Plan types of posts
  • Plan posting schedule

Audience Strategy

How to attract an audience (aka marketing).

  • Plan social media strategy

Site uptime monitor

Method of monitoring to ensure deployment succeeds, site still up after deployments.

Script to back up data

Create a script to zip up the database file and media files and upload to S3 with time stamp for backup purposes. (Can also be used to bootstrap local dev env!)

Django app for Reading for Writers

Table for storing

  • Table for storing books
  • Admin for managing
  • Method for selecting and tracking "book of the month" (automatic, with manual override)
  • "book of the month" sidebar module
  • Recommended Reading module for associating specific books with Articles

Plot Board

A story boarding tool to visualize story structure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.