Some initial setup
This commit is contained in:
parent
24910a7bfc
commit
d529552609
|
@ -6,3 +6,5 @@ __pycache__
|
|||
*.egg-info
|
||||
.env
|
||||
.ycm_extra_conf.py
|
||||
postgres/
|
||||
.envrc
|
||||
|
|
|
@ -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
|
||||
```
|
17
setup.py
17
setup.py
|
@ -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={
|
||||
|
|
|
@ -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"
|
|
@ -1 +1,3 @@
|
|||
print("Hello, World!")
|
||||
from wikilain import app
|
||||
|
||||
app.run()
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue