Code Monkey home page Code Monkey logo

motortwit-demo's Introduction

Motortwit Demo

Excerpted example of mongo project using aiohttp, motor and aiohttp_jinja2 (https://readthedocs.org/projects/aiohttp-jinja2/downloads/pdf/latest/), similar to flask one. this example work in windows python conda env, not in docker as intended in original https://github.com/aio-libs/aiohttp-demos

Installation

Clone repo and install library:

$ git clone [email protected]:aio-libs/aiohttp-demos.git
$ cd aiohttp-demos

Install the app:

$ pip install -e .
(no need pip install -r req.txt)

Create database for your project:: mongodb run in pwsh Start-Job -ScriptBlock { mongod --config ".sanicmotoprontodbmongodb.conf" }

cd .motortwit

python.exe .generate_data.py

Run application:

python.exe .main.py

Open browser:

http://127.0.0.1:9001

Requirements

motortwit-demo's People

Contributors

tst32 avatar

Watchers

 avatar  avatar

motortwit-demo's Issues

https://motor.readthedocs.io/en/stable/tutorial-asyncio.html

import motor
from motor.motor_asyncio import AsyncIOMotorClient
import motor.motor_asyncio
client = motor.motor_asyncio.AsyncIOMotorClient()
client = motor.motor_asyncio.AsyncIOMotorClient('localhost', 27018)
db = client.test_database
async def do_insert():
document = {'key': 'value'}
result = await db.test_collection.insert_one(document)
print('result %s' % repr(result.inserted_id))

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.