Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App.static will be hang up by reload some times #155

Open
shaohaiyang opened this issue Jan 18, 2024 · 1 comment
Open

App.static will be hang up by reload some times #155

shaohaiyang opened this issue Jan 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shaohaiyang
Copy link

Describe the bug

When i specify the static directory with static param,refresh the index.html with some static resource such as js and css, the page will be hang up by reload multi-times except first time is normal.

BTW:

When I comment this line to lost javascript and css style :

#app.static("/static", "./static")

but it is normal no matter how many times I refresh.

main.py


app = App()
app.template(Jinja2Template("./templates", encoding="utf-8", followlinks=False))
app.json_serializer(ujson)
app.static("/static", "./static")

router = app.router()
@app.get("/")
async def head(res, req):
  if not db.is_connected(): db.connect()
  try:
    posts = db.post.find_many(take=10, order={"id":'desc'}, include={"author": True} )
    context = {
      "framework": "Robyn",
      "templating_engine": "Jinja2",
      "data": posts
    }
    if DEBUG: print(context)

    res.render("index.html", **context)
  except Exception as e:
    pass

Desktop (please complete the following information):

  • pypy:3.9-7.3.11-slim-bookworm
@cirospaciari
Copy link
Owner

hmm I probably should just push the static native version I have and publish, I will see if I can fast ship this one in the next week + some other fixes.

@cirospaciari cirospaciari added the bug Something isn't working label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants