Giter Site home page Giter Site logo

headless-forum-fastapi's Introduction

Backend for simple forum made with FastAPI and Piccolo ORM ecosystem.


Instalation

Clone repository in fresh virtualenv.

git clone https://github.com/sinisaos/headless-forum-fastapi.git

Install requirements

cd headless-forum-fastapi
pip install -r requirements/requirements.txt

Create database

sudo -i -u yourpostgresusername psql
CREATE DATABASE forum;
\q;

Setup


Create .env file in root of the project.

DB_NAME=your db name
DB_USER=your db username
DB_PASSWORD=your db password
DB_HOST=your db host
DB_PORT=your db port
SECRET_KEY=your secret key
ALGORITHM="HS256"
ACCESS_TOKEN_EXPIRE_MINUTES=30

Migrations

./scripts/migrations.sh

Create admin user

./scripts/user.sh

Testing

Install test requirements.

pip install -r requirements/test-requirements.txt

Run tests.

./scripts/test.sh

Linting

./scripts/lint.sh

Getting started

./scripts/start.sh

After site is running log in as admin user on localhost:8000/admin/ and add categories, topics etc.

For non admin user go to API docs localhost:8000/docs/ where you can register.

After that you can login with Authorize button to access protected routes.

headless-forum-fastapi's People

Contributors

sinisaos avatar sourcery-ai-bot 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

Watchers

 avatar  avatar

headless-forum-fastapi's Issues

Problem with updating fields in `Piccolo User` via admin panel

Firstly, thank you for providing this helpful template for us to follow along.

However, I've encountered a couple of issues during this process:

It appears that we're unable to update certain fields in Piccolo User using the admin panel. For example, when attempting to update the email field, the screen shows that the update is successful, but the field does not actually update.

Additionally, it seems that performing a bulk update in Piccolo User, such as updating the first name field, is not functioning correctly. The screen displays "Invalid column name or value", and the traceback indicates:

".../piccolo_api/crud/endpoints.py", line 1162, in patch_single
    if values["password"]:
       ~~~~~~^^^^^^^^^^^^
KeyError: 'password'

I'm curious whether the issue originates from piccolo_api or from the example itself. Any insights you could provide would be greatly appreciated.

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.