Ведется разработка скелета

This commit is contained in:
Dhaverd 2022-12-11 22:20:42 +08:00
parent 3ea9659f0b
commit 5ad964a082
26 changed files with 42 additions and 17 deletions

View File

@ -1,6 +0,0 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index')
]

View File

@ -1,4 +0,0 @@
from django.http import HttpResponse
def index(request):
return HttpResponse('<h1>Hello world!</h1>')

View File

@ -11,18 +11,16 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
"""
from pathlib import Path
import os, sys
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'apps'))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-&35w=2x@*pa4ck7jq9)38f-a*=tz=w(fu*=&z3u3mxy@q%eo@r'
SECRET_KEY = 'django-insecure-e5_t(3qi0zd$42t*akukbr5^*@#znl-x-xxej94!*!!9g%0nwj'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
@ -33,6 +31,7 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'main',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@ -77,6 +76,14 @@ WSGI_APPLICATION = 'djangosite.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django',
'USER': 'dhaverd',
'PASSWORD': 'Dha.Verd506763',
'HOST': '192.168.0.105',
'PORT': 3306,
},
'workout': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'workout',
'USER': 'dhaverd',

View File

@ -17,6 +17,6 @@ from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('articles/', include('articles.urls')),
path('admin/', admin.site.urls),
path('', include('main.urls'))
]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
from django.apps import AppConfig
class ArticlesConfig(AppConfig):
class MainConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'articles'
name = 'main'

Binary file not shown.

9
main/urls.py Normal file
View File

@ -0,0 +1,9 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('servers', views.servers),
path('mychat', views.mychat),
path('workout', views.workout)
]

19
main/views.py Normal file
View File

@ -0,0 +1,19 @@
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse('<a href="localhost:8000/servers/">Сервера</a>')
def servers(request):
return HttpResponse('server list')
def mychat(request):
return HttpResponse('mychat info')
def workout(request):
return HttpResponse('workout task list')