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

first commit #3

Open
wants to merge 2 commits into
base: main
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
File renamed without changes.
Binary file added COPS_Django/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added COPS_Django/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file added COPS_Django/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added COPS_Django/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
47 changes: 23 additions & 24 deletions library/settings.py → COPS_Django/settings.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
"""
Django settings for library project.
Django settings for COPS_Django project.

Generated by 'django-admin startproject' using Django 2.1.5.
Generated by 'django-admin startproject' using Django 2.2.12.

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

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

import django_heroku
from pathlib import Path
import os
from re import S

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '==e^87*tib$+f)9$46#-jc&toydks5v^g5ym7wq^shf5(hno3&'
SECRET_KEY = 'secretkey'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand All @@ -38,8 +38,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'store',
'authentication',
'catalog.apps.CatalogConfig' ,
]

MIDDLEWARE = [
Expand All @@ -52,12 +51,12 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'library.urls'
ROOT_URLCONF = 'COPS_Django.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR,'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand All @@ -70,11 +69,11 @@
},
]

WSGI_APPLICATION = 'library.wsgi.application'
WSGI_APPLICATION = 'COPS_Django.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES = {
'default': {
Expand All @@ -85,7 +84,7 @@


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

AUTH_PASSWORD_VALIDATORS = [
{
Expand All @@ -104,7 +103,7 @@


# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/
# https://docs.djangoproject.com/en/2.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

Expand All @@ -118,12 +117,12 @@


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

STATIC_URL = '/static/'
STATIC_ROOT=os.path.join(BASE_DIR,'staticfiles/')
LOGIN_REDIRECT_URL='/'
LOGOUT_REDIRECT_URL = '/'
# https://docs.djangoproject.com/en/2.2/howto/static-files/

# Activate Django-Heroku.
django_heroku.settings(locals())
STATIC_URL = 'static/'
STATIC_ROOT=os.path.join(BASE_DIR,'STATIC')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'COPS_Django/static'),
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
LOGIN_REDIRECT_URL='/'
7 changes: 7 additions & 0 deletions COPS_Django/static/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#header{
background-color: rgb(2, 2, 2) !important;
color: rgb(13, 14, 13) !important;
}
.module caption{
background-color: rgb(27, 8, 95) !important;
}
6 changes: 6 additions & 0 deletions COPS_Django/static/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.sidebar-nav {
margin-top: 20px;
padding: 0;
list-style: none;
}
17 changes: 10 additions & 7 deletions library/urls.py → COPS_Django/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""library URL Configuration
"""COPS_Django URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
Expand All @@ -13,13 +13,16 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from xml.dom.minidom import Document
from django.contrib import admin
from django.urls import path,include
from django.conf.urls.static import static
from django.urls import path
from django.urls import include
from django.views.generic import RedirectView
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
path('',include('store.urls')),
path('admin/', admin.site.urls),
path('accounts/',include('django.contrib.auth.urls')),
]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
path('catalog/',include('catalog.urls')),
path('',RedirectView.as_view(url='catalog/',permanent=True)),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
6 changes: 3 additions & 3 deletions library/wsgi.py → COPS_Django/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""
WSGI config for library project.
WSGI config for COPS_Django project.

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

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

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'library.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'COPS_Django.settings')

application = get_wsgi_application()
15 changes: 5 additions & 10 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
url = "https://pypi.python.org/simple"
verify_ssl = true

[dev-packages]
name = "pypi"

[packages]
certifi = "==2019.3.9"
pytz = "==2019.1"
sqlparse = "==0.3.0"
Django = "==2.2.1"
gunicorn = "*"
django-heroku = "*"
django = "*"

[dev-packages]

[requires]
python_version = "3.8"
98 changes: 31 additions & 67 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

3 changes: 0 additions & 3 deletions authentication/admin.py

This file was deleted.

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

This file was deleted.

3 changes: 0 additions & 3 deletions authentication/models.py

This file was deleted.

Empty file removed authentication/urls.py
Empty file.
13 changes: 0 additions & 13 deletions authentication/views.py

This file was deleted.

File renamed without changes.
Binary file added catalog/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added catalog/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added catalog/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file added catalog/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added catalog/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added catalog/__pycache__/views.cpython-38.pyc
Binary file not shown.
Loading