-
Notifications
You must be signed in to change notification settings - Fork 6
Bump dependencies and reffresh the project layout #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,54 @@ | ||
| [tool.isort] | ||
| profile = "black" | ||
| [build-system] | ||
| requires = ["setuptools >= 80.9.0", "setuptools_scm >= 8.3.1"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "timetable-fri" | ||
| description = "UL FRI Timetable API" | ||
| authors = [{ name = "Gregor Jerše", email = "gregor@jerse.info" }, { name = "Gašper Fele-Žorž", email = "polz@not.si" }] | ||
| dynamic = ["version"] | ||
| readme = "README.md" | ||
| license = "GPL-3.0-or-later" | ||
| requires-python = ">=3.13, <3.14" | ||
| keywords = ["timetabling", "FRI", "university", "timetable", "api", "django", "rest-framework"] | ||
| classifiers = [ | ||
| "Development Status :: 5 - Production/Stable", | ||
| "Framework :: Django :: 5.2", | ||
| "Environment :: Console", | ||
| "Environment :: Web Environment", | ||
| "Intended Audience :: Education", | ||
| "Intended Audience :: Developers", | ||
| "Intended Audience :: System Administrators", | ||
| "Topic :: Software Development :: Libraries :: Python Modules", | ||
| "Operating System :: OS Independent", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.13", | ||
| ] | ||
| dependencies = [ | ||
| "Django ~= 5.2.7", | ||
| "djangorestframework ~= 3.16.1", | ||
| "django-filter ~= 25.2", | ||
| "dj-rest-auth ~= 7.0.1", | ||
| "django-cors-headers ~= 4.9.0", | ||
| "python-ldap ~= 3.4.5", | ||
| "requests ~= 2.32.5", | ||
| "django-auth-ldap ~= 5.2.0", | ||
| "django-impersonate ~= 1.9.5", | ||
| "django-import-export ~= 4.3.12", | ||
| "pytz ~= 2025.2", | ||
| "icalendar ~= 6.3.1", | ||
| "palettable ~= 3.3.3", | ||
| ] | ||
| [project.optional-dependencies] | ||
| postgres = ["psycopg[binary] ~= 3.2.12"] | ||
| docs = ["sphinx", "sphinx-pyproject"] | ||
| package = ["twine", "check-manifest", "build"] | ||
| test = ["ruff~=0.14.2", "pytest-cov"] | ||
| devel = ["ipython", "types-tqdm"] | ||
| [project.urls] | ||
| repository = "https://github.com/ul-fri/urnik" | ||
| documentation = "https://github.com/ul-fri/urnik" | ||
|
|
||
| [tool.setuptools_scm] | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,195 @@ | ||||||||||||||||||
| # Django settings for urnik project. | ||||||||||||||||||
| import ldap | ||||||||||||||||||
| from django_auth_ldap.config import LDAPSearch, GroupOfNamesType | ||||||||||||||||||
| from friprosveta.ul_groupname import ULNestedGroupOfNamesType | ||||||||||||||||||
| from django.utils.translation import gettext_lazy as _ | ||||||||||||||||||
| from urnik_fri.settings_common import * | ||||||||||||||||||
|
|
||||||||||||||||||
| # DEBUG = False | ||||||||||||||||||
| DEBUG = True | ||||||||||||||||||
|
|
||||||||||||||||||
| #--- UNITIME settings ------ | ||||||||||||||||||
| UNITIME_DB_USER = "user" | ||||||||||||||||||
| UNITIME_DB_PASSWORD = "password" | ||||||||||||||||||
| UNITIME_DB_NAME = "db_name" | ||||||||||||||||||
| UNITIME_DB_HOST = "db_host" | ||||||||||||||||||
| # ------------------------- | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| ADMINS = ( | ||||||||||||||||||
| ('polz', 'polz@fri.uni-lj.si'), | ||||||||||||||||||
| ('gregor', 'gregor.jerse@fri.uni-lj.si'), | ||||||||||||||||||
| ('gregorj', 'gregor@jerse.info'), | ||||||||||||||||||
| ('gasperfele@fri1.uni-lj.si', 'polz@fri.uni-lj.si'), | ||||||||||||||||||
| ) | ||||||||||||||||||
| MANAGERS = ADMINS | ||||||||||||||||||
|
|
||||||||||||||||||
| # AUTHENTICATION_BACKENDS = ( | ||||||||||||||||||
| # 'guardian.backends.ObjectPermissionBackend', | ||||||||||||||||||
| # 'django.contrib.auth.backends.ModelBackend', # this is default | ||||||||||||||||||
| # ) | ||||||||||||||||||
|
|
||||||||||||||||||
| #----------------------------------------- | ||||||||||||||||||
| # Email settings | ||||||||||||||||||
| #----------------------------------------- | ||||||||||||||||||
| EMAIL_HOST = '10.0.32.2' | ||||||||||||||||||
| EMAIL_PORT = 25 | ||||||||||||||||||
| #EMAIL_HOST_USER = 'urnik' | ||||||||||||||||||
| #EMAIL_HOST_PASSWORD = 'pogreglz' | ||||||||||||||||||
| EMAIL_USE_TLS = True | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| #----------------------------------------- | ||||||||||||||||||
| # Database settings | ||||||||||||||||||
| #----------------------------------------- | ||||||||||||||||||
| DATABASES = { | ||||||||||||||||||
| 'default': { | ||||||||||||||||||
| 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | ||||||||||||||||||
| 'NAME': 'timetable', # Or path to database file if using sqlite3. | ||||||||||||||||||
| 'USER': 'timetable', # Not used with sqlite3. | ||||||||||||||||||
| 'PASSWORD': 'qOvpzZODQ4n55JKRyRU16PJBEeUde1uK', # Not used with sqlite3. | ||||||||||||||||||
| 'HOST': 'simargl.jerse.info', # Set to empty string for localhost. Not used with sqlite3. | ||||||||||||||||||
|
Comment on lines
+48
to
+51
|
||||||||||||||||||
| 'NAME': 'timetable', # Or path to database file if using sqlite3. | |
| 'USER': 'timetable', # Not used with sqlite3. | |
| 'PASSWORD': 'qOvpzZODQ4n55JKRyRU16PJBEeUde1uK', # Not used with sqlite3. | |
| 'HOST': 'simargl.jerse.info', # Set to empty string for localhost. Not used with sqlite3. | |
| 'NAME': os.environ.get('DB_NAME', ''), # Or path to database file if using sqlite3. | |
| 'USER': os.environ.get('DB_USER', ''), # Not used with sqlite3. | |
| 'PASSWORD': os.environ.get('DB_PASSWORD', ''), # Not used with sqlite3. | |
| 'HOST': os.environ.get('DB_HOST', ''), # Set to empty string for localhost. Not used with sqlite3. |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SECRET_KEY contains a placeholder value that appears to be committed to version control. Django's SECRET_KEY should be a cryptographically strong random string and should never be hardcoded in settings files. Move this to an environment variable or a secrets management system.
| SECRET_KEY = 'make_this_unique_and_dont_share_it_with_anybody_sure' | |
| SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY') | |
| if not SECRET_KEY: | |
| raise RuntimeError("DJANGO_SECRET_KEY environment variable is not set. Please set it to a cryptographically strong random string.") |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'Timplate' to 'Template'.
| # Timplate settings | |
| # Template settings |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate logger key 'friprosveta' defined at lines 171 and 176. The second definition will override the first. These should either be merged into a single logger configuration or one should be renamed if they're meant to be different loggers.
| 'level': 'INFO', | |
| }, | |
| 'friprosveta': { | |
| 'handlers': ['file'], | |
| # 'handlers': ['null'], |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API token is hardcoded in the settings file. This credential should be moved to an environment variable or secrets management system to prevent exposure in version control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
.last()to get the current site is unreliable and will return incorrect results in multi-site deployments. This breaks the original site-aware behavior. Ifget_current_site(request)is incompatible with the new Django version, consider usingSite.objects.get_current()or passing the site_id explicitly rather than defaulting to an arbitrary last site.