Giter Club home page Giter Club logo

sanic-mdl-blog's People

Contributors

stopspazzing 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  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

sanic-mdl-blog's Issues

migration to sanic-wtf 0.4.0

As of Sanic-WTF 0.4.0, I removed form.hidden_tag, the csrf token is still accessible as form.csrf_token or whatever name you set in configuration.

The reason of removing this is here pyx/sanic-wtf#9 , to put it simply, I figured that to have hidden_tag in the style of Flask-WTF (e.g, the same API, acts as a callable, including all hidden tags, etc.), we need another dependency (markupsafe) or roll our own wrapper. I think it may not be worth it, so I decided to remove the misbehave form.hidden_tag.

Please correct me if I am wrong. Thanks.

python run.py problem

Traceback (most recent call last):
File "run.py", line 3, in
from app import app
File "/root/test/Sanic-MDL-Blog/app/init.py", line 5, in
from app import views
File "/root/test/Sanic-MDL-Blog/app/views.py", line 110
o.write(f'DB_URI = {repr(uri)}\n')
^
SyntaxError: invalid syntax

SQLite Error: no such table: blog_data

When I open the browser to http://127.0.0.1:8000 I see this error:

Error
('HY000', '[HY000] [SQLite]no such table: blog_data (1) (1) (SQLExecDirectW)')

I guess db must be prepared and populated first? Would you mind providing some noob-friendly detailed steps for that part, too? ;-)

Here is the full output in the terminal:

2017-05-13 14:57:56,651: INFO: Goin' Fast @ http://127.0.0.1:8000
Server successfully started!
2017-05-13 14:57:56,693: INFO: Starting worker [24940]
2017-05-13 14:58:10,324: ERROR: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 465, in handle_request
    response = await response
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 128, in throw
    return self.gen.throw(type, value, traceback)
  File "main.py", line 207, in index
    await cur.execute('SELECT * FROM blog_data;')
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
pyodbc.Error: ('HY000', '[HY000] [SQLite]no such table: blog_data (1) (1) (SQLExecDirectW)')

2017-05-13 14:58:10,327: ERROR: Exception occurred while handling uri: "http://127.0.0.1:8000/"
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 465, in handle_request
    response = await response
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 128, in throw
    return self.gen.throw(type, value, traceback)
  File "main.py", line 207, in index
    await cur.execute('SELECT * FROM blog_data;')
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
pyodbc.Error: ('HY000', '[HY000] [SQLite]no such table: blog_data (1) (1) (SQLExecDirectW)')

2017-05-13 14:58:10,487: ERROR: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 465, in handle_request
    response = await response
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 128, in throw
    return self.gen.throw(type, value, traceback)
  File "main.py", line 222, in post
    await cur.execute('SELECT * FROM blog_data WHERE post_name="{name}";')
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
pyodbc.Error: ('HY000', '[HY000] [SQLite]no such table: blog_data (1) (1) (SQLExecDirectW)')

2017-05-13 14:58:10,490: ERROR: Exception occurred while handling uri: "http://127.0.0.1:8000/favicon.ico"
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 465, in handle_request
    response = await response
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 128, in throw
    return self.gen.throw(type, value, traceback)
  File "main.py", line 222, in post
    await cur.execute('SELECT * FROM blog_data WHERE post_name="{name}";')
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
pyodbc.Error: ('HY000', '[HY000] [SQLite]no such table: blog_data (1) (1) (SQLExecDirectW)')

2017-05-13 14:59:10,006: ERROR: NoneType: None

2017-05-13 14:59:10,008: ERROR: NoneType: None

Missing ; in sqlite queries.

await con.execute('''CREATE TABLE "blog_posts" ( `id` INTEGER DEFAULT 'None' PRIMARY KEY AUTOINCREMENT, `post_author` VARCHAR(20) DEFAULT 'Demo', `post_date` DATETIME DEFAULT '0000-00-00 00-00-00', `post_content` TEXT DEFAULT 'None', `post_title` TEXT DEFAULT 'None', `post_name` VARCHAR(200) DEFAULT 'new post', `post_image` VARCHAR(20) DEFAULT 'road_big.jpg', `post_status` VARCHAR(20) DEFAULT 'publish', `post_modified` DATETIME DEFAULT '0000-00-00 00-00-00', `comment_status` VARCHAR(20) DEFAULT 'open', `post_password` VARCHAR(20) DEFAULT 'None', `post_likes` VARCHAR(20) DEFAULT '0' )''')

Line 70 and 71 in models.py the ; is missing at the end of queries. If Config set to demo content = false, the app will crash as no tables created.

Nice project. Hope you will finish it one day. Would like to see sqlalchemy, alembic migrations and mysql implemented. Might do it myself... Thanks

Can't install on Ubuntu 14.04 LTS VM

Installation with Python 3.4 fails with:
RuntimeError: aioodbc doesn't support Python earlier than 3.5

Installation with Python 3.5 / 3.6 fails with:
Failed building wheel for ujson ... fatal error: Python.h: No such file or directory
Failed building wheel for httptools ... fatal error: Python.h: No such file or directory
Failed building wheel for pyodbc ... fatal error: Python.h: No such file or directory

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.