Code Monkey home page Code Monkey logo

flask-cms-admin's Introduction

flask-cms-admin

a simple cms dashborad build using flask,just like a name this project is not a full cms because you need a front end display your content.

How to run

clone this repo

git clone https://github.com/AlphaBeta1906/flask-cms-admin.git

cd flask-cms-admin

activate virtual environment

. venv/bin/activate

install dependencies

pip install -r requirements.txt

change project configuration in cms/config.py,especially the database uri

...
SQLALCHEMY_DATABASE_URI = (
        "your_database_url"    
)
...

if database already configured now you can do the migration by running follwing command:

python manage.py migration
# yeah just a shorthand of flask migration command

and then add new admin by running command:

python manage.py add_admin
# a input will appear and you can insert your admin data(e.g:username,password,email)

now you can run the server by :

python manage.py dev

to enable live reload or

python wsgi.py
# i dont know why how to make template livereload

or just using

flask run

Endpoint

flask-cms-admin is only for back end and you can connect to the front end with rest api,wich can be accesed by following endpoint:

note: the rest api prefix is /api/v1

  1.  GET /

    and

    GET /blogs

    get all blogs

  2.  GET /blogs?page={n}

    get blogs by page(5 blog per page)
    n = page number

  3. GET /read/<param>

    param can be blog id or blog slug/blog title with - instead of spaces

  4. GET /t?page={n}

    get tags by page if page query string is not none it will return 10 tags per page else it will return all tags

  5. GET /t/<tag>?page={n}

    get blogs categorize by tags and if page query is not none it will return 10 blogs per page else it will return all blogs categorize by tags

well,all api endpoint is GET method,because all endpoint that needed admin permision is only can be accesed by login

Creating content

if you want to start creating content you need login first wich by default the route is /login,and then you need to inserting username and password you make when running command add_admin,after the login success you can start writing content by clicking new blog button

note: in this project the default editor is tinymce,but maybe you can change later whatever you(want of course with some additional configuration)

flask-cms-admin's People

Contributors

alphabeta1906 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.