Coder Social home page Coder Social logo

prettyprinted / youtube_video_code Goto Github PK

View Code? Open in Web Editor NEW
668.0 32.0 1.6K 45.25 MB

The code for all the YouTube videos I publish on YouTube.

License: The Unlicense

Python 36.21% JavaScript 31.56% HTML 27.56% CSS 4.23% CoffeeScript 0.14% Makefile 0.01% PHP 0.02% Shell 0.03% Mako 0.07% Procfile 0.01% Dockerfile 0.04% EJS 0.14%

youtube_video_code's Introduction

youtube_video_code's People

Contributors

prettyprinted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtube_video_code's Issues

What command do you use to run the Flask project

I am using the below command and it is throwing an error -
flask --app .\app.py --debug run

The Error -
` * Tip: There are .env or .flaskenv files present. Do "pip install python-dotenv" to use them.
Usage: flask run [OPTIONS]
Try 'flask run --help' for help.

Error: Failed to find Flask application or factory in module 'login_app_demo.app'. Use 'login_app_demo.app:name' to specify one.`

SMTP mail is slow

Hi,
I am trying to send a reset email but the problem is whenever I try to trigger an email it is a bit slow it takes at least 5-10 sec to trigger the email. I also tried to do multi-threading but that dint work. Is there is a problem with my SMTP provider or any problem with my code?
I am using Hostinger as my SMTP.
Can you suggest to me a good SMTP provider

def forgetPasswordMail(email,token,msg,link):

msg.body = 'Your link is {}'.format(link)
mail.send(msg)

    token = s.dumps(email, salt='forget-password')
    msg = Message('Reset Password', sender='[email protected]', recipients=[email])
    link = url_for('reset_password', token=token, _external=True)
    start_new_thread(forgetPasswordMail,(email,token,msg,link))

License ?

Hello, under what license is this project released under ? I would like to learn Flask by studying them and your Youtube videos. Thank-you for making them.

Hi there,

I just started to learn flask, and you are the best resource on the internet. Whatever, I think of, you have the video and examples. Thank you and really appreciate that.

I just started a project where I have two python classes, one is model.py and second is the application.py. The model.py contains the model and application contains routes. Now when I try to use Admin views I have the following error.

AttributeError: type object 'Programs' has no attribute '_query_cls'

This is the code in application.py


app.config["SQLALCHEMY_DATABASE_URI"] = "postgresql://junaid:junaid@localhost:5432/UOB"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
app.config['SECRET_KEY']= 'junaid'
db.init_app(app)
admin = Admin(app)
admin.add_view(ModelView(Programs,db.Session))

Application runs without error, when naviated to /admin/Programs I received the above mentioned error. I will be really thankful if you could help, please.

TypeError: type object argument after ** must be a mapping, not str

I followed the Youtube tutorial and for some reason I keep coming up with the following error

TypeError: type object argument after ** must be a mapping, not str

I used a different JSON generator but everything worked until I tried to loop through the Users and append their details to the user_list. The code is below for reference, any help on this would be much appreciated:

import os

os.chdir(r'C:\Users\robbi\Desktop\Coding\My Python Scripts\APIs')

class User:
    def __init__(self, gender, name, location, email, login, dob, registered, phone, cell, id, picture, nat):
        self.gender = gender
        self.title = name['title']
        self.first_name = name['first']
        self.last_name = name['last']
        self.location = location['city']
        self.email = email
        self.username = login['username']
        self.password = login['password']
        self.dob = dob['date']
        self.age = dob['age']
        self.registered = registered['date']
        self.phone = phone
        self.cell = cell
        self.id = id['value']
        self.picture = picture['large']
        self.nat = nat
    
    @classmethod
    def from_json(cls, json_string):
        json_dict = json.loads(json_string)
        return cls(**json_dict)

    def __repr__(self):
        return f'<User { self.first_name }>'

json_string = '''{
         "gender":"female",
         "name":{
            "title":"Miss",
            "first":"Maeva",
            "last":"Gagnon"
         },
         "location":{
            "street":{
               "number":3400,
               "name":"3rd St"
            },
            "city":"Belmont",
            "state":"Nunavut",
            "country":"Canada",
            "postcode":"N5J 3K1",
            "coordinates":{
               "latitude":"-60.0772",
               "longitude":"148.5555"
            },
            "timezone":{
               "offset":"+11:00",
               "description":"Magadan, Solomon Islands, New Caledonia"
            }
         },
         "email":"[email protected]",
         "login":{
            "uuid":"b51f5119-d542-4c59-8ed1-11d257a6dd1a",
            "username":"beautifulbird203",
            "password":"sinned",
            "salt":"vqkYxMd6",
            "md5":"f2f79890187d94eabbba380c59c29ca2",
            "sha1":"2ce9a4227ca1717b45a99cb1f12fdef57486258a",
            "sha256":"106b7af161a58f6c5f08d2c0ce337ff0f8d978816f09dcbef082efd11c71ac44"
         },
         "dob":{
            "date":"1989-09-17T06:18:26.692Z",
            "age":31
         },
         "registered":{
            "date":"2004-11-14T22:10:48.600Z",
            "age":16
         },
         "phone":"464-880-6563",
         "cell":"560-036-0580",
         "id":{
            "name":"",
            "value":null
         },
         "picture":{
            "large":"https://randomuser.me/api/portraits/women/32.jpg",
            "medium":"https://randomuser.me/api/portraits/med/women/32.jpg",
            "thumbnail":"https://randomuser.me/api/portraits/thumb/women/32.jpg"
         },
         "nat":"CA"
      }'''

#user = User.from_json(json_string)
#print(user)

users_list = []
with open('data.json', 'r') as json_file:
    user_data = json.loads(json_file.read())
    for u in user_data:
        users_list.append(User(**u))

print(users_list)

Permissions / Security

Hey, just wanted to let you know that there's an option to 'Delete Directory' popping up on the 'Testing In Flask'. Probably shouldn't be there

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.