How to use static files with django nonrel

后端 未结 3 2174
醉酒成梦
醉酒成梦 2021-02-08 15:37

I\'m trying to use the Django nonrel project for google app engine. I setup the test project as described here. I added a new folder to the project named \"static\" for my stati

3条回答
  •  情书的邮戳
    2021-02-08 15:53

    Well i just figured it out. Just use static_dir line before the main.py. So the app.yaml should look like this;

    application: test
    version: 1
    runtime: python
    api_version: 1
    
    builtins:
    - remote_api: on
    
    inbound_services:
    - warmup
    
    handlers:
    - url: /_ah/queue/deferred
      script: djangoappengine/deferred/handler.py
      login: admin
    
    - url: /_ah/stats/.*
      script: djangoappengine/appstats/ui.py
    
    - url: /media/admin
      static_dir: django/contrib/admin/media
      expiration: '0'
    
    - url: /static
      static_dir: static
    
    - url: /.*
      script: djangoappengine/main/main.py
    

提交回复
热议问题