mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-25 06:24:19 +00:00
🐛 Tentative fix for weird bug
This commit is contained in:
parent
d289ff41bd
commit
6af4d57f36
2 changed files with 2 additions and 36 deletions
|
@ -5,6 +5,7 @@
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/nest_backend" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/nest_backend" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/nest_backend/test" isTestSource="true" />
|
<sourceFolder url="file://$MODULE_DIR$/nest_backend/test" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/docs/_build" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Poetry (backend)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Poetry (backend)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
"""
|
"""
|
||||||
This is the runner for the server.
|
This is the runner for the server.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import werkzeug.middleware.proxy_fix
|
import werkzeug.middleware.proxy_fix
|
||||||
from .routes import *
|
from .routes import *
|
||||||
from .database import Base, tables
|
|
||||||
import psycopg2
|
|
||||||
from .gestione import *
|
from .gestione import *
|
||||||
from flask_cors import CORS
|
from flask_cors import CORS
|
||||||
from flask_jwt_extended import *
|
from flask_jwt_extended import *
|
||||||
from .app import app
|
from .app import app
|
||||||
from .tweet_explorer.__main__ import search_repo_conditions, start_exploring
|
|
||||||
from .api_spec import spec
|
from .api_spec import spec
|
||||||
from .swagger import swagger_ui_blueprint, SWAGGER_URL
|
from .swagger import swagger_ui_blueprint, SWAGGER_URL
|
||||||
|
|
||||||
|
@ -58,35 +54,4 @@ if __name__ == "__main__":
|
||||||
Base.session.add(
|
Base.session.add(
|
||||||
User(email="admin@admin.com", password=gen_password("password"), username="admin", isAdmin=True))
|
User(email="admin@admin.com", password=gen_password("password"), username="admin", isAdmin=True))
|
||||||
Base.session.commit()
|
Base.session.commit()
|
||||||
if not Repository.query.filter_by(id=1).first():
|
app.run(debug=__debug__)
|
||||||
Base.session.add(Repository(id=1, name="Draghi", owner_id="admin@admin.com"))
|
|
||||||
Base.session.commit()
|
|
||||||
if not Condition.query.filter_by(id=1).first():
|
|
||||||
Base.session.add(Condition(id=1, type=Enums.ConditionType.hashtag, content="draghi"))
|
|
||||||
Base.session.commit()
|
|
||||||
if not Condition.query.filter_by(id=2).first():
|
|
||||||
Base.session.add(Condition(id=2, type=Enums.ConditionType.location, content="Modena"))
|
|
||||||
Base.session.commit()
|
|
||||||
if not Condition.query.filter_by(id=3).first():
|
|
||||||
Base.session.add(Condition(id=3, type=Enums.ConditionType.time, content="2021-04-27"))
|
|
||||||
Base.session.commit()
|
|
||||||
if not Uses.query.filter_by(rid=1, cid=1).first():
|
|
||||||
Base.session.add(Uses(rid=1, cid=1))
|
|
||||||
Base.session.commit()
|
|
||||||
if not Uses.query.filter_by(rid=1, cid=2).first():
|
|
||||||
Base.session.add(Uses(rid=1, cid=2))
|
|
||||||
Base.session.commit()
|
|
||||||
if not Uses.query.filter_by(rid=1, cid=3).first():
|
|
||||||
Base.session.add(Uses(rid=1, cid=3))
|
|
||||||
Base.session.commit()
|
|
||||||
debug = True
|
|
||||||
if os.getenv("DISABLE_DEBUG"):
|
|
||||||
debug = False
|
|
||||||
|
|
||||||
#print(Repository.query.all()[0].to_json())
|
|
||||||
#print(Condition.query.all()[0].content)
|
|
||||||
#print(Uses.query.all()[0].cid, Uses.query.all()[0].rid)
|
|
||||||
search_repo_conditions(1)
|
|
||||||
#start_exploring()
|
|
||||||
app.run(debug=debug)
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue