Skip to content

Commit

Permalink
🚧 change the project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
idealclover committed Sep 27, 2018
1 parent 2d1552e commit 2bd31b0
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 150 deletions.
6 changes: 5 additions & 1 deletion goldennum/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# from django.contrib import admin
from django.contrib import admin
from .models import Room, User

# Register your models here.

admin.site.register(Room)
admin.site.register(User)
File renamed without changes.
18 changes: 8 additions & 10 deletions midware/settings.py → index/settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Django settings for midware project.
Django settings for index project.
Generated by 'django-admin startproject' using Django 2.1.
Generated by 'django-admin startproject' using Django 2.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
Expand All @@ -12,8 +12,6 @@

import os

import secretkey

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

Expand All @@ -22,12 +20,12 @@
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = secretkey.secretKey
SECRET_KEY = '09$9#a%zrp+9konr-pu@to(^^yi4pg9%o!elt+301$68mb(p^m'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True

ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS = []


# Application definition
Expand All @@ -47,13 +45,13 @@
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'midware.urls'
ROOT_URLCONF = 'index.urls'

TEMPLATES = [
{
Expand All @@ -71,7 +69,7 @@
},
]

WSGI_APPLICATION = 'midware.wsgi.application'
WSGI_APPLICATION = 'index.wsgi.application'


# Database
Expand Down
2 changes: 1 addition & 1 deletion midware/urls.py → index/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""midware URL Configuration
"""goldennum URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Expand Down
1 change: 1 addition & 0 deletions midware/views.py → index/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.http import HttpResponse
from django.http import HttpResponseRedirect

def index(request):
return HttpResponse("index")

Expand Down
4 changes: 2 additions & 2 deletions midware/wsgi.py → index/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
WSGI config for midware project.
WSGI config for index project.
It exposes the WSGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'midware.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'index.settings')

application = get_wsgi_application()
4 changes: 1 addition & 3 deletions 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', 'midware.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'index.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand All @@ -13,5 +13,3 @@
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)

# force_refresh: python3 manage.py migrate --run-syncdb
133 changes: 0 additions & 133 deletions plug-ins/goldennum_0.py

This file was deleted.

0 comments on commit 2bd31b0

Please sign in to comment.