Python Developer Guide
Other documentationsDemoCommunityGitHub
  • Forest Admin
  • Getting started
    • How it works
    • Quick start
      • Flask
      • Django
    • Create your agent
    • Troubleshooting
    • Migrating legacy agents
      • Pre-requisites
      • Recommendations
      • Migration steps
      • Code transformations
        • API Charts
        • Live Queries
        • Smart Charts
        • Route overrides
        • Smart Actions
        • Smart Fields
        • Smart Relationships
        • Smart Segments
  • Data Sources
    • Getting Started
      • Collection selection
      • Naming conflicts
      • Query interface and Native Queries
        • Fields and projections
        • Filters
        • Aggregations
    • Provided data sources
      • SQLAlchemy
      • Django
        • Polymorphic relationships
    • Write your own
      • Translation strategy
        • Structure declaration
        • Capabilities declaration
        • Read implementation
        • Write implementation
        • Intra-data source Relationships
      • Contribute
  • Agent customization
    • Getting Started
    • Actions
      • Scope and context
      • Result builder
      • Static Forms
      • Widgets in Forms
      • Dynamic Forms
      • Form layout customization
      • Related data invalidation
    • Charts
      • Value
      • Objective
      • Percentage
      • Distribution
      • Leaderboard
      • Time-based
    • Fields
      • Add fields
      • Move, rename and remove fields
      • Override binary field mode
      • Override writing behavior
      • Override filtering behavior
      • Override sorting behavior
      • Validation
    • Hooks
      • Collection hook
      • Collection override
    • Pagination
    • Plugins
      • Write your own
    • Relationships
      • To a single record
      • To multiple records
      • Computed foreign keys
      • Under the hood
    • Search
    • Segments
  • Frontend customization
    • Smart Charts
      • Create a table chart
      • Create a bar chart
      • Create a cohort chart
      • Create a density map
    • Smart Views
      • Create a Map view
      • Create a Calendar view
      • Create a Shipping view
      • Create a Gallery view
      • Create a custom tinder-like validation view
      • Create a custom moderation view
  • Deploying to production
    • Environments
      • Deploy on AWS
      • Deploy on Heroku
      • Deploy on GCP
      • Deploy on Ubuntu
    • Development workflow
    • Using branches
    • Deploying your changes
    • Forest Admin CLI commands
      • init
      • login
      • branch
      • switch
      • set-origin
      • push
      • environments:create
      • environments:reset
      • deploy
  • Under the hood
    • .forestadmin-schema.json
    • Data Model
      • Typing
      • Relationships
    • Security & Privacy
Powered by GitBook
On this page
  • Cross-Origin Resource Sharing (CORS)
  • Invalid permissions
  • Help us get better!

Was this helpful?

  1. Getting started

Troubleshooting

This is the official documentation of the forestadmin-agent-django and forestadmin-agent-flask Python agents.

Cross-Origin Resource Sharing (CORS)

This is the most common issue you can encounter while setting up the Forest Admin Agent. Opening the Developer Console of your browser will help to detect this kind of issue. As Forest Admin provides a complete middleware, please make sure:

  • That the Forest Admin Agent is mounted before any other middleware.

  • That your server is up and running. This can be easily checked by using the /forest endpoint.

Invalid permissions

When adding users to your project, creating new collections or other permission based component. You might experience Forbidden (403) errors, although everything is properly configured in your settings. And only a server restart fixes your issue.

This is most commonly due to how Forest Admin keeps your agent up to date with the permission cache. On the latest versions of our agents we use ServerSentEvent (SSE). This allows our server to notify your agent as soon as a change is made to ensure the latest permissions possible.

Even though everything should be configured properly to work without action on your side, we have reports that some reverse proxy will ignore, instruction headers to disable buffering on our SSE endpoint.

To ensure that the issue you are facing is caused by SSE buffering, try to restart your agent. If you are no longer facing a permission error from the agent this is indeed the cause.

To fix the issue long term, you can either:

  • Disable buffering on your reverse proxy. Here is an example on nginx proxy configuration on how to do so:

fastcgi_buffering off;
proxy_buffering off;
  • Disable the SSE mechanism and fallback to old TTL cache by setting instantCacheRefresh: false in your agent init options.

Help us get better!

Finally, when your local server is started, you should be automatically redirected to a satisfaction form. Rate us so we can improve, then go to your newly created admin panel

❓ Don't you see an answer to your problem?

PreviousCreate your agentNextMigrating legacy agents

Last updated 3 months ago

Was this helpful?

Describe it on our and we will answer quickly.

Developer Community Forum ↗