apache - Flask-Admin pages inaccessible in production -


I'm trying to deploy my bottle applications using Apache and mod_wsgi on Ubuntu Server.

It seems to me to work fine to implement my work, but I can not access my Flask-Admin pages (which I can access in development).

Here's the structure of my app (simple to this purpose):

- .py - Files / - WSGI / myapp.wsgi

In development, I just run using Python main.py and everything works fine.

Here is wsgi file:

  import sys import os ## virtualenv setting activate_this = '/var/www/code/MyApp/venv/bin/activate_this.py' execfile (activate_this, dict (__ file __ = activate_this)) ## standard change out sys.stdout = sys.stderr ## couples setting sys.path.insert (0, os.path.join (os.path.dirname ( Os.pat) To import the file Path H. Replace (sys.path) (__ file__), '../ ..')) ########### To add this sys.path.append ('/ var / www / code / MyApp /') sys.path add this file path. Here is the configuration file for Apache, I am using Apache 2.2:  
     VirtualHost *: 443 & gt; WSGIScriptAlias ​​/ MyApp /var/www/code/MyApp/wsgi/myapp.wsgi WSGIScriptReloading SSLCertificateFile /var/www/code/MyApp/ssl.crt on SSLEngine on SSLCertificateKeyFile /var/www/code/MyApp/ssl.key SSLVerifyClient Any SSLOptions on WSGIPassAuthorization + StdEnvVars & lt; Directory / var / www / code / MyApp / wsgi & gt; Decline order, allow all & lt; / Directory & gt; & Lt; / VirtualHost & gt;  

How do I illustrate the Bottle App in my __ init __.py:

  app = bottle (__ name__ , Static_folder = 'files')  

How do I create an admin interface in my main.py here?

  # admin user admin = admin.Admin (app, app Administration ')  

There is also a link to the admin page to my liking to me I ViewUsage.py:

  @ app.route ('/') Def Index (): Return '& lt; A href = "/ admin /" & gt; Go to Admin page & lt; / A & gt; ' 

When in development, I can use the admin interface at mysite.com/admin/.

In the production, my app is at mysite.com/myapp/ and I can not access the admin interface, which I expected to be at mysite.com/myapp/admin/.

I think the way I institute the flask-admin I had put the default "Admin /" URL but when I am in production, I need to declare a specific URL?

Edit:

I checked the Apache error log but I did not get any errors.

Did you try to update your route with "myapp"? It seems that you have to update your route to production. Even it may be able to drop the '/' on the production, try it.

  @ app.route ( '/') @ app.route ( '/ myapp /') def index ():  

Comments