Companion code to my O'Reilly book "Flask Web Development", second edition.

Related tags

Flask python flask
Overview

Flasky

This repository contains the source code examples for the second edition of my O'Reilly book Flask Web Development.

The commits and tags in this repository were carefully created to match the sequence in which concepts are presented in the book. Please read the section titled "How to Work with the Example Code" in the book's preface for instructions.

For Readers of the First Edition of the Book

The code examples for the first edition of the book were moved to a different repository: https://github.com/miguelgrinberg/flasky-first-edition.

Comments
  • SMTPSenderRefused: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/m ail/answer/14257 h66sm6105022pfe.6 - gsmtp', u'Flasky Admin

    SMTPSenderRefused: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/m ail/answer/14257 h66sm6105022pfe.6 - gsmtp', u'Flasky Admin

    When I try to Register a User it shows

    send: 'ehlo [10.0.2.15]\r\n' reply: '250-smtp.gmail.com at your service, [58.97.200.89]\r\n' reply: '250-SIZE 35882577\r\n' reply: '250-8BITMIME\r\n' reply: '250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH\r\n' reply: '250-ENHANCEDSTATUSCODES\r\n' reply: '250-PIPELINING\r\n' reply: '250 SMTPUTF8\r\n' reply: retcode (250); Msg: smtp.gmail.com at your service, [58.97.200.89] SIZE 35882577 8BITMIME AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH ENHANCEDSTATUSCODES PIPELINING SMTPUTF8 send: u'mail FROM:[email protected] size=1802\r\n' reply: '530-5.5.1 Authentication Required. Learn more at\r\n' reply: '530 5.5.1 https://support.google.com/mail/answer/14257 h66sm6105022pfe.6 - gsmtp\r\n' reply: retcode (530); Msg: 5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 h66sm6105022pfe.6 - gsmtp send: 'rset\r\n' reply: '250 2.1.5 Flushed h66sm6105022pfe.6 - gsmtp\r\n' reply: retcode (250); Msg: 2.1.5 Flushed h66sm6105022pfe.6 - gsmtp send: 'quit\r\n' reply: '221 2.0.0 closing connection h66sm6105022pfe.6 - gsmtp\r\n' reply: retcode (221); Msg: 2.0.0 closing connection h66sm6105022pfe.6 - gsmtp Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(_self.__args, *_self.__kwargs) File "/vagrant/project/app/email.py", line 8, in send_async_email mail.send(msg) File "/usr/local/lib/python2.7/dist-packages/flask_mail.py", line 492, in send message.send(connection) File "/usr/local/lib/python2.7/dist-packages/flask_mail.py", line 427, in send connection.send(self) File "/usr/local/lib/python2.7/dist-packages/flask_mail.py", line 192, in send message.rcpt_options) File "/usr/lib/python2.7/smtplib.py", line 731, in sendmail raise SMTPSenderRefused(code, resp, from_addr) SMTPSenderRefused: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/m ail/answer/14257 h66sm6105022pfe.6 - gsmtp', u'Flasky Admin [email protected]')

    question 
    opened by spaceled 55
  • CSRF token missing

    CSRF token missing

    I run the application with $ python manage.py runserver, I can't login becuase of CSRF token missing, can someone tell me how to fix it properly, thanks in advance.

    and when I run the test code there is one test fail - test_comments (test_api.APITestCase) ... FAIL

    FAIL: test_comments (test_api.APITestCase) Traceback (most recent call last): File "/Users/guangbo/Sites/flasky/tests/test_api.py", line 217, in test_comments 'Good < a rel="nofollow" href="http://example.com" >post< /a >!') AssertionError: False is not true

    opened by guangbochen 51
  • Possible issue with Flask-Mail Code

    Possible issue with Flask-Mail Code

    Hello,

    I am following the chapter 6 on Email integration and everytime I try to send email using the code provided in the book I get following exception SMTPException: SMTP AUTH extension not supported by server.. I looked on the web and found a solution here http://flask.pocoo.org/snippets/85/. The difference is in the Flask-Mail gmail configuration.

    opened by shekhargulati 45
  • db.session.commit() is not performed at the end of requests (prev

    db.session.commit() is not performed at the end of requests (prev "Confirmation of users")

    Update - begins db.session.commit() is not performed automatically at the end of each request, despite having SQLALCHEMY_COMMIT_ON_TEARDOWN = True in config.py. This issue was noted after analysing why user confirmation was not working properly. The app is hosted on heroku (can be reached here), is using Heroku Postgres and is based on this repository, which is forked from the original 17d. Update - ends

    The confirmation link does not update the current_user.confirmed to True and new registered users thus remain unconfirmed. If the model column is changed by hand via shell, then the user is recognised as confirmed and the app behaves as expected.

    Here are the results of my analysis. By examining the logs, the app behaviour is correct. I have the following lines from registration to confirmation of a new user:

    1. REGISTER, GET, with status 200 2015-08-07T08:50:09.059305+00:00 heroku[router]: at=info method=GET path="/auth/register"
    2. REGISTER, POST, with status 302 2015-08-07T08:50:23.954973+00:00 heroku[router]: at=info method=POST path="/auth/register"
    3. LOGIN, GET, with status 200 2015-08-07T08:50:24.181845+00:00 heroku[router]: at=info method=GET path="/auth/login"
    4. (after clicking on the email confirmation link) CONFIRM, GET, with status 302 2015-08-07T08:50:35.040888+00:00 heroku[router]: at=info method=GET path="/auth/confirm/eyJleHAiOjE0Mzg5NDEwMjMsImlhdCI6MTQzODkzNzQyMywiYWxnIjoiSFMyNTYifQ.eyJjb25maXJtIjoxfQ.7hMYjfDmmwE_8c3kkw7jSdIRLWV-bPSJCCuYsy7bPeY"
    5. (login is required here) LOGIN GET, with status 200 2015-08-07T08:50:35.259303+00:00 heroku[router]: at=info method=GET path="/auth/login?next=%2Fauth%2Fconfirm%2FeyJleHAiOjE0Mzg5NDEwMjMsImlhdCI6MTQzODkzNzQyMywiYWxnIjoiSFMyNTYifQ.eyJjb25maXJtIjoxfQ.7hMYjfDmmwE_8c3kkw7jSdIRLWV-bPSJCCuYsy7bPeY"
    6. LOGIN POST, with status 302 2015-08-07T08:51:04.677048+00:00 heroku[router]: at=info method=POST path="/auth/login?next=%2Fauth%2Fconfirm%2FeyJleHAiOjE0Mzg5NDEwMjMsImlhdCI6MTQzODkzNzQyMywiYWxnIjoiSFMyNTYifQ.eyJjb25maXJtIjoxfQ.7hMYjfDmmwE_8c3kkw7jSdIRLWV-bPSJCCuYsy7bPeY"
    7. CONFIRM GET, with status 302 2015-08-07T08:51:04.947112+00:00 heroku[router]: at=info method=GET path="/auth/confirm/eyJleHAiOjE0Mzg5NDEwMjMsImlhdCI6MTQzODkzNzQyMywiYWxnIjoiSFMyNTYifQ.eyJjb25maXJtIjoxfQ.7hMYjfDmmwE_8c3kkw7jSdIRLWV-bPSJCCuYsy7bPeY"
    8. ROOT GET, with status 302 2015-08-07T08:51:05.156445+00:00 heroku[router]: at=info method=GET path="/"
    9. UNCONFIRMED , with status 200
      2015-08-07T08:51:05.868130+00:00 heroku[router]: at=info method=GET path="/auth/unconfirmed"

    From what I understand, the auth.before_app_request is redirecting the user to the unconfirmed page. However the flash message "You have confirmed your account. Thanks!" is displayed (see https://github.com/lucanaso/flasky/blob/master/app/auth/views.py#L72), therefore it looks like current_user.confirm returns True but it does not update the db (see https://github.com/lucanaso/flasky/blob/master/app/models.py#L147).

    I have forked the project at commit 17d and after that I have committed only some files for deploying on heroku and requirements.

    The app is running on heroku at: https://flasky-forky.herokuapp.com/ you can try it yourself by registering and trying to confirm.

    What can be the cause of the user not being confirmed?

    bug 
    opened by lucanaso 29
  • Creating multiple association table rows when saving a row on one side of the relationship

    Creating multiple association table rows when saving a row on one side of the relationship

    Hi Miguel,

    The book has been great I've been following along with it as I create a separate app, and it has proved invaluable. I've now gotten all the way to the API chapter, and still haven't come across an answer to this. I hope you don't mind if I ask for help or a pointer to the best place to find the answer.

    I have a table (companies) with a many to many relationship via an association table (company_technologies) with another table (technologies). I have a form for creating Companies that asks the user to select one or more technologies. This all works fine, but when I get the results back, and try to assign things in the way we've previously done in the book I get an AttributeError: 'int' object has no attribute '_sa_instance_state' error.

    How can one use the results of a SelectMultipleField to correctly create the required rows in the association table?

    Thanks again for all the materials on Flask you've produced!

    Bob

    P.S. Here is an abbreviated look at my models

    and a traceback

    question 
    opened by UltraBob 23
  • Error Authenticating a User.

    Error Authenticating a User.

    Hello, Miguel I'm working through chapter 8 and I'm getting an error when trying to first authenticate the users. It seems like the tables aren't getting created in my db but when I run python manage.py shell and print u.username or any other of the attributes I get the correct values returned. Perhaps you know where I'm going wrong? Let me know if I can provide you with any other files. Thanks a lot.

    OperationalError: (sqlite3.OperationalError) no such table: users [SQL: u'SELECT users.id AS users_id, users.email AS users_email, users.username AS users_username, users.password_hash AS users_password_hash, users.role_id AS users_role_id \nFROM users \nWHERE users.email = ?\n LIMIT ? OFFSET ?'] [parameters: (u'[email protected]', 1, 0)]

    question 
    opened by JWTappert 21
  • Can't create db

    Can't create db

    Dear Miguel,

    thanks you for your book,

    I have some troubles, I am on chapter 8a.

    I can't create a db, db init, db downgrade etc - it's ok, but when I start a server and add some text to form - I have this error:

    sqlalchemy.exc.OperationalError
    
    OperationalError: (OperationalError) no such table: users u'SELECT users.id AS users_id, users.username AS users_username, users.role_id AS users_role_id, users.password_hash AS users_password_hash \nFROM users \nWHERE users.username = ?\n LIMIT ? OFFSET ?' (u'dfh', 1, 0)
    
    question 
    opened by karl-kallavus 21
  • running code in tags 10d, can't insert user's role

    running code in tags 10d, can't insert user's role

    the config is like this: FLASKY_ADMIN = os.environ.get('FLASKY_ADMIN', '[email protected]')

    but the database is as below, can't register as an admin sqlite> select * from users; 1|[email protected]|edison||pbkdf2:sha256:150000$UtxENiUL$f12c1e1878e3485723134eb557141195600304782c3729d9a242556b380c8f85|1|edison|China|a designer|2020-06-01 13:41:24.615439|2020-06-08 13:10:09.860055|6929bb4579f331bdfef41d5835807a12

    question 
    opened by edisontcd 17
  • SqlAlchemy problem inside celery when deploying on heroku

    SqlAlchemy problem inside celery when deploying on heroku

    Helo Miguel, i deployed my app and i am starting a startup thanks to your tutorials which give me the confidence to start developing my idea. My app is online but the celery task aren't working. I have a psycopg2 operational error:

    SSL SYSCALL error: EOF detected

    I think that the problem is generated by some things i did wrong when working with sqlalchemy but im not sure. So here i will recap the things that might be causing trouble.

    1) im using:

    with app.app_context():

    at the beggining of the celery task, i dont know if it is the correct way to pass the context to the task.

    2) this one i think is the real problem:

    I think i dont fully understand how to work properly with sqlalchemy. I noticed that first i had a problem when trying to acces a query atributes after a commit so i disabled expiring_on_commit because i have also do some socket.emit from this tasks and i couldn't send a emit before commiting. BUT i remove all session when the task ends and also in the socket functions using db.session.remove().

    some say in the formus that doing db.engine.dispose() on every task creation solves the problem but i dont even understand why should it solve it and i think my problem goes deeper but maybe im actually working well with sqlalchemy and indeed that solves the problem.

    3)another possible cause of the problem is that im also doing things like:

    obj1=query... commit() emit({obj1.id}) obj2 = query(filter_by=obj1) obj3 = obj1.name commit() remove()

    that was a illustration of the things that my code do, because sometimes i call a function that maybe emits but before emiting i need to commit (this example i give it above) so the user detect new changes when is redirected, etc. but then i need to access the atributes of that query and i dont know i thought that disabling expire_on_commit and db.session.remove() at the end would partially solve my problem but aparently not or im doing something else wrong.

    I think the problem is there but maybe is somewhere else... i would like to give you access to my private rep on github so you can see and maybe give me a push in the correct way of working with flask-sqlalchemy. so if you are interested let me know im kinda stuck with this.

    question 
    opened by valentin-ballester 17
  • BuildError: ('main.index', {}, None)

    BuildError: ('main.index', {}, None)

    the code in app/auth/views.py is if user is not None and user.verify_password(form.password.data): login_user(user,form.remember_me.data); return redirect(request.args.get('next') or url_for('main.index'));

    the code in app/main/views.py is @main.route('/',methods=['GET','POST']) def index(): form = NameForm(); if form.validate_on_submit(): return redirect(url_for('.index')) return render_template('index.html',form=form,name=session.get('name'),known=session.get('known',False),current_time=datetime.utcnow());

    the tree of flask is ../flaskr/ ├── app │   ├── auth │   │   ├── forms.py │   │   ├── forms.pyc │   │   ├── init.py │   │   ├── init.pyc │   │   ├── views.py │   │   └── views.pyc │   ├── init.py │   ├── init.pyc │   ├── main │   │   ├── errors.py │   │   ├── init.py │   │   └── views.py │   ├── models.py │   ├── models.pyc │   └── templates │   ├── auth │   │   └── login.html │   ├── base.html │   └── index.html

    opened by dayiguizhen 17
  • ImportError: cannot import name 'abort'

    ImportError: cannot import name 'abort'

    Traceback (most recent call last): File "models.py", line 1, in from werkzeug.security import generate_password_hash, check_password_hash File "/usr/local/lib/python3.5/dist-packages/werkzeug/init.py", line 151, in import('werkzeug.exceptions') File "/usr/local/lib/python3.5/dist-packages/werkzeug/exceptions.py", line 71, in from werkzeug.wrappers import Response File "/usr/local/lib/python3.5/dist-packages/werkzeug/wrappers.py", line 26, in from werkzeug.http import HTTP_STATUS_CODES,
    File "/usr/local/lib/python3.5/dist-packages/werkzeug/http.py", line 24, in from email.Utils import parsedate_tz File "/home/josh/tangan/flasky/app/email.py", line 2, in from flask import current_app, render_template File "/usr/local/lib/python3.5/dist-packages/flask/init.py", line 17, in from werkzeug.exceptions import abort ImportError: cannot import name 'abort' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in from urllib.request import urlopen File "/usr/lib/python3.5/urllib/request.py", line 86, in import email File "/home/josh/tangan/flasky/app/email.py", line 2, in from flask import current_app, render_template File "/usr/local/lib/python3.5/dist-packages/flask/init.py", line 17, in from werkzeug.exceptions import abort File "/usr/local/lib/python3.5/dist-packages/werkzeug/init.py", line 151, in import('werkzeug.exceptions') File "/usr/local/lib/python3.5/dist-packages/werkzeug/exceptions.py", line 71, in from werkzeug.wrappers import Response File "/usr/local/lib/python3.5/dist-packages/werkzeug/wrappers.py", line 26, in from werkzeug.http import HTTP_STATUS_CODES,
    File "/usr/local/lib/python3.5/dist-packages/werkzeug/http.py", line 24, in from email.Utils import parsedate_tz ImportError: No module named 'email.Utils'; 'email' is not a package

    question 
    opened by vlon 15
  • Selenium testing failing

    Selenium testing failing

    Hi Miguel,

    I'm just about to finish your book, absolutely love it. I've been following along as I read and noticed that the packages are quite outdated (as expected). I decided to code your app using the latest available packages and so far apart from some minor syntax differences it was smooth sailing. This was the case up until the 'End-to-End Testing with Selenium' (15d), it took me 2 days to make it work with Selenium v4.7.2 and Unittest and I just wanted to leave it here in case someone else runs into this problem as well as ask if this is the correct way to do it. It feels more like a hack to me rather than the actual solution so I would really appreciate your input.

    Below are the packages I'm using as well as my solution to the problem. By the way I'm also using ChromeDriver 108.0.5359.71

    I figured out the solution tanks to https://github.com/pallets/flask/issues/2776

    requirements/common.txt

    alembic==1.8.1
    bleach==5.0.1
    blinker==1.5
    click==8.1.3
    colorama==0.4.5
    dnspython==2.2.1
    dominate==2.7.0
    email-validator==1.3.0
    Flask==2.2.2
    Flask-Bootstrap==3.3.7.1
    Flask-HTTPAuth==4.7.0
    Flask-Login==0.6.2
    Flask-Mail==0.9.1
    Flask-Migrate==3.1.0
    Flask-Moment==1.0.5
    Flask-PageDown==0.4.0
    Flask-SQLAlchemy==3.0.2
    Flask-WTF==1.0.1
    greenlet==2.0.0
    idna==3.4
    itsdangerous==2.1.2
    Jinja2==3.1.2
    Mako==1.2.3
    Markdown==3.4.1
    MarkupSafe==2.1.1
    packaging==21.3
    pyparsing==3.0.9
    python-dateutil==2.8.2
    python-dotenv==0.21.0
    six==1.16.0
    SQLAlchemy==1.4.42
    visitor==0.1.3
    webencodings==0.5.1
    Werkzeug==2.2.2
    WTForms==3.0.1
    

    requirements/common.txt

    -r common.txt
    charset-normalizer==2.1.1
    certifi==2022.9.24
    commonmark==0.9.1
    coverage==6.5.0
    defusedxml==0.7.1
    Faker==15.2.0
    httpie==3.2.1
    multidict==6.0.2
    Pygments==2.13.0
    PySocks==1.7.1
    requests==2.28.1
    requests-toolbelt==0.10.1
    rich==12.6.0
    selenium==4.7.2
    urllib3==1.26.12
    

    main/views.py

    [...]
    
    @main.route('/shutdown')
    def server_shutdown():
        if not current_app.testing:
            abort(404)
    
        # request.environ.get('werkzeug.server.shutdown') has been deprecated
        # So I used the following instead:
        os.kill(os.getpid(), signal.SIGINT)
        return 'Shutting down...'
    
    [...]
    

    config.py

    [...]
    
    # I added the following configuration which is the FIX to my problem
    class TestingWithSeleniumConfig(TestingConfig):
        @staticmethod
        def init_app(app):
            if os.environ.get('FLASK_RUN_FROM_CLI'):
                os.environ.pop('FLASK_RUN_FROM_CLI')
    
    [...]
    
    config = {
        [...]
        'testing-with-selenium': TestingWithSeleniumConfig,
        [...]
    }
    

    tests/test_selenium.py

    import re
    import threading
    import unittest
    
    from selenium import webdriver
    from selenium.webdriver.common.by import By
    
    from app import create_app, db, fake
    from app.models import Role, User, Post
    
    
    class SeleniumTestCase(unittest.TestCase):
        # I don't like things hardcoded where possible
        HOST = 'localhost'
        PORT = 5000
    
        # PyCharm complaining without those
        client = None
        app = None
        app_context = None
        server_thread = None
    
        @classmethod
        def setUpClass(cls):
            options = webdriver.ChromeOptions()
            options.add_argument('headless')
            # This suppresses some jibberish from webdriver
            options.add_experimental_option('excludeSwitches', ['enable-logging'])
    
            # noinspection PyBroadException
            try:
                cls.client = webdriver.Chrome(options=options)
            except Exception:
                pass
    
            # Skip these tests if the web browser could not be started
            if cls.client:
                # Create the application
                # FIX: making use of 'testing-with-selenium' config
                cls.app = create_app('testing-with-selenium')
                cls.app_context = cls.app.app_context()
                cls.app_context.push()
    
                # Suppress logging to keep unittest output clean
                import logging
                logger = logging.getLogger('werkzeug')
                logger.setLevel('ERROR')
    
                # Create the database and  populate with some fake data
                db.create_all()
                Role.insert_roles()
                fake.users(10)
                fake.posts(10)
    
                # Add an administrator user
                admin_role = Role.query.filter_by(permissions=0xff).first()
                admin = User(email='[email protected]', username='john', password='cat', role=admin_role, confirmed=True)
                db.session.add(admin)
                db.session.commit()
    
                # Start the flask server in a thread
                cls.server_thread = threading.Thread(target=cls.app.run, kwargs={
                    'host': cls.HOST,
                    'port': cls.PORT,
    
                    'debug': False,
                    'use_reloader': False,
                    'use_debugger': False
                })
    
                cls.server_thread.start()
    
        @classmethod
        def tearDownClass(cls):
            if cls.client:
                # Stop the Flask server and the browser
                cls.client.get(f'http://{cls.HOST}:{cls.PORT}/shutdown')
                cls.client.quit()
                cls.server_thread.join()
    
                # Destroy the database
                db.drop_all()
                db.session.remove()
    
                # Remove application context
                cls.app_context.pop()
    
        def setUp(self):
            if not self.client:
                self.skipTest('Web browser not available')
    
        def tearDown(self):
            pass
    
        def test_admin_home_page(self):
            # Navigate to home page
            self.client.get(f'http://{self.HOST}:{self.PORT}/')
            self.assertTrue(re.search(r'Hello,\s+Stranger!', self.client.page_source))
    
            # Navigate to login page
            self.client.find_element(By.LINK_TEXT, 'Log In').click()
            self.assertIn('<h1>Login</h1>', self.client.page_source)
    
            # Login
            self.client.find_element(By.NAME, 'email').send_keys('[email protected]')
            self.client.find_element(By.NAME, 'password').send_keys('cat')
            self.client.find_element(By.NAME, 'submit').click()
            self.assertTrue(re.search(r'Hello,\s+john!', self.client.page_source))
    
            # Navigate to the user's profile page
            self.client.find_element(By.LINK_TEXT, 'Profile').click()
            self.assertIn('<h1>john</h1>', self.client.page_source)
    
    opened by sularz-maciej 1
  • Mail from must equal authorized user?

    Mail from must equal authorized user?

    FLASKY_MAIL_SENDER is Flasky Admin <[email protected]> in project. If i use my email address, then throw a exception like

    smtplib.SMTPSenderRefused: (553, b'Mail from must equal authorized user', '=?utf-8?q?Flasky_Admin?= <[email protected]>')
    

    a simple advice, set FLASKY_MAIL_SENDER like

    FLASKY_MAIL_SENDER = os.environ.get('FLASKY_MAIL_SENDER', 'Flasky Admin [email protected]')

    question 
    opened by liuende501 2
  • Bump mako from 1.0.7 to 1.2.2 in /requirements

    Bump mako from 1.0.7 to 1.2.2 in /requirements

    Bumps mako from 1.0.7 to 1.2.2.

    Release notes

    Sourced from mako's releases.

    1.2.2

    Released: Mon Aug 29 2022

    bug

    • [bug] [lexer] Fixed issue in lexer where the regexp used to match tags would not correctly interpret quoted sections individually. While this parsing issue still produced the same expected tag structure later on, the mis-handling of quoted sections was also subject to a regexp crash if a tag had a large number of quotes within its quoted sections.

      References: #366

    1.2.1

    Released: Thu Jun 30 2022

    bug

    • [bug] [tests] Various fixes to the test suite in the area of exception message rendering to accommodate for variability in Python versions as well as Pygments.

      References: #360

    misc

    • [performance] Optimized some codepaths within the lexer/Python code generation process, improving performance for generation of templates prior to their being cached. Pull request courtesy Takuto Ikuta.

      References: #361

    1.2.0

    Released: Thu Mar 10 2022

    changed

    • [changed] [py3k] Corrected "universal wheel" directive in setup.cfg so that building a wheel does not target Python 2.

      References: #351

    • [changed] [py3k] The bytestring_passthrough template argument is removed, as this flag only applied to Python 2.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • TimedJSONWebSignatureSerializer  deprecated.

    TimedJSONWebSignatureSerializer deprecated.

    opened by ColJops 2
  • Bump httpie from 0.9.9 to 3.1.0 in /requirements

    Bump httpie from 0.9.9 to 3.1.0 in /requirements

    Bumps httpie from 0.9.9 to 3.1.0.

    Release notes

    Sourced from httpie's releases.

    HTTPie 3.1.0

    • SECURITY Fixed the vulnerability that caused exposure of cookies on redirects to third party hosts. (#1312)
    • Fixed escaping of integer indexes with multiple backslashes in the nested JSON builder. (#1285)
    • Fixed displaying of status code without a status message on non-auto themes. (#1300)
    • Fixed redundant issuance of stdin detection warnings on some rare cases due to underlying implementation. (#1303)
    • Fixed double --quiet so that it will now suppress all python level warnings. (#1271)
    • Added support for specifying certificate private key passphrases through --cert-key-pass and prompts. (#946)
    • Added httpie cli export-args command for exposing the parser specification for the http/https commands. (#1293)
    • Improved regulation of top-level arrays. (#1292)
    • Improved UI layout for standalone invocations. (#1296)

    HTTPie 1.0.2

    • Fixed tests for installation with pyOpenSSL.

    HTTPie 1.0.1

    • Removed external URL calls from tests.

    HTTPie 1.0.0

    • Added --style=auto which follows the terminal ANSI color styles.
    • Added support for selecting TLS 1.3 via --ssl=tls1.3 (available once implemented in upstream libraries).
    • Added true/false as valid values for --verify (in addition to yes/no) and the boolean value is case-insensitive.
    • Changed the default --style from solarized to auto (on Windows it stays fruity).
    • Fixed default headers being incorrectly case-sensitive.
    • Removed Python 2.6 support.
    Changelog

    Sourced from httpie's changelog.

    3.1.0 (2022-03-08)

    • SECURITY Fixed the vulnerability that caused exposure of cookies on redirects to third party hosts. (#1312)
    • Fixed escaping of integer indexes with multiple backslashes in the nested JSON builder. (#1285)
    • Fixed displaying of status code without a status message on non-auto themes. (#1300)
    • Fixed redundant issuance of stdin detection warnings on some rare cases due to underlying implementation. (#1303)
    • Fixed double --quiet so that it will now suppress all python level warnings. (#1271)
    • Added support for specifying certificate private key passphrases through --cert-key-pass and prompts. (#946)
    • Added httpie cli export-args command for exposing the parser specification for the http/https commands. (#1293)
    • Improved regulation of top-level arrays. (#1292)
    • Improved UI layout for standalone invocations. (#1296)

    3.0.2 (2022-01-24)

    What’s new in HTTPie for Terminal 3.0 →

    • Fixed usage of httpie when there is a presence of a config with default_options. (#1280)

    3.0.1 (2022-01-23)

    What’s new in HTTPie for Terminal 3.0 →

    • Changed the value shown as time elapsed from time-to-read-headers to total exchange time. (#1277)

    3.0.0 (2022-01-21)

    What’s new in HTTPie for Terminal 3.0 →

    • Dropped support for Python 3.6. (#1177)
    • Improved startup time by 40%. (#1211)
    • Added support for nested JSON syntax. (#1169)
    • Added httpie plugins interface for plugin management. (#566)
    • Added support for Bearer authentication via --auth-type=bearer (#1215).
    • Added support for quick conversions of pasted URLs into HTTPie calls by adding a space after the protocol name ($ https ://pie.devhttps://pie.dev). (#1195)
    • Added support for sending multiple HTTP header lines with the same name. (#130)
    • Added support for receiving multiple HTTP headers lines with the same name. (#1207)
    • Added support for basic JSON types on --form/--multipart when using JSON only operators (:=/:=@). (#1212)
    • Added support for automatically enabling --stream when Content-Type is text/event-stream. (#376)
    • Added support for displaying the total elapsed time through --meta/-vv or --print=m. (#243)
    • Added new pie-dark/pie-light (and pie) styles that match with HTTPie for Web and Desktop. (#1237)
    • Added support for better error handling on DNS failures. (#1248)
    • Added support for storing prompted passwords in the local sessions. (#1098)
    • Added warnings about the --ignore-stdin, when there is no incoming data from stdin. (#1255)
    • Fixed crashing due to broken plugins. (#1204)
    • Fixed auto addition of XML declaration to every formatted XML response. (#1156)
    • Fixed highlighting when Content-Type specifies charset. (#1242)
    • Fixed an unexpected crash when --raw is used with --chunked. (#1253)
    • Changed the default Windows theme from fruity to auto. (#1266)

    2.6.0 (2021-10-14)

    ... (truncated)

    Commits
    • 266c637 Release prep for 3.1.0 (#1313)
    • 77af4c7 Decouple parser definition from argparse (#1293)
    • 7509dd4 Fix documentation styling errors.
    • f08c1be Change error messages to use a better format.
    • 59d9e92 Tweak
    • 0a87317 Tweak SECURITY and add a Security policy section to docs
    • 614866e Polish sessions docs
    • 395914f Apply suggestions from the review
    • 65ab7d5 Implement new style cookies
    • b5623cc Fix the tests with the latest layout
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
Miguel Grinberg
Miguel Grinberg
Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure.

Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure. All the required libraries are already installed easily to use in any big project.

Ajay kumar sharma 5 Jun 14, 2022
Source code for backpainfree.org - a Q&A platform similar to StackOverFlow

Source code for backpainfree.org - a Q&A platform similar to StackOverFlow, which is designed specifically for people with back pain problems. Users can ask questions, post answers and comments, vote on other posts.

Olzhas Arystanov 8 Dec 11, 2022
iloveflask is a Python library to collect functions that help a flask developer generate reports, config files and repeat code.

I Love Flask iloveflask is a Python library to collect functions that help a flask developer generate reports, config files and repeat code. Installat

null 2 Dec 29, 2021
This is the code repository for Mastering Python for Networking and Security – Second Edition

Mastering Python for Networking and Security – Second Edition This is the code repository for Mastering Python for Networking and Security – Second Ed

Frank Gottinger 1 Feb 9, 2022
Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".

SLM Lab Modular Deep Reinforcement Learning framework in PyTorch. Documentation: https://slm-lab.gitbook.io/slm-lab/ BeamRider Breakout KungFuMaster M

Wah Loon Keng 1.1k Dec 24, 2022
MATLAB codes of the book "Digital Image Processing Fourth Edition" converted to Python

Digital Image Processing Python MATLAB codes of the book "Digital Image Processing Fourth Edition" converted to Python TO-DO: Refactor scripts, curren

Merve Noyan 24 Oct 16, 2022
Py address book gui - An address book with graphical user interface developed with Python Tkinter

py_address_book_gui An address book with graphical user interface developed with

Milton 4 Feb 1, 2022
A python scripts that uses 3 different feature extraction methods such as SIFT, SURF and ORB to find a book in a video clip and project trailer of a movie based on that book, on to it.

A python scripts that uses 3 different feature extraction methods such as SIFT, SURF and ORB to find a book in a video clip and project trailer of a movie based on that book, on to it.

tooraj taraz 3 Feb 10, 2022
Companion code for the paper "An Infinite-Feature Extension for Bayesian ReLU Nets That Fixes Their Asymptotic Overconfidence" (NeurIPS 2021)

ReLU-GP Residual (RGPR) This repository contains code for reproducing the following NeurIPS 2021 paper: @inproceedings{kristiadi2021infinite, title=

Agustinus Kristiadi 4 Dec 26, 2021
Python code for "Machine learning: a probabilistic perspective" (2nd edition)

Python code for "Machine learning: a probabilistic perspective" (2nd edition)

Probabilistic machine learning 5.3k Dec 31, 2022
Repository of conference publications and source code for first-/ second-authored papers published at NeurIPS, ICML, and ICLR.

Repository of conference publications and source code for first-/ second-authored papers published at NeurIPS, ICML, and ICLR.

Daniel Jarrett 26 Jun 17, 2021
aws ec2.py companion script to generate sshconfigs with auto bastion host discovery

ec2-bastion-sshconfig This script will interate over instances found by ec2.py and if those instances are not publically accessible it will search the

Steve Melo 1 Sep 11, 2022
Companion "receiver" to matrix-appservice-webhooks for [matrix].

Matrix Webhook Receiver Companion "receiver" to matrix-appservice-webhooks for [matrix]. The purpose of this app is to listen for generic webhook mess

Kim Brose 13 Sep 29, 2022
HomeAssistant Linux Companion

Application to run on linux desktop computer to provide sensors data to homeasssistant, and get notifications as if it was a mobile device.

Javier Lopez 10 Dec 27, 2022
A companion web application to connect stash to deovr

stash-vr-companion This is a companion web application to connect stash to deovr. Stash is a self hosted web application to manage your porn collectio

null 19 Sep 29, 2022
An SMPC companion library for Syft

SyMPC A library that extends PySyft with SMPC support SyMPC /ˈsɪmpəθi/ is a library which extends PySyft ≥0.3 with SMPC support. It allows computing o

Arturo Marquez Flores 0 Oct 13, 2021
A smart personal companion and health assistant.

Steps to Install : Clone the repository Go to ResQ-Sources Execute ResQ-Lite.py --: Manual Controls : DanceRobot.py --: You can call functions like fo

Tuhinadri Banerjee 1 May 25, 2022
Rembg Video Virtual Green Screen Edition

Rembg Video Virtual Green Screen Edition

Tim Scarfe 217 Jan 6, 2023
Rembg Video Virtual Green Screen Edition

Rembg Virtual Greenscreen Edition is a tool to create a green screen matte for videos

Tim Scarfe 61 Mar 28, 2021