Skip to content

ninabarzh/flask_cookie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookiecutter Flask API

API (backend python) for the flask_cookie-clone frontend. Built with Cookiecutter flask OpenAPI

Setup

Install dependencies:

$ pip install -r requirements-dev.txt

Run tests:

$ make run_tests

Or:

$ make db_test_up
$ pytest
$ make db_test_down

Run the API:

$ docker-compose up -d
$ flask db upgrade     # 1a vez apenas
$ flask run

👉 http://localhost:5000/api/ 👉 http://localhost:5000/api/news

Next steps

Adding a news item example

flask shell

Python 3.9.5 (...)

from flask_cookie.ext.database import db
from flask_cookie.models.news import News
from flask_cookie.models.users import User

News.query.all()
[]


u = User(name="roger", username="rac", email="[email protected]")
db.session.add(u)
db.session.commit()

n = News(title="Teste", description="1o. teste", author_id=u.id)
db.session.add(n)
db.session.commit()

News.query.all()
[Teste]

About

Playing around with cookiecutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published