-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2331bde
commit 6e5d147
Showing
21 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import mysql.connector | ||
env = os.environ.get("PYTHON_ENV") | ||
|
||
def connectSql(): | ||
if(env =="production"): | ||
mydb=mysql.connector.connect(host="shoppy-db.cexukr3eruop.ap-south-1.rds.amazonaws.com",user="root",password="shoppy_password",database="shoppy") | ||
else: | ||
mydb=mysql.connector.connect(host="localhost",user="root",password="root",database="shoppy") | ||
|
||
return mydb | ||
|
||
|
||
return mycursor | ||
|
||
# mycursor.execute("SELECT * FROM product") |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class PagesConfig(AppConfig): | ||
name = 'pages' |
Empty file.
Binary file added
BIN
+187 Bytes
server/python_server/pages/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.http import HttpResponse | ||
from django.shortcuts import render | ||
from database import connect | ||
|
||
my = connect.connectSql() | ||
mycursor = my.cursor() | ||
data = mycursor.execute("SELECT * FROM shoppy.product") | ||
print(mycursor) | ||
print(data) | ||
# Create your views here. | ||
def home_view(*args,**kwargs): | ||
return HttpResponse ("<h1>hello world</h1>") |
Binary file modified
BIN
+0 Bytes
(100%)
server/python_server/python_server/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+11 Bytes
(100%)
server/python_server/python_server/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+78 Bytes
(110%)
server/python_server/python_server/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
server/python_server/python_server/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters