From 06cd1e4291a970456ea3266f711125aeb1e5798f Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 19 Feb 2020 10:55:46 +0100 Subject: [PATCH] Renamed app and Django template --- README.md | 4 ++-- app/__init__.py | 2 -- app/apps.py | 7 ------ food_planner/__init__.py | 2 ++ {app => food_planner}/account_urls.py | 4 ++-- {app => food_planner}/admin.py | 5 ++-- food_planner/apps.py | 7 ++++++ {app => food_planner}/forms.py | 2 +- {app => food_planner}/migrations/__init__.py | 0 {app => food_planner}/models.py | 0 .../templates/food_planner}/.gitkeep | 0 .../templates/food_planner}/base.html | 0 .../templates/food_planner}/home.html | 2 +- .../templates/food_planner}/landing.html | 2 +- .../templates/food_planner}/legal.html | 2 +- .../templates/food_planner}/privacy.html | 2 +- .../templates/registration/edit_profile.html | 2 +- .../templates/registration/login.html | 2 +- .../registration/password_change_form.html | 2 +- .../registration/password_reset_complete.html | 2 +- .../registration/password_reset_confirm.html | 2 +- .../registration/password_reset_done.html | 2 +- .../registration/password_reset_form.html | 2 +- .../templates/registration/register.html | 2 +- {app => food_planner}/tests.py | 0 {app => food_planner}/translation.py | 0 {app => food_planner}/urls.py | 0 {app => food_planner}/views.py | 24 +++++++++---------- package.json | 2 +- project/settings.py | 2 +- project/urls.py | 6 ++--- 31 files changed, 46 insertions(+), 45 deletions(-) delete mode 100644 app/__init__.py delete mode 100644 app/apps.py create mode 100644 food_planner/__init__.py rename {app => food_planner}/account_urls.py (94%) rename {app => food_planner}/admin.py (90%) create mode 100644 food_planner/apps.py rename {app => food_planner}/forms.py (97%) rename {app => food_planner}/migrations/__init__.py (100%) rename {app => food_planner}/models.py (100%) rename {app/templates/app => food_planner/templates/food_planner}/.gitkeep (100%) rename {app/templates/app => food_planner/templates/food_planner}/base.html (100%) rename {app/templates/app => food_planner/templates/food_planner}/home.html (79%) rename {app/templates/app => food_planner/templates/food_planner}/landing.html (94%) rename {app/templates/app => food_planner/templates/food_planner}/legal.html (98%) rename {app/templates/app => food_planner/templates/food_planner}/privacy.html (99%) rename {app => food_planner}/templates/registration/edit_profile.html (91%) rename {app => food_planner}/templates/registration/login.html (92%) rename {app => food_planner}/templates/registration/password_change_form.html (89%) rename {app => food_planner}/templates/registration/password_reset_complete.html (89%) rename {app => food_planner}/templates/registration/password_reset_confirm.html (94%) rename {app => food_planner}/templates/registration/password_reset_done.html (92%) rename {app => food_planner}/templates/registration/password_reset_form.html (93%) rename {app => food_planner}/templates/registration/register.html (91%) rename {app => food_planner}/tests.py (100%) rename {app => food_planner}/translation.py (100%) rename {app => food_planner}/urls.py (100%) rename {app => food_planner}/views.py (83%) diff --git a/README.md b/README.md index dd87d4d..29d2834 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Django template +# Food planner Template repository for Django applications ## ToDos - change ``app``into something more appropriate wherever you find it -- change ``Django template`` and ``DjangoTemplate`` into something more appropriate wherever you find it +- change ``Food planner`` and ``DjangoTemplate`` into something more appropriate wherever you find it diff --git a/app/__init__.py b/app/__init__.py deleted file mode 100644 index 0153b12..0000000 --- a/app/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# coding=utf-8 -default_app_config = 'chaos_dating.apps.ChaosDatingConfig' diff --git a/app/apps.py b/app/apps.py deleted file mode 100644 index f08a8a0..0000000 --- a/app/apps.py +++ /dev/null @@ -1,7 +0,0 @@ -# coding=utf-8 -from django.apps import AppConfig - - -class DjangoTemplateConfig(AppConfig): - name = 'app' - verbose_name = 'Django template app' diff --git a/food_planner/__init__.py b/food_planner/__init__.py new file mode 100644 index 0000000..04185c2 --- /dev/null +++ b/food_planner/__init__.py @@ -0,0 +1,2 @@ +# coding=utf-8 +default_app_config = 'food_planner.apps.FoodPlannerConfig' diff --git a/app/account_urls.py b/food_planner/account_urls.py similarity index 94% rename from app/account_urls.py rename to food_planner/account_urls.py index 13d7f24..10b56ea 100644 --- a/app/account_urls.py +++ b/food_planner/account_urls.py @@ -2,11 +2,11 @@ from django.contrib.auth import views as auth_views from django.urls import path -from chaos_dating import views as chaos_views +from food_planner import views as chaos_views extra_context = { 'site': { - 'title': 'Django template' + 'title': 'Food planner' }, } diff --git a/app/admin.py b/food_planner/admin.py similarity index 90% rename from app/admin.py rename to food_planner/admin.py index 34dfc12..cdb1ade 100644 --- a/app/admin.py +++ b/food_planner/admin.py @@ -1,8 +1,9 @@ # coding=utf-8 from django.contrib import admin -from django.contrib.auth.models import User from django.contrib.auth.admin import UserAdmin -from app.models import Profile +from django.contrib.auth.models import User + +from food_planner.models import Profile # Register your models here. admin.site.unregister(User) diff --git a/food_planner/apps.py b/food_planner/apps.py new file mode 100644 index 0000000..14371e1 --- /dev/null +++ b/food_planner/apps.py @@ -0,0 +1,7 @@ +# coding=utf-8 +from django.apps import AppConfig + + +class FoodPlannerConfig(AppConfig): + name = 'food_planner' + verbose_name = 'Food planner app' diff --git a/app/forms.py b/food_planner/forms.py similarity index 97% rename from app/forms.py rename to food_planner/forms.py index 5ffca20..999de37 100644 --- a/app/forms.py +++ b/food_planner/forms.py @@ -7,7 +7,7 @@ from django.contrib.auth.forms import UsernameField from django.contrib.auth.models import User from django.urls import reverse -from app.models import Profile +from food_planner.models import Profile class UserForm(forms.ModelForm): diff --git a/app/migrations/__init__.py b/food_planner/migrations/__init__.py similarity index 100% rename from app/migrations/__init__.py rename to food_planner/migrations/__init__.py diff --git a/app/models.py b/food_planner/models.py similarity index 100% rename from app/models.py rename to food_planner/models.py diff --git a/app/templates/app/.gitkeep b/food_planner/templates/food_planner/.gitkeep similarity index 100% rename from app/templates/app/.gitkeep rename to food_planner/templates/food_planner/.gitkeep diff --git a/app/templates/app/base.html b/food_planner/templates/food_planner/base.html similarity index 100% rename from app/templates/app/base.html rename to food_planner/templates/food_planner/base.html diff --git a/app/templates/app/home.html b/food_planner/templates/food_planner/home.html similarity index 79% rename from app/templates/app/home.html rename to food_planner/templates/food_planner/home.html index e2aaef1..b10c426 100644 --- a/app/templates/app/home.html +++ b/food_planner/templates/food_planner/home.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% block title %}{{ site.title }} - {% trans "Home" %}{% endblock %} diff --git a/app/templates/app/landing.html b/food_planner/templates/food_planner/landing.html similarity index 94% rename from app/templates/app/landing.html rename to food_planner/templates/food_planner/landing.html index fc5cd64..9a160b1 100644 --- a/app/templates/app/landing.html +++ b/food_planner/templates/food_planner/landing.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% block title %}{{ site.title }}{% endblock %} diff --git a/app/templates/app/legal.html b/food_planner/templates/food_planner/legal.html similarity index 98% rename from app/templates/app/legal.html rename to food_planner/templates/food_planner/legal.html index e56aaf3..7888228 100644 --- a/app/templates/app/legal.html +++ b/food_planner/templates/food_planner/legal.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% block title %}{{ site.title }} - {% trans "Legal Notice" %}{% endblock %} diff --git a/app/templates/app/privacy.html b/food_planner/templates/food_planner/privacy.html similarity index 99% rename from app/templates/app/privacy.html rename to food_planner/templates/food_planner/privacy.html index 4a47151..fb0777a 100644 --- a/app/templates/app/privacy.html +++ b/food_planner/templates/food_planner/privacy.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% block title %}{{ site.title }} - {% trans "Privacy Policy" %}{% endblock %} diff --git a/app/templates/registration/edit_profile.html b/food_planner/templates/registration/edit_profile.html similarity index 91% rename from app/templates/registration/edit_profile.html rename to food_planner/templates/registration/edit_profile.html index c388819..ceb6aca 100644 --- a/app/templates/registration/edit_profile.html +++ b/food_planner/templates/registration/edit_profile.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/templates/registration/login.html b/food_planner/templates/registration/login.html similarity index 92% rename from app/templates/registration/login.html rename to food_planner/templates/registration/login.html index 0e42954..5a947b9 100644 --- a/app/templates/registration/login.html +++ b/food_planner/templates/registration/login.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/templates/registration/password_change_form.html b/food_planner/templates/registration/password_change_form.html similarity index 89% rename from app/templates/registration/password_change_form.html rename to food_planner/templates/registration/password_change_form.html index f0299ff..04aecaf 100644 --- a/app/templates/registration/password_change_form.html +++ b/food_planner/templates/registration/password_change_form.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/templates/registration/password_reset_complete.html b/food_planner/templates/registration/password_reset_complete.html similarity index 89% rename from app/templates/registration/password_reset_complete.html rename to food_planner/templates/registration/password_reset_complete.html index 48b52f6..94847f5 100644 --- a/app/templates/registration/password_reset_complete.html +++ b/food_planner/templates/registration/password_reset_complete.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/templates/registration/password_reset_confirm.html b/food_planner/templates/registration/password_reset_confirm.html similarity index 94% rename from app/templates/registration/password_reset_confirm.html rename to food_planner/templates/registration/password_reset_confirm.html index cbee89e..6772291 100644 --- a/app/templates/registration/password_reset_confirm.html +++ b/food_planner/templates/registration/password_reset_confirm.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/templates/registration/password_reset_done.html b/food_planner/templates/registration/password_reset_done.html similarity index 92% rename from app/templates/registration/password_reset_done.html rename to food_planner/templates/registration/password_reset_done.html index 06ed6fe..89f0e64 100644 --- a/app/templates/registration/password_reset_done.html +++ b/food_planner/templates/registration/password_reset_done.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/templates/registration/password_reset_form.html b/food_planner/templates/registration/password_reset_form.html similarity index 93% rename from app/templates/registration/password_reset_form.html rename to food_planner/templates/registration/password_reset_form.html index 9285a54..f46f0eb 100644 --- a/app/templates/registration/password_reset_form.html +++ b/food_planner/templates/registration/password_reset_form.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/templates/registration/register.html b/food_planner/templates/registration/register.html similarity index 91% rename from app/templates/registration/register.html rename to food_planner/templates/registration/register.html index a4449d0..bfbab50 100644 --- a/app/templates/registration/register.html +++ b/food_planner/templates/registration/register.html @@ -1,4 +1,4 @@ -{% extends "app/base.html" %} +{% extends "food_planner/base.html" %} {% load i18n %} {% load crispy_forms_tags %} diff --git a/app/tests.py b/food_planner/tests.py similarity index 100% rename from app/tests.py rename to food_planner/tests.py diff --git a/app/translation.py b/food_planner/translation.py similarity index 100% rename from app/translation.py rename to food_planner/translation.py diff --git a/app/urls.py b/food_planner/urls.py similarity index 100% rename from app/urls.py rename to food_planner/urls.py diff --git a/app/views.py b/food_planner/views.py similarity index 83% rename from app/views.py rename to food_planner/views.py index 011dd96..2d58b77 100644 --- a/app/views.py +++ b/food_planner/views.py @@ -12,20 +12,20 @@ from django.shortcuts import redirect from django.shortcuts import render from django.urls import reverse -from app.forms import ProfileForm -from app.forms import UserForm +from food_planner.forms import ProfileForm +from food_planner.forms import UserForm def index(request) -> HttpResponse: context = { 'site': { - 'title': 'Django template' + 'title': 'Food planner' } } if request.user.is_authenticated: - return render(request, template_name='app/home.html', context=context) + return render(request, template_name='food_planner/home.html', context=context) else: - return render(request, template_name='app/landing.html', context=context) + return render(request, template_name='food_planner/landing.html', context=context) @transaction.atomic @@ -37,7 +37,7 @@ def register(request) -> HttpResponse: profile_form = ProfileForm(data=request.POST or None, files=request.FILES or None) context = { 'site': { - 'title': 'Django template' + 'title': 'Food planner' }, 'user_form': user_form, 'profile_form': profile_form @@ -64,7 +64,7 @@ def user_login(request) -> HttpResponse: 'active': 'login', 'title': _('Login'), 'site': { - 'title': 'Django template' + 'title': 'Food planner' }, } return login_view.dispatch(request) @@ -81,7 +81,7 @@ def edit_profile(request) -> HttpResponse: 'active': 'edit_profile', 'title': _('Edit User Profile'), 'site': { - 'title': 'Django template' + 'title': 'Food planner' }, 'user_form': user_form, 'profile_form': profile_form @@ -107,16 +107,16 @@ def password_change_done(request) -> HttpResponse: def legal(request) -> HttpResponse: context = { 'site': { - 'title': 'Django template' + 'title': 'Food planner' } } - return render(request, template_name='app/legal.html', context=context) + return render(request, template_name='food_planner/legal.html', context=context) def privacy(request) -> HttpResponse: context = { 'site': { - 'title': 'Django template' + 'title': 'Food planner' } } - return render(request, template_name='app/privacy.html', context=context) + return render(request, template_name='food_planner/privacy.html', context=context) diff --git a/package.json b/package.json index 7d4e652..93ea7f7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "django-template", "version": "1.0.0", - "description": "Django template", + "description": "Food planner", "main": "index.js", "dependencies": { "bootstrap": "^4.4.1", diff --git a/project/settings.py b/project/settings.py index dc2a005..7bab976 100644 --- a/project/settings.py +++ b/project/settings.py @@ -35,7 +35,7 @@ ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]'] # Application definition INSTALLED_APPS = [ - 'app.apps.DjangoTemplateConfig', # TODO: change to your app config class + 'food_planner.apps.FoodPlannerConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/project/urls.py b/project/urls.py index 69ce79b..23c40de 100644 --- a/project/urls.py +++ b/project/urls.py @@ -17,11 +17,11 @@ Including another URLconf from django.contrib import admin from django.urls import include from django.urls import path -from app import views +from food_planner import views urlpatterns = [ path('admin/', admin.site.urls), - path('app/', include('app.urls')), - path('accounts/', include('app.account_urls')), + path('app/', include('food_planner.urls')), + path('accounts/', include('food_planner.account_urls')), path('', views.index) ]