mirror of
				https://github.com/cookiecutter/cookiecutter-django.git
				synced 2025-10-31 16:07:49 +03:00 
			
		
		
		
	Switch to local imports within app (#4883)
This commit is contained in:
		
							parent
							
								
									916f666637
								
							
						
					
					
						commit
						4db3ea1e58
					
				|  | @ -4,9 +4,9 @@ from django.contrib.auth import admin as auth_admin | ||||||
| from django.contrib.auth.decorators import login_required | from django.contrib.auth.decorators import login_required | ||||||
| from django.utils.translation import gettext_lazy as _ | from django.utils.translation import gettext_lazy as _ | ||||||
| 
 | 
 | ||||||
| from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm | from .forms import UserAdminChangeForm | ||||||
| from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm | from .forms import UserAdminCreationForm | ||||||
| from {{ cookiecutter.project_slug }}.users.models import User | from .models import User | ||||||
| 
 | 
 | ||||||
| if settings.DJANGO_ADMIN_FORCE_ALLAUTH: | if settings.DJANGO_ADMIN_FORCE_ALLAUTH: | ||||||
|     # Force the `admin` sign in process to go through the `django-allauth` workflow: |     # Force the `admin` sign in process to go through the `django-allauth` workflow: | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ from django.forms import EmailField | ||||||
| {%- endif %} | {%- endif %} | ||||||
| from django.utils.translation import gettext_lazy as _ | from django.utils.translation import gettext_lazy as _ | ||||||
| 
 | 
 | ||||||
| from {{ cookiecutter.project_slug }}.users.models import User | from .models import User | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class UserAdminChangeForm(admin_forms.UserChangeForm): | class UserAdminChangeForm(admin_forms.UserChangeForm): | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ from django.contrib.auth.hashers import make_password | ||||||
| from django.contrib.auth.models import UserManager as DjangoUserManager | from django.contrib.auth.models import UserManager as DjangoUserManager | ||||||
| 
 | 
 | ||||||
| if TYPE_CHECKING: | if TYPE_CHECKING: | ||||||
|     from {{ cookiecutter.project_slug }}.users.models import User  # noqa: F401 |     from .models import User  # noqa: F401 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class UserManager(DjangoUserManager["User"]): | class UserManager(DjangoUserManager["User"]): | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ from django.urls import reverse | ||||||
| from django.utils.translation import gettext_lazy as _ | from django.utils.translation import gettext_lazy as _ | ||||||
| {%- if cookiecutter.username_type == "email" %} | {%- if cookiecutter.username_type == "email" %} | ||||||
| 
 | 
 | ||||||
| from {{ cookiecutter.project_slug }}.users.managers import UserManager | from .managers import UserManager | ||||||
| {%- endif %} | {%- endif %} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| from celery import shared_task | from celery import shared_task | ||||||
| 
 | 
 | ||||||
| from {{ cookiecutter.project_slug }}.users.models import User | from .models import User | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @shared_task() | @shared_task() | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| from django.urls import path | from django.urls import path | ||||||
| 
 | 
 | ||||||
| from {{ cookiecutter.project_slug }}.users.views import user_detail_view | from .views import user_detail_view | ||||||
| from {{ cookiecutter.project_slug }}.users.views import user_redirect_view | from .views import user_redirect_view | ||||||
| from {{ cookiecutter.project_slug }}.users.views import user_update_view | from .views import user_update_view | ||||||
| 
 | 
 | ||||||
| app_name = "users" | app_name = "users" | ||||||
| urlpatterns = [ | urlpatterns = [ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user