Skip to content

Adding a New Site

Samara Trilling edited this page Jun 27, 2022 · 10 revisions

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.

Adding a new site

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.

Setting up local access to your new site

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.

Adding a subdomain

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.

  1. Go to to the "Domains" section of Heroku's tenants2-dev app 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.
  1. Add a new domain. The easiest way to do this is to add a new prefix to the .justfix.nyc domain.
  • Click add domain and enter demo-<sitename>.justfix.nyc. That is the naming convention we started with demo-whoownswhat.justfix.nyc.
  • This will add a new record to the list and give you a DNS target. Copy that.
  1. 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
  1. Test it out!
  • Give the DNS a minute to propagate, then go to demo-<sitename>.justfix.nyc and look upon your works!

Clone this wiki locally