Skip to content

Template project for CRUD App using Vue.js and aiohttp

License

Notifications You must be signed in to change notification settings

soltanoff/aiohttp_vue_template

Repository files navigation

CRUD App: Vue.js & aiohttp

Template project for CRUD App using Vue.js and aiohttp

App configs settings.py:

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))

PAGE_SIZE = 5

STATIC_URL = '/static/'
STATIC_DIRECTORY = os.path.join(BASE_DIR, 'static')

TEMPLATE_DIRECTORY = os.path.join(BASE_DIR, 'templates')
BASE_TEMPLATE_NAME = 'index.html'

DATABASE_URL = "sqlite:///./db.sqlite3"

ALLOWED_HOSTS = ['*']
# ALLOWED_HOSTS = []  # for development
# ALLOWED_HOSTS = ['*']  # for docker-compose
# ALLOWED_HOSTS = ["your-production-domain"]  # for production

Fill your database and run aiohttp development server:

$ pip3 install -r requirements.txt
$ python3 main.py --host 0.0.0.0 --port 8000

To run with a docker compose:

$ docker-compose up

Screens

Example #1: Main page

Main page

Example #2: Pagination

Pagination

Example #3: Create article

Create article

Example #4: Search article by title

Search article by title