Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/startup/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = 'apps.startup.apps.MyAppConfig'
File renamed without changes.
5 changes: 2 additions & 3 deletions startupApp/apps.py → apps/startup/apps.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from django.apps import AppConfig
from ticketscraping.scraping import start
from ..ticketscraping.scraping import start
from datetime import datetime
from threading import Thread


class MyAppConfig(AppConfig):
name = "startupApp"
name = "apps.startup"
verbose_name = "start tmtracker"

def ready(self):
print(
f"server started at {datetime.now().strftime('%d/%m/%Y %H:%M:%S')}")
print("=== database connection is established ===")
Thread(target=start).start()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import constants
from threading import Semaphore
from .prepare_reese84token import getReese84Token
from storage.storage import *
from ..storage.storage import *
from .seat_analysis import store_seats

class Reese84TokenUpdating():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dateutil import parser
from storage.storage import insert_one
import ticketscraping.constants as constants
from ..storage.storage import insert_one
from ..ticketscraping import constants


def store_seats(data, scheduler_config):
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion trackerapi/apps.py → apps/trackerapi/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class TrackerapiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'trackerapi'
name = 'apps.trackerapi'
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions trackerapi/views.py → apps/trackerapi/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.shortcuts import render
from django.http import HttpResponse, HttpRequest
from storage.storage import insert_one, find_one_and_update
import ticketscraping.constants as constants
from ..storage.storage import insert_one, find_one_and_update
from ..ticketscraping import constants
import json


Expand Down
2 changes: 1 addition & 1 deletion secret.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import os

CONN_SRV = os.environ.get('CONN_SRV')
CONN_SRV = os.environ.get('CONN_SRV')
1 change: 0 additions & 1 deletion startupApp/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions tmtracker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
'django.contrib.contenttypes',
# 'django.contrib.messages',
'django.contrib.staticfiles',
'startupApp',
'trackerapi',
'apps.startup',
'apps.trackerapi',
]

MIDDLEWARE = [
Expand Down
2 changes: 1 addition & 1 deletion tmtracker/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
from django.urls import path, include

urlpatterns = [
path('tracker-api/', include('trackerapi.urls'))
path('tracker-api/', include('apps.trackerapi.urls'))
]
1 change: 1 addition & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from secret import CONN_SRV

client = MongoClient(CONN_SRV)
print("=== database connection is established ===")

def get_db_handle(db_name):
global client
Expand Down