generated from 2martens/django-template
Renamed app and Django template
This commit is contained in:
parent
85d5f0b123
commit
06cd1e4291
|
@ -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…
Reference in New Issue