Skip to content

Commit

Permalink
simple setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryokuman committed Jul 13, 2022
1 parent 86c2d51 commit 3f9a48e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
32 changes: 26 additions & 6 deletions backend/Untitled.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"cell_type": "code",
"execution_count": 1,
"id": "0d104680",
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"import os\n",
Expand All @@ -19,7 +23,11 @@
"cell_type": "code",
"execution_count": 2,
"id": "b48ed5fa",
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"from rebikeuser.models import User"
Expand All @@ -29,7 +37,11 @@
"cell_type": "code",
"execution_count": 3,
"id": "4c259257",
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
Expand All @@ -51,7 +63,11 @@
"cell_type": "code",
"execution_count": 8,
"id": "1ae3deb3",
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
Expand All @@ -72,7 +88,11 @@
"cell_type": "code",
"execution_count": null,
"id": "efd36010",
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
Expand All @@ -98,4 +118,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
1 change: 1 addition & 0 deletions backend/backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

urlpatterns = [
path('admin/', admin.site.urls),
path('user/', include('rebikeuser.urls')),
]
7 changes: 7 additions & 0 deletions backend/rebikeuser/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.urls import path
from . import views


urlpatterns =[
path('login/', views.on_login)
]
8 changes: 7 additions & 1 deletion backend/rebikeuser/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from django.http import HttpResponse
from django.http.response import JsonResponse
from .models import User


def on_login(request):
qs = User.objects.all()
username = request.GET.get('username', '')
if username:
qs = qs.filter(user_name=username)
return HttpResponse(qs)
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ PyMySQL==1.0.2
mysql-connector-python==8.0.23
setuptools==58.1.0
mysqlclient==2.1.1

0 comments on commit 3f9a48e

Please sign in to comment.