-
Notifications
You must be signed in to change notification settings - Fork 9
Adding a New Site
At the time of this writing, we have several sites served from the same repository, including the Tenant Platform (app.justfix.nyc), NoRent (norent.org) and Eviction Free NY (evictionfreeny.org).
Because we use Django, this is actually not super hard to set up! Here are some instructions you might find useful.
Check out this PR (also listed in PRs of note) to see how to make changes in our codebase that will allow you to start building a new site on the same infrastructure.
- Add new, empty eviction free site. #1800 At the time of this writing, the same server actually serves the content for app.justfix.nyc, norent.org, and evictionfreeny.org. If you want to know more about how this is done, check out this PR, which added a skeleton for the evictionfreeny.org site to the repository.
Once you've added that new code, you can spin up the tenant platform locally (e.g. docker-compose up) and add a new Site record via the Django admin page on your local deployment.
See the NoRent.org part of the README for instructions on this.
After doing that, you should be able to go to, for example, localhost.<sitename>:8000 to see your new site.
In order to make your site visible on staging (e.g. at demo-<sitename>.justfix.nyc), you'll have to add a subdomain on Heroku.
- Go to to the "Domains" section of Heroku's
tenants2-devapp settings. It should look something like
Domain Name DNS Target ACM Status
------------------------------------------------------------------------------------------------
demo.evictionfreeny.org weird-name-sd7fjkde9fjf OK
demo.evictionfree.org weird-name-2
demo.justfix.nyc weird-name-3
...etc.
- Add a new domain. The easiest way to do this is to add a new prefix to the
.justfix.nycdomain.
- Click
add domainand enterdemo-<sitename>.justfix.nyc. That is the naming convention we started withdemo-whoownswhat.justfix.nyc. - This will add a new record to the list and give you a DNS target. Copy that.
- Half our domains are registered on Name.com and half are on AWS's Route53. Find the right place for the top level domain you're trying to create a subdomain for. Justfix.nyc is on Amazon.
- Add a new CNAME record to the domain registration, like:
Record name: demo-<sitename>.justfix.nyc
Record type: CNAME
Value: <DNS target you copied from #2>
Alias: No
TTL: 300
Routing policy: simple
- Test it out!
- Give the DNS a minute to propagate, then go to
demo-<sitename>.justfix.nycand look upon your works!