Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:42:14+00:00 2026-06-11T19:42:14+00:00

I find the documentation between Flask Babel and Jinja confusing. ubuntu@ubuntu-VirtualBox:~/workspace/rtbopsConfig/rtbDashboard3$ python run.py Traceback

  • 0

I find the documentation between Flask Babel and Jinja confusing.

ubuntu@ubuntu-VirtualBox:~/workspace/rtbopsConfig/rtbDashboard3$ python run.py 
Traceback (most recent call last):
  File "run.py", line 11, in <module>
    from app import app
  File "/home/ubuntu/workspace/rtbopsConfig/rtbDashboard3/app/__init__.py", line 14, in <module>
    app.config.from_pyfile('babel.cfg')
  File "/usr/local/lib/python2.7/dist-packages/flask/config.py", line 129, in from_pyfile
    execfile(filename, d.__dict__)
  File "/home/ubuntu/workspace/rtbopsConfig/rtbDashboard3/app/babel.cfg", line 1
    [jinja2: **/templates/**.html]
           ^
SyntaxError: invalid syntax

This this per the docs.

[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

Here is my __init__.py file

import os
from flask import Flask
from flaskext.babel import Babel
from config import basedir

app = Flask(__name__)
app.config.from_object('config')
app.config.from_pyfile('babel.cfg')
babel = Babel(app)

This now leaves me with nowhere to go. How to I resolve?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:42:15+00:00Added an answer on June 11, 2026 at 7:42 pm

    The babel.cfg file is not inteded as a Flask config file; it is meant to be used with the pybabel command line tool only:

    pybabel extract -F babel.cfg -o messages.pot .
    

    Remove the app.config.from_pyfile('babel.cfg') line from your __init__.py. The Flask example at the top of the Flask Babel documentation happens to use from_pyfile('mysettings.cfg') but your project already loads it’s Flask configuration using from_object(config).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know from documentation we can find distance between two CLLocation points using the
Can't seem to find documentation on a particular formation of SQL using the LIKE
I'm struggling to find documentation for the TimerTask function on Android. I need to
I have been looking online to find documentation for the function in QTP and
I can't seem to find documentation regarding the ability to scale axes in a
I've searched all over the web and can't seem to find documentation or even
I can't find any documentation on implementing a class that inherits System.Windows.Media.Brush - what
I can’t find the documentation on what the names of the three parameters are
I cannot find much documentation of the Boost version of discrete_distribution. After much Google
I couldn't find any documentation on this symbol. What does -? mean when it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.