Initial commit
This commit is contained in:
3
backend_python/.idea/.gitignore
generated
vendored
Normal file
3
backend_python/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
8
backend_python/.idea/backend.iml
generated
Normal file
8
backend_python/.idea/backend.iml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
6
backend_python/.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
backend_python/.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
7
backend_python/.idea/misc.xml
generated
Normal file
7
backend_python/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
|
||||
<component name="PyCharmProfessionalAdvertiser">
|
||||
<option name="shown" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
8
backend_python/.idea/modules.xml
generated
Normal file
8
backend_python/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/backend.iml" filepath="$PROJECT_DIR$/.idea/backend.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
backend_python/.idea/vcs.xml
generated
Normal file
6
backend_python/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
BIN
backend_python/__pycache__/main.cpython-38.pyc
Normal file
BIN
backend_python/__pycache__/main.cpython-38.pyc
Normal file
Binary file not shown.
BIN
backend_python/__pycache__/vars.cpython-38.pyc
Normal file
BIN
backend_python/__pycache__/vars.cpython-38.pyc
Normal file
Binary file not shown.
17
backend_python/main.py
Normal file
17
backend_python/main.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from flask import Flask, jsonify
|
||||
from flask_restful import Api, Resource, reqparse, abort
|
||||
import pymongo, pika
|
||||
import vars
|
||||
import resources.user as user
|
||||
|
||||
app = Flask(__name__)
|
||||
api = Api(app)
|
||||
|
||||
api.add_resource(user.UserLogin, "/user/login")
|
||||
|
||||
if __name__ == '__main__':
|
||||
vars.db = pymongo.MongoClient("mongodb+srv://backend:Rjmzs75W9EYwW8G7@cluster0.qxerq.mongodb.net/livebeat?retryWrites=true&w=majority")
|
||||
print(vars.db.list_databases())
|
||||
rabbit = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
|
||||
channel = rabbit.channel()
|
||||
app.run(debug=True)
|
||||
BIN
backend_python/resources/__pycache__/user.cpython-38.pyc
Normal file
BIN
backend_python/resources/__pycache__/user.cpython-38.pyc
Normal file
Binary file not shown.
7
backend_python/resources/user.py
Normal file
7
backend_python/resources/user.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from flask_restful import Api, Resource, reqparse, abort
|
||||
import vars
|
||||
|
||||
class UserLogin(Resource):
|
||||
def get(self):
|
||||
print(vars.db['livebeat'])
|
||||
return
|
||||
6
backend_python/vars.py
Normal file
6
backend_python/vars.py
Normal file
@@ -0,0 +1,6 @@
|
||||
"""
|
||||
This file contains all variables that are shared across the entire application.
|
||||
For example: Database connection, sockets, etc.
|
||||
"""
|
||||
|
||||
db = None
|
||||
Reference in New Issue
Block a user