Skip to content
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

02 a unit test #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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 .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
db.sqlite3
critaholic/__pycache__/
*.pyc
.python-version
Empty file removed character/__init__.py
Empty file.
3 changes: 0 additions & 3 deletions character/admin.py

This file was deleted.

5 changes: 0 additions & 5 deletions character/apps.py

This file was deleted.

12 changes: 0 additions & 12 deletions character/models.py

This file was deleted.

42 changes: 0 additions & 42 deletions character/templates/char_home.html

This file was deleted.

Empty file removed character/tests/__init__.py
Empty file.
18 changes: 0 additions & 18 deletions character/tests/test_models.py

This file was deleted.

23 changes: 0 additions & 23 deletions character/tests/test_views.py

This file was deleted.

9 changes: 0 additions & 9 deletions character/urls.py

This file was deleted.

13 changes: 0 additions & 13 deletions character/views.py

This file was deleted.

16 changes: 16 additions & 0 deletions critaholic/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for critaholic project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'critaholic.settings')

application = get_asgi_application()
38 changes: 19 additions & 19 deletions critaholic/settings.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
"""
Django settings for critaholic project.

Generated by 'django-admin startproject' using Django 1.10.
Generated by 'django-admin startproject' using Django 4.2.7.

For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
https://docs.djangoproject.com/en/4.2/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
https://docs.djangoproject.com/en/4.2/ref/settings/
"""

import os
from pathlib import Path

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '0-qurqk+np1qql3@l0)b8!x8c*b&%#vn8u8fk@ht4be4l=@^1o'
SECRET_KEY = 'django-insecure-ecug7#7mn#5m9gj3k3hl8k#9fgn^-#b@-f62ft%ebu5gd+yfe+'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand All @@ -37,8 +37,6 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'initiative',
'character',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -73,18 +71,18 @@


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, '../database/db.sqlite3'),
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
Expand All @@ -103,21 +101,23 @@


# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
# https://docs.djangoproject.com/en/4.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
# https://docs.djangoproject.com/en/4.2/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

STATIC_URL = '/static/'
STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, '../static'))
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
25 changes: 9 additions & 16 deletions critaholic/urls.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
"""critaholic URL Configuration
"""
URL configuration for critaholic project.

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
from initiative import views as init_views

from initiative import urls as init_urls
from character import urls as character_urls

from django.urls import path

urlpatterns = [
#url(r'^admin/', admin.site.urls),
url(r'^$', init_views.home_page, name='home'),
url(r'^init/', include(init_urls)),
url(r'^character/', include(character_urls))
path('admin/', admin.site.urls),
]
4 changes: 2 additions & 2 deletions critaholic/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "critaholic.settings")
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'critaholic.settings')

application = get_wsgi_application()
66 changes: 0 additions & 66 deletions deploy_tools/fabfile.py

This file was deleted.

13 changes: 0 additions & 13 deletions deploy_tools/gunicorn-systemd.template.service

This file was deleted.

Loading