Skip to content

Commit

Permalink
feat: Update URL patterns for stations and trip details; comment out …
Browse files Browse the repository at this point in the history
…logging configuration in settings
  • Loading branch information
AhmedNassar7 committed Dec 17, 2024
1 parent e84aca8 commit 9fe72b4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
6 changes: 3 additions & 3 deletions apps/stations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from .views import TripDetailsView, NearestStationView, StationListView

urlpatterns = [
path("stations-list/", StationListView.as_view(), name="stations-list"),
path("list/", StationListView.as_view(), name="stations-list"),
path(
"trip-details/<int:start_station_id>/<int:end_station_id>/",
"trip/<int:start_station_id>/<int:end_station_id>/",
TripDetailsView.as_view(),
name="trip-details",
),
path("nearest-station/", NearestStationView.as_view(), name="nearest-station"),
path("nearest/", NearestStationView.as_view(), name="nearest-station"),
]
69 changes: 34 additions & 35 deletions egypt_metro/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from datetime import timedelta # Time delta for JWT tokens
from corsheaders.defaults import default_headers # Default headers for CORS


# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent # Base directory for the project

Expand Down Expand Up @@ -205,40 +204,40 @@
"REFRESH_TOKEN_LIFETIME": timedelta(days=7), # Refresh token lifetime
}

LOGGING = {
"version": 1, # Log version
"disable_existing_loggers": False, # Don't disable existing loggers
"formatters": {
"verbose": {
"format": "{levelname} {asctime} {module} {message}", # Log format
"style": "{", # Use {} for formatting
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler", # Log to console
"formatter": "verbose", # Use the verbose formatter
},
"file": {
"level": "DEBUG", # Log debug messages
"class": "logging.FileHandler", # Log to file
"filename": BASE_DIR / "logs/debug.log", # File where logs are saved
"formatter": "verbose", # Use the verbose formatter
},
},
"loggers": {
"django": {
"handlers": ["console", "file"], # Log to console and file
"level": "INFO", # Log info messages
"propagate": True,
},
"__main__": {
"handlers": ["console", "file"], # Log to console and file
"level": "DEBUG", # Log all messages
"propagate": True,
},
},
}
# LOGGING = {
# "version": 1, # Log version
# "disable_existing_loggers": False, # Don't disable existing loggers
# "formatters": {
# "verbose": {
# "format": "{levelname} {asctime} {module} {message}", # Log format
# "style": "{", # Use {} for formatting
# },
# },
# "handlers": {
# "console": {
# "class": "logging.StreamHandler", # Log to console
# "formatter": "verbose", # Use the verbose formatter
# },
# "file": {
# "level": "DEBUG", # Log debug messages
# "class": "logging.FileHandler", # Log to file
# "filename": BASE_DIR / "logs/debug.log", # File where logs are saved
# "formatter": "verbose", # Use the verbose formatter
# },
# },
# "loggers": {
# "django": {
# "handlers": ["console", "file"], # Log to console and file
# "level": "INFO", # Log info messages
# "propagate": True,
# },
# "__main__": {
# "handlers": ["console", "file"], # Log to console and file
# "level": "DEBUG", # Log all messages
# "propagate": True,
# },
# },
# }

CACHES = {
"default": {
Expand Down

0 comments on commit 9fe72b4

Please sign in to comment.