Some initial setup

This commit is contained in:
xenia 2019-05-30 00:15:17 -04:00
parent 24910a7bfc
commit d529552609
6 changed files with 67 additions and 6 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ __pycache__
*.egg-info
.env
.ycm_extra_conf.py
postgres/
.envrc

22
README.md Normal file
View File

@ -0,0 +1,22 @@
# WikiLain #
A boneless wiki system.
## Setup ##
Install requirements:
```
flask
flask_oidc
sqlalchemy
mistune
mistune_contrib
flask-sqlalchemy
flask-migrate
```
```
export FLASK_APP=wikilain
export FLASK_ENV=development
flask db upgrade
flask run
```

View File

@ -2,13 +2,20 @@ from setuptools import setup
setup(name='wikilain',
version='0.1',
description='Sample text',
url='https://example.com',
author='John Smith',
author_email='none@example.com',
license='Undecided',
description='Boneless wiki software with a side of Lain',
url='https://git.lain.faith/haskal/wikilain',
author='haskal',
author_email='haskal@bepis.xyz',
license='GPL-3.0-or-later',
packages=['wikilain'],
install_requires=[
"flask",
"flask_oidc",
"sqlalchemy",
"mistune",
"mistune_contrib",
"flask-sqlalchemy",
"flask-migrate"
],
include_package_data=True,
entry_points={

View File

@ -0,0 +1,15 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = 'sqlite:////tmp/test.db'
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
from .models import db, migrate, User
db.init_app(app)
migrate.init_app(app, db)
@app.route("/")
def main_page():
return "Hello and also world"

View File

@ -1 +1,3 @@
print("Hello, World!")
from wikilain import app
app.run()

13
wikilain/models.py Normal file
View File

@ -0,0 +1,13 @@
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
db = SQLAlchemy()
migrate = Migrate(None, db)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
def __repr__(self):
return '<User %r>' % self.username