Note that there are some explanatory texts on larger screens.

plurals
  1. POServing Django API on Heroku and single-page app on Amazon S3 on the same domain
    primarykey
    data
    text
    <p>I want to build a web app where frontend (static) and backend (API) are, except for sharing the same domain, completely seperated. Usually I would consider this to be no problem, but I have some special requirements:</p> <ul> <li>the API runs on <strong>Heroku</strong> (using Django &amp; TastyPie)</li> <li>all the static content, including the html files will be hosted on <strong>Amazon S3</strong> </li> </ul> <p>The frontend app will be a single page Javascript application (with a base template, lets call it <code>index.html</code>) and populate the content from the API via AJAX. Since I don't want to implement CORS for the API yet and would like to follow the same-origin policy I want that both, the API and the files on S3 (the bucket), are sharing the same domain in some way. I also don't want to the Django's flatpages app or render the <code>index.html</code> through Django at all. </p> <p>I scanned Google and stackoverflow, but couldn't find a adequate solution so far. As far as I read the naive way (pointing domain to the Heroku app and the S3 bucket somehow) is not possible. Some solutions I have in mind but didn't find sources to:</p> <ul> <li>if possible pointing the domain name to the API on Heroku and the S3 bucket</li> <li>passing some options to Heroku to render html which is hosted on S3 (ProcFile?), using Django and libraries for S3 to get the other static assets</li> <li>maybe doing something with boto to achieve this</li> <li>other completely different suggestions?</li> </ul> <p>Did anybody tried something like this before and can point me in the right direction?</p> <p><em>One addition</em>: Later on I want to use something lile PhantomJS to make the single-page app crawlable. This output for crawlers should ideally be hosted in the S3 storage as well.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload