Reputation: 11
I am trying to deploy a flask application to gcloud app engine. I am trying to use the Flask-Admin module. The code works fine on my local server. But when deployed to gcloud app engine the admin module does not work. Let me know if you need any further details.
Any help is very much appreciated.
Below is the code for the main
if __name__ == '__main__':
admin = admin.Admin(app, 'my application Admin', index_view=MyAdminIndexView(), template_mode='bootstrap3')
admin.add_view(ModelView(ContactUs))
admin.add_view(ModelView(TestimonialsAdmin))
app.run(host='127.0.0.1', port=8080, debug=True)
Below is the error I observe while trying to access admin
Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
Tried standard python 37 as well as flexible environment.
runtime: python37
service: appname
handlers:
- url: .*
script: auto
Upvotes: 0
Views: 167
Reputation: 11
Issue resolved after removing the below code from main method.
admin = admin.Admin(app, 'my application Admin', index_view=MyAdminIndexView(), template_mode='bootstrap3')
admin.add_view(ModelView(ContactUs))
admin.add_view(ModelView(TestimonialsAdmin))
placed them in the program like below :-
admin = admin.Admin(app, 'my application Admin', index_view=MyAdminIndexView(), template_mode='bootstrap3')
admin.add_view(ModelView(ContactUs))
admin.add_view(ModelView(TestimonialsAdmin))
if __name__ == '__main__':
app.run(host='127.0.0.1', port=8000, debug=True)
Upvotes: 1