Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6962687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:41:34+00:00 2026-05-27T15:41:34+00:00

Overnight hack, trying to create an environment where GAE code (using Python libs/packages) could

  • 0

Overnight hack, trying to create an environment where GAE code (using Python libs/packages) could be easily ported over to Heroku with minimal editing.

EDIT

Q: YAML offers static file sharing with only 3 lines of code, I’m trying to figure out how to implement this file sharing with _minimal_editing_ (keyword).

For example, to share the ‘static/’ folder. One solution is to implement a number of classes found in http://docs.webob.org/en/latest/file-example.html – not an elegant answer.

The big picture is to empower the developer with the freedom of choice to choose a (hopefully) better/cheaper cloud provider, follow steps 1,2,3… and the app will be up and running with minimal fuss. Hope this clears up the confusion.


In case anyone inquires, my code is as follows…

The “main.py” file:

import jinja2
import webapp2
import os

jinja_environment = jinja2.Environment(
    loader=jinja2.FileSystemLoader(
        os.path.join(os.path.dirname(__file__), 'templates')))


class HelloWebapp2(webapp2.RequestHandler):
    def get(self):
        template_values = { 'test': 'Hello World!!'}
        template = jinja_environment.get_template('jinja2_test.html')
        return self.response.out.write(template.render(template_values))


app2 = webapp2.WSGIApplication([
    ('/', HelloWebapp2)
], debug=True)

def main():
    from paste import httpserver
    port = int(os.environ.get("PORT", 5000))
    httpserver.serve(app2, host='0.0.0.0', port=port)

if __name__ == '__main__':
    main()

In the “requirements.txt” file:

Jinja2==2.6
webapp2==2.3
paste==1.7.5.1
webob==1.1.1

The output file “templates/jinja2_test.html“:

{{test}}

The default “procfile“:

web: python main.py
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:41:35+00:00Added an answer on May 27, 2026 at 3:41 pm

    It sounds to me like the problem you’re trying to solve is serving static pages using Django on Heroku.

    collectstatic seems to be the right answer for this:
    web: python my_django_app/manage.py collectstatic –noinput; bin/gunicorn_django –workers=4 –bind=0.0.0.0:$PORT my_django_app/settings.py

    http://matthewphiong.com/managing-django-static-files-on-heroku

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my team is currently using buildbot to automate overnight and continuous-integration builds and regression
I have a working copy that gets automatically committed into SVN overnight using a
I'm in the process of reviewing a code base (~20K LOC) and trying to
I've been trying to run my java program overnight but I need to restart
I need to create a table every morning based on overnight generated data from
I am running an application overnight on my Linux xscale device. I am looking
We have the following simple Stored Procedure that runs as an overnight SQL server
I wanted a windows service I'm building to run overnight. So I changed my
Suppose I create a file for writing like this: std::ofstream my_file(filename, std::ios_base::out | std::ios_base::trunc);
I am developing an app using WF hosted in IIS as WCF services as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.