acolyte-py 2 anos atrás
pai
commit
2fb6aba18f
13 arquivos alterados com 38 adições e 1 exclusões
  1. 1 0
      .gitignore
  2. 2 0
      core/settings.py
  3. 2 1
      core/urls.py
  4. BIN
      db.sqlite3
  5. 0 0
      main/__init__.py
  6. 3 0
      main/admin.py
  7. 6 0
      main/apps.py
  8. 0 0
      main/migrations/__init__.py
  9. 3 0
      main/models.py
  10. 3 0
      main/tests.py
  11. 8 0
      main/urls.py
  12. 10 0
      main/views.py
  13. BIN
      requirements.txt

+ 1 - 0
.gitignore

@@ -58,3 +58,4 @@ docs/_build/
 # PyBuilder
 target/
 
+.idea/

+ 2 - 0
core/settings.py

@@ -37,6 +37,8 @@ INSTALLED_APPS = [
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+
+    'main',
 ]
 
 MIDDLEWARE = [

+ 2 - 1
core/urls.py

@@ -14,8 +14,9 @@ Including another URLconf
     2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
 """
 from django.contrib import admin
-from django.urls import path
+from django.urls import path, include
 
 urlpatterns = [
     path('admin/', admin.site.urls),
+    path('', include('main.urls')),
 ]

BIN
db.sqlite3


+ 0 - 0
main/__init__.py


+ 3 - 0
main/admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.

+ 6 - 0
main/apps.py

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

+ 0 - 0
main/migrations/__init__.py


+ 3 - 0
main/models.py

@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.

+ 3 - 0
main/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 8 - 0
main/urls.py

@@ -0,0 +1,8 @@
+from django.urls import path
+
+from . import views
+
+urlpatterns = [
+    path('', views.base_good),
+    path('shit', views.base_bad),
+]

+ 10 - 0
main/views.py

@@ -0,0 +1,10 @@
+from django.shortcuts import render
+from django.http import HttpResponse
+
+
+def base_good(request):
+    return HttpResponse("<h1> Base views: Response - 200_OK </h1>")
+
+
+def base_bad(request):
+    return HttpResponse("<h1> Base views: Response - 404_Not_Found<br>Ah shit, here we go again...</h1>")

BIN
requirements.txt