Coder Social home page Coder Social logo

micro_blog's Introduction

mkdir Micro_Blog cd Micro_Blog pip install virtualenv virtualenv --python=C:\Users\vmundaragi\AppData\Local\Programs\Python\Python36\python.exe venv venv\Scripts\activate #activations belong to the terminal session in which you initiated them. for every new terminal you open you need to activate again pip install flask set FLASK_APP=micro_blog.py pip install flask-sqlalchemy

set FLASK_DEBUG=1 #for debug mode

For DB migrations: pip install flask-migrate #for database migration (flask-migrate is Alembic framework(tool for transition of schemas from one version to another) extension) flask db init #initialize a migration repository flask db migrate -m "message" flask db upgrade

Templates help you to seperate the application logic and Presentation logic. By default flask is going to look for templates in a directory named templates. Separation of concerns - Keep the configs external to the app

pip install flask-wtf #For handling web-forms, use flask WTF package.

The flask application instance needs to be configured with a secret key the secret key is used in Flask. Helps to avoid CSRF.

C:\Users\vmundaragi\AppData\Local\Programs\Python\Python36\python.exe

When using flask WTF to work with web forms. Each form is represented by a python class.

sqlalchemy supports many rdms including sqllite, mysql, postgresql

flask shell

pip install flask-login #for working with user sessions

The flask login extension can work with any user model class regardless of how you implemented it. It needs three attributes and one method to be implemented to make it easy. The extension provides a useful mixin class that you can add as a base class to your model giving you an appropriate implementation for these four elements.

u = User(username="Vijay", email="[email protected]") u.set_password("qwe") db.session.add(u) db.session.commit()

Naming Convention - All sub_templates are named starting from "_".

micro_blog's People

Contributors

vijay-mundaragi avatar

Watchers

 avatar

micro_blog's Issues

Create a requirements.txt file

Hey Vijay! Can you create a "requirements.txt" file containing all the python_modules and their version required to run the app.
You can use the below command

pip freeze > requirements.txt

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.