Skip to content

Commit

Permalink
Rename project from committee_admissions to admissions
Browse files Browse the repository at this point in the history
  • Loading branch information
norbye committed Dec 25, 2022
1 parent 5fdd88c commit b93ce70
Show file tree
Hide file tree
Showing 59 changed files with 61 additions and 67 deletions.
12 changes: 6 additions & 6 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ exclude_lines =
if __name__ == .__main__.:

omit =
committee_admissions/*/migrations/*
committee_admissions/settings/*
committee_admissions/*/tests/*
committee_admissions/admissions/factories.py
committee_admissions/wsgi.py
committee_admissions/urls.py
admissions/*/migrations/*
admissions/settings/*
admissions/*/tests/*
admissions/admissions/factories.py
admissions/wsgi.py
admissions/urls.py

show_missing = True

2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ target/
*.swp

.env
committee_admissions/files
admissions/files
main.js
bundles/
webpack-stats.json
Expand Down
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ steps:
- coverage
settings:
registry: https://registry.webkom.dev
repo: registry.webkom.dev/webkom/committee-admissions
repo: registry.webkom.dev/webkom/admissions
username:
from_secret: docker_username
password:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ target/
*.swp

.env
committee_admissions/files
admissions/files
main.js
bundles/
webpack-stats.json
Expand All @@ -87,6 +87,6 @@ webpack-stats.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
committee_admissions/settings/local.py
admissions/settings/local.py
package-lock.json
.vscode
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ target/
*.swp

.env
committee_admissions/files
admissions/files
main.js
bundles/
webpack-stats.json
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
help:
@echo 'ci_settings - create a committee_admissions/settings/local.py for ci'
@echo 'dev_settings - create a committee_admissions/settings/local.py for dev'
@echo 'ci_settings - create a admissions/settings/local.py for ci'
@echo 'dev_settings - create a admissions/settings/local.py for dev'
@echo 'fixme - Fix code formatting'

ci_settings:
echo "from .testing import *" > committee_admissions/settings/local.py
echo "from .testing import *" > admissions/settings/local.py

dev_settings:
echo "from .development import *" > committee_admissions/settings/local.py
echo "from .development import *" > admissions/settings/local.py

fixme:
docker run --rm -v ${PWD}:/code -it python:3.9-slim "bash" "-c" "cd /code && pip install -r requirements/black.txt -r requirements/isort.txt && isort -rc committee_admissions && black committee_admissions"
docker run --rm -v ${PWD}:/code -it python:3.9-slim "bash" "-c" "cd /code && pip install -r requirements/black.txt -r requirements/isort.txt && isort -rc admissions && black admissions"

.PHONY: ci_settings dev_settings
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# committee-admissions
# admissions

#### opptak.abakus.no

Recruitment for Abakom.
Recruitment for Abakus.

## Runnings LEGO and this repository in parallel

Expand All @@ -20,7 +20,7 @@ Run LEGO-WEBAPP by following the [README here](https://github.com/webkom/lego-we

### Terminal 3

Run the committe_admissions backend by doing the following:
Run the admissions backend by doing the following:

Running the backend requires Python 3.9 and a `postgresql` database. The frontend requires `Node`. We recommend using
a virtual environment. Create a `venv` in root using
Expand Down Expand Up @@ -50,13 +50,13 @@ $ pip install pip-tools
$ pip-sync requirements/development.txt
```

The `.env` file with secret keys is not included, but an `example.env` file has been provided in `./committe_admissions/settings`, so that you can simply rename the file and fill in the values.
The `.env` file with secret keys is not included, but an `example.env` file has been provided in `./admissions/settings`, so that you can simply rename the file and fill in the values.

The secrets can be found at **localhost:3000** in the user settings menu after creating an OAuth2 app there. In the form enter `http://127.0.0.1:5000/complete/lego/` as the redirect url.

```sh
# Create a copy of the example env file (run from the root of the project)
$ cp committee_admissions/settings/example.env committee_admissions/settings/.env
$ cp admissions/settings/example.env admissions/settings/.env

# Edit the file and change the KEY and SECRET
AUTH_LEGO_KEY="Client ID from OAuth2"
Expand Down Expand Up @@ -127,7 +127,7 @@ remove excess packages.

## Run tests

Run django tests using tox. Note that we point at the committee_admissions database running at :5433 if we are running lego and admissions
Run django tests using tox. Note that we point at the admissions database running at :5433 if we are running lego and admissions
in parallel

```bash
Expand Down
4 changes: 2 additions & 2 deletions committee-admissions.ini → admissions.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[uwsgi]
module = committee_admissions.wsgi:application
module = admissions.wsgi:application
master = true
vacuum = true
http-socket = :$(PORT)
Expand All @@ -9,7 +9,7 @@ enable-threads = true
disable-logging = true
processes = 4
static-map = /media=/app/files/media
static-map = /static=./committee_admissions/assets/
static-map = /static=./admissions/assets/
static-map = /static=./assets/

max-requests = 50000
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class AdmissionsConfig(AppConfig):
default_auto_field = "django.db.models.AutoField"
name = "committee_admissions.admissions"
name = "admissions.admissions"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import factory

from committee_admissions.admissions.models import (
from admissions.admissions.models import (
Admission,
Group,
GroupApplication,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from django.db.models import Q
from django.utils import timezone

from committee_admissions.admissions import constants
from committee_admissions.utils.models import TimeStampModel
from admissions.admissions import constants
from admissions.utils.models import TimeStampModel


class LegoUser(AbstractUser):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.utils import timezone
from rest_framework import serializers

from committee_admissions.admissions.models import (
from admissions.admissions.models import (
Admission,
Group,
GroupApplication,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from rest_framework import status
from rest_framework.test import APITestCase

from committee_admissions.admissions.constants import LEADER, MEMBER, RECRUITING
from committee_admissions.admissions.models import (
from admissions.admissions.constants import LEADER, MEMBER, RECRUITING
from admissions.admissions.models import (
Admission,
Group,
GroupApplication,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from rest_framework.decorators import action
from rest_framework.response import Response

from committee_admissions.admissions.models import (
from admissions.admissions.models import (
Admission,
Group,
GroupApplication,
LegoUser,
UserApplication,
)
from committee_admissions.admissions.serializers import (
from admissions.admissions.serializers import (
AdminAdmissionSerializer,
AdmissionListPublicSerializer,
AdmissionPublicSerializer,
Expand Down
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.
4 changes: 2 additions & 2 deletions committee_admissions/oauth.py → admissions/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from six.moves.urllib.parse import urljoin
from social_core.backends.oauth import BaseOAuth2

from committee_admissions.admissions import constants
from committee_admissions.admissions.models import Group, Membership
from admissions.admissions import constants
from admissions.admissions.models import Group, Membership


class LegoOAuth2(BaseOAuth2):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@
try:
from .local import * # noqa
except ImportError:
raise ImportError(
"Couldn't load local settings committee_admissions.settings.local"
)
raise ImportError("Couldn't load local settings admissions.settings.local")
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Django settings for committee_admissions project.
Django settings for admissions project.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
Expand All @@ -15,9 +15,7 @@

# GENERAL CONFIGURATION ======================================================
BASE_PROJECT_DIR = environ.Path(__file__) - 3 # manage.py level
ROOT_DIR = (
environ.Path(__file__) - 2
) # (committee_admissions/settings/base.py - 2 = committee_admissions/)
ROOT_DIR = environ.Path(__file__) - 2 # (admissions/settings/base.py - 2 = admissions/)
FILES_ROOT = ROOT_DIR.path("files/")

# APP CONFIGURATION ===========================================================
Expand All @@ -39,7 +37,7 @@
"django_vite",
]

LOCAL_APPS = ["committee_admissions.utils", "committee_admissions.admissions"]
LOCAL_APPS = ["admissions.utils", "admissions.admissions"]

INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS

Expand All @@ -55,7 +53,7 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"committee_admissions.utils.middleware.LoggingMiddleware",
"admissions.utils.middleware.LoggingMiddleware",
]

# DJANGO REST FRAMEWORK CONFIGURATION ==========================================
Expand Down Expand Up @@ -124,8 +122,8 @@
MEDIA_URL = "/media/"

# MISC CONFIGURATION ============================================================
WSGI_APPLICATION = "committee_admissions.wsgi.application"
ROOT_URLCONF = "committee_admissions.urls"
WSGI_APPLICATION = "admissions.wsgi.application"
ROOT_URLCONF = "admissions.urls"
SHELL_PLUS = "ipython"

LOGIN_REDIRECT_URL = "/"
Expand Down Expand Up @@ -156,5 +154,5 @@
"social_core.pipeline.social_auth.load_extra_data",
"social_core.pipeline.user.user_details",
# Custom pipe
"committee_admissions.oauth.update_custom_user_details",
"admissions.oauth.update_custom_user_details",
)
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@

INTERNAL_IPS = ["127.0.0.1"]

AUTHENTICATION_BACKENDS = [
"committee_admissions.oauth.LegoOAuth2"
] + AUTHENTICATION_BACKENDS
AUTHENTICATION_BACKENDS = ["admissions.oauth.LegoOAuth2"] + AUTHENTICATION_BACKENDS

SOCIAL_AUTH_LEGO_KEY = env("AUTH_LEGO_KEY", None)
SOCIAL_AUTH_LEGO_SECRET = env("AUTH_LEGO_SECRET", None)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration

from committee_admissions.utils.sentry import remove_sensitive_data
from admissions.utils.sentry import remove_sensitive_data

from .base import * # noqa

Expand All @@ -28,7 +28,7 @@
SOCIAL_AUTH_LEGO_API_URL = env("AUTH_LEGO_API_URL")

AUTHENTICATION_BACKENDS = [
"committee_admissions.oauth.LegoOAuth2"
"admissions.oauth.LegoOAuth2"
] + AUTHENTICATION_BACKENDS # noqa

# Sentry
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions committee_admissions/urls.py → admissions/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""committee_admissions URL Configuration
"""admissions URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Expand All @@ -19,7 +19,7 @@
from django.urls import include, path, re_path
from rest_framework import routers

from committee_admissions.admissions.views import (
from admissions.admissions.views import (
AdmissionViewSet,
ApplicationViewSet,
AppView,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.core.management.base import BaseCommand
from django.utils import timezone

from committee_admissions.admissions.models import Admission
from admissions.admissions.models import Admission


class Command(BaseCommand):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions committee_admissions/wsgi.py → admissions/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
WSGI config for committee_admissions project.
WSGI config for admissions project.
It exposes the WSGI callable as a module-level variable named ``application``.
Expand All @@ -13,6 +13,6 @@

from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "committee_admissions.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "admissions.settings")

application = SentryWsgiMiddleware(get_wsgi_application())
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "committee_admissions.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "admissions.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "committee-admissions",
"name": "admissions",
"version": "1.0.0",
"description": "Committee admission pages for Abakus",
"description": "Admission system for Abakus",
"main": "index.js",
"repository": "[email protected]:webkom/committee-admissions.git",
"author": "Sigrid Marita Kvamme cherrybeans <[email protected]>",
"repository": "[email protected]:webkom/admissions.git",
"author": "Webkom <[email protected]>",
"license": "MIT",
"scripts": {
"dev": "vite",
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ force_grid_wrap=0
use_parentheses=True
line_length=88
default_section=THIRDPARTY
known_first_party=committee_admissions
known_first_party=admissions
known_django=django,rest_framework
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

[flake8]
exclude = venv/*,.tox/*,committee_admissions/settings/local.py,migrations,wsgi.py
exclude = venv/*,.tox/*,admissions/settings/local.py,migrations,wsgi.py
ignore = E203, E266, E501, W503, F403, F405, F401, C901
max-line-length = 79
max-complexity = 18
Expand Down
Loading

0 comments on commit b93ce70

Please sign in to comment.