From 650e35b82034c351cb2b50736a5fbc29ec92d3d6 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Wed, 24 Apr 2019 09:13:47 -0400 Subject: [PATCH] Back to Snipt --- Makefile | 2 +- README.md | 28 ++++++++++++++-------------- settings_local.py-template | 4 ++-- snipts/views.py | 10 +++++----- teams/templates/teams/for-teams.html | 4 ++-- templates/base.html | 8 ++++---- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 687a6e8..4313f71 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ deploy: git push dokku run: - ~/.virtualenvs/snippets/bin/python manage.py runserver + ~/.virtualenvs/snipt/bin/python manage.py runserver sass: sass media/css/style.scss > media/css/style.css diff --git a/README.md b/README.md index 8781944..55e356e 100644 --- a/README.md +++ b/README.md @@ -3,30 +3,30 @@ ## Running locally - Clone the repo. -- `cd snippets` -- `python3 -m venv ~/.virtualenvs/snippets` -- `source ~/.virtualenvs/snippets/bin/activate` +- `cd snipt` +- `python3 -m venv ~/.virtualenvs/snipt` +- `source ~/.virtualenvs/snipt/bin/activate` - `pip install -r requirements.txt` - `brew install postgresql` - `brew services start postgresql` -- `createuser snippets` -- `createdb snippets --owner=snippets` +- `createuser snipt` +- `createdb snipt --owner=snipt` - `cp settings_local.py-template settings_local.py` // modify if necessary - `curl -X PUT "localhost:9200/haystack?pretty"` -- `python manage.py update_index` // optional if you have a local DB dump with snippets +- `python manage.py update_index` // optional if you have a local DB dump with snipt - `make run` ## Deploying on Dokku -- `dokku apps:create snippets` -- `dokku postgres:create snippets` -- `dokku postgres:link snippets snippets` +- `dokku apps:create snipt` +- `dokku postgres:create snipt` +- `dokku postgres:link snipt snipt` - `scp snipt.dump nsergeant@server.nicksergeant.com:/home/nsergeant` -- `dokku postgres:connect snippets < snipt.dump` -- `dokku domains:add snippets snippets.siftie.com` -- `dokku storage:mount snippets /var/lib/dokku/data/storage/snippets-whoosh:/app/snippets-whoosh` -- `dokku config:set DOKKU_LETSENCRYPT_EMAIL=team@siftie.com SECRET_KEY= USE_SSL=true WHOOSH_PATH=/app/snippets-whoosh/whoosh_index` -- `git remote add dokku dokku@server.nicksergeant.com:snippets` +- `dokku postgres:connect snipt < snipt.dump` +- `dokku domains:add snipt snipt.net` +- `dokku storage:mount snipt /var/lib/dokku/data/storage/snipt-whoosh:/app/snipt-whoosh` +- `dokku config:set DOKKU_LETSENCRYPT_EMAIL=support@snipt.net SECRET_KEY= USE_SSL=true WHOOSH_PATH=/app/snipt-whoosh/whoosh_index` +- `git remote add dokku dokku@server.nicksergeant.com:snipt` - `git push dokku` ## Automatic deploy to Heroku diff --git a/settings_local.py-template b/settings_local.py-template index e045285..b12d25c 100644 --- a/settings_local.py-template +++ b/settings_local.py-template @@ -9,8 +9,8 @@ USE_HTTPS = False DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'snippets', - 'USER': 'snippets', + 'NAME': 'snipt', + 'USER': 'snipt', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '' diff --git a/snipts/views.py b/snipts/views.py index b5668a8..6a0718f 100644 --- a/snipts/views.py +++ b/snipts/views.py @@ -398,12 +398,12 @@ def report_spam(request, snipt_id): send_mail('[Snipt] Spam reported', """ - Snipt: https://snippets.siftie.com/admin/snipts/snipt/{}/ - User: https://snippets.siftie.com/admin/auth/user/{}/delete/ - User who reported: https://snippets.siftie.com/admin/auth/user/{}/ + Snipt: https://snipt.net/admin/snipts/snipt/{}/ + User: https://snipt.net/admin/auth/user/{}/delete/ + User who reported: https://snipt.net/admin/auth/user/{}/ """.format(snipt.id, snipt.user.id, request.user.id), - 'team@siftie.com', - ['nick@siftie.com'], + 'support@snipt.net', + ['support@snipt.net'], fail_silently=False) return HttpResponse("""Thanks! Your report has been diff --git a/teams/templates/teams/for-teams.html b/teams/templates/teams/for-teams.html index e4101a0..f90976b 100644 --- a/teams/templates/teams/for-teams.html +++ b/teams/templates/teams/for-teams.html @@ -24,9 +24,9 @@ Snipt for Teams
  • Team profile at snipt.net/{team-name}.
  • -
  • Members can create and edit public and private snippets on a team.
  • +
  • Members can create and edit public and private snipts on a team.
  • Detailed log of changes on a snippet, including user and code diffs.
  • -
  • Maintain a public team profile by posting public snippets.
  • +
  • Maintain a public team profile by posting public snipts.
{% if not request.user.is_authenticated %} diff --git a/templates/base.html b/templates/base.html index 46ebb1a..fdca4cf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -78,7 +78,7 @@ - + @@ -87,7 +87,7 @@