Renamed app and Django template

master
Jim Martens 3 years ago
parent 85d5f0b123
commit 06cd1e4291
  1. 4
      README.md
  2. 2
      app/__init__.py
  3. 7
      app/apps.py
  4. 2
      food_planner/__init__.py
  5. 4
      food_planner/account_urls.py
  6. 5
      food_planner/admin.py
  7. 7
      food_planner/apps.py
  8. 2
      food_planner/forms.py
  9. 0
      food_planner/migrations/__init__.py
  10. 0
      food_planner/models.py
  11. 0
      food_planner/templates/food_planner/.gitkeep
  12. 0
      food_planner/templates/food_planner/base.html
  13. 2
      food_planner/templates/food_planner/home.html
  14. 2
      food_planner/templates/food_planner/landing.html
  15. 2
      food_planner/templates/food_planner/legal.html
  16. 2
      food_planner/templates/food_planner/privacy.html
  17. 2
      food_planner/templates/registration/edit_profile.html
  18. 2
      food_planner/templates/registration/login.html
  19. 2
      food_planner/templates/registration/password_change_form.html
  20. 2
      food_planner/templates/registration/password_reset_complete.html
  21. 2
      food_planner/templates/registration/password_reset_confirm.html
  22. 2
      food_planner/templates/registration/password_reset_done.html
  23. 2
      food_planner/templates/registration/password_reset_form.html
  24. 2
      food_planner/templates/registration/register.html
  25. 0
      food_planner/tests.py
  26. 0
      food_planner/translation.py
  27. 0
      food_planner/urls.py
  28. 24
      food_planner/views.py
  29. 2
      package.json
  30. 2
      project/settings.py
  31. 6
      project/urls.py

@ -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

@ -1,2 +0,0 @@
# coding=utf-8
default_app_config = 'chaos_dating.apps.ChaosDatingConfig'

@ -1,7 +0,0 @@
# coding=utf-8
from django.apps import AppConfig
class DjangoTemplateConfig(AppConfig):
name = 'app'
verbose_name = 'Django template app'

@ -0,0 +1,2 @@
# coding=utf-8
default_app_config = 'food_planner.apps.FoodPlannerConfig'

@ -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'
},
}

@ -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)

@ -0,0 +1,7 @@
# coding=utf-8
from django.apps import AppConfig
class FoodPlannerConfig(AppConfig):
name = 'food_planner'
verbose_name = 'Food planner app'

@ -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):

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% block title %}{{ site.title }} - {% trans "Home" %}{% endblock %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% block title %}{{ site.title }}{% endblock %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% block title %}{{ site.title }} - {% trans "Legal Notice" %}{% endblock %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% block title %}{{ site.title }} - {% trans "Privacy Policy" %}{% endblock %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -1,4 +1,4 @@
{% extends "app/base.html" %}
{% extends "food_planner/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

@ -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)

@ -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",

@ -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',

@ -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)
]

Loading…
Cancel
Save