Skip to content
πŸ‘¨β€πŸ’» Code snippets for teams and individuals.
Branch: master
Clone or download
Latest commit 4eff586 Apr 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
accounts
blogs
media Revert "Snipt -> Siftie, first pass." Apr 24, 2019
snipts Back to Snipt Apr 24, 2019
static Remove accidental static commits Oct 17, 2015
teams Back to Snipt Apr 24, 2019
templates
user-admin Black. Jan 23, 2019
utils Black. Jan 23, 2019
.gitignore
.venv Adding venvs Nov 6, 2011
Makefile Back to Snipt Apr 24, 2019
Procfile
README.md Readme Apr 24, 2019
__init__.py
app.json Revert "Snipt -> Siftie, first pass." Apr 24, 2019
manage.py Removing some old Gunicorn stuff and refactors for Django 1.6. Nov 6, 2013
requirements.txt Bump Apr 24, 2019
settings.py Revert "Snipt -> Siftie, first pass." Apr 24, 2019
settings_local.py-template Back to Snipt Apr 24, 2019
urls.py Disable search until we can get ES going again. Jan 31, 2019
views.py Homepage and report spam. Mar 11, 2019
wsgi.py Need settings. Nov 30, 2016

README.md

Snipt

Running locally

  • Clone the repo.
  • 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 snipt
  • createdb snipt --owner=snipt
  • cp settings_local.py-template settings_local.py // modify if necessary
  • make run

Deploying on Dokku

  • 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 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=<some-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

You can click the button below to automatically deploy Snipt to Heroku.

Deploy

Manual deploy to Heroku

  • Clone the repo.
  • heroku create
  • heroku addons:add heroku-postgresql:hobby-dev
  • heroku addons:add searchbox
  • heroku config:add SECRET_KEY=<some-secret-key>
  • git push heroku
  • heroku run python manage.py migrate
  • heroku run python manage.py createsuperuser
  • Visit yourapp.herokuapp.com and login with the user you just created.

Updating your Heroku instance after an automatic deploy

  • git clone https://github.com/nicksergeant/snipt
  • cd snipt
  • git checkout heroku
  • heroku git:remote -a <your-instance-name>
  • git push heroku heroku:master

Options

If you want email support (for password resets, server errors, etc):

  • heroku addons:create postmark:10k
  • heroku run addons:open postmark -> use an email you control and confirm it
  • heroku config:add POSTMARK_EMAIL=<email_from_above>

If you want to disable user-facing signup:

  • heroku config:set DISABLE_SIGNUP=true

If you want to enable Django's DEBUG mode:

  • heroku config:add DEBUG=true

If you want to enable SSL on a custom domain after you've configured your Heroku SSL cert:

  • heroku config:add USE_SSL=true
You can’t perform that action at this time.