Code Monkey home page Code Monkey logo

article-cms's Introduction

Article CMS (FlaskWebProject)

This project is a Python web application built using Flask. The user can log in and out and create/edit articles. An article consists of a title, author, and body of text stored in an Azure SQL Server along with an image that is stored in Azure Blob Storage. You will also implement OAuth2 with Sign in with Microsoft using the msal library, along with app logging

Log In Credentials for FlaskWebProject

  • Username: admin
  • Password: pass

Or, once the MS Login button is implemented, it will automatically log into the admin account.

Submission:

Create a resoucre group with the following services:

Screen Shot 2022-10-22 at 4 34 33 PM

Create an SQL Database in Azure that contains a user table, an article table, and data in each table (populated with the scripts provided in the SQL Scripts folder).

Screen Shot 2022-10-21 at 6 06 06 PM

Screen Shot 2022-10-21 at 6 06 40 PM

Screen Shot 2022-10-21 at 6 07 02 PM

Screen Shot 2022-10-21 at 6 07 14 PM

Screen Shot 2022-10-22 at 4 37 24 PM

Create a Storage Container in Azure for images to be stored in a container.

Screen Shot 2022-10-21 at 6 25 34 PM

Screen Shot 2022-10-22 at 4 28 57 PM

Sign In With Microsoft button + username and password successful attemp:

Screen Shot 2022-10-22 at 4 22 19 PM

Screen Shot 2022-10-22 at 4 22 40 PM

Screen Shot 2022-10-22 at 4 21 33 PM

Screen Shot 2022-10-22 at 4 21 59 PM

Create an article with the following data

Screen Shot 2022-10-22 at 4 26 19 PM

Screen Shot 2022-10-22 at 4 26 31 PM

Storage account after uploading the image from the app

Screen Shot 2022-10-22 at 4 58 12 PM

Redirect URI for the registered app

Screen Shot 2022-10-22 at 4 55 13 PM

Log stream of the application

Screen Shot 2022-10-22 at 4 33 23 PM

Dependencies

  1. A free Azure account
  2. A GitHub account
  3. Python 3.7 or later
  4. Visual Studio 2019 Community Edition (Free)
  5. The latest Azure CLI (helpful; not required - all actions can be done in the portal)

All Python dependencies are stored in the requirements.txt file. To install them, using Visual Studio 2019 Community Edition:

  1. In the Solution Explorer, expand "Python Environments"
  2. Right click on "Python 3.7 (64-bit) (global default)" and select "Install from requirements.txt"

Running the application locally:

  1. Create virtual environment python3 -m pip install virtualenv python3 -m virtualenv venv

create a new venv in

./venv source

activate your new venv

. /venv/bin/activate 2. Install all the packages: pip install -r requirements.txt
3. Run the application: python application.py

Troubleshooting

  • Mac users may need to install unixodbc as well as related drivers as shown below:
    brew install unixodbc
  • Check here to add SQL Server drivers for Mac.

article-cms's People

Contributors

norahalshaikhmubarak avatar

Watchers

 avatar

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.