Re: any any help me to solve below error in my django project

2023-08-07 Thread Brian Gitau
change the naming of the urls like for the login from "login" to something
like "login_page"  because you are causing a clash in the views.py code
since you are importing login and your url name is the same rename the
logout too

hope that helps


On Mon, Aug 7, 2023 at 2:40 PM AKHIL KORE  wrote:

> I got the error in my below existings django files. Please solve this
> error and check all below files code.
>
> File "C:\django2pm\myvenv\lib\site-packages\django\urls\resolvers.py",
> line 725, in url_patterns
>   raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e
> django.core.exceptions.ImproperlyConfigured: The included URLconf
> 'registration1.urls' does not appear to have any patterns in it. If you see
> the 'urlpatterns' variable with valid patterns in the file then the issue
> is probably caused by a circular import.
>
> registration1/settings.py
> 
> from pathlib import Path
>
> # Build paths inside the project like this: BASE_DIR / 'subdir'.
> BASE_DIR = Path(__file__).resolve().parent.parent
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY =
> 'django-insecure-bz1vja=h9vcnl_=j!-1*+t(j(fn!qzzx5wgy_nu_f-i5c%t'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = []
>
> # Application definition
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'app1',
> 'crispy_forms',
> 'crispy_bootstrap5',
> 'rest_framework',
> ]
>
> MIDDLEWARE = [
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> ]
>
> ROOT_URLCONF = 'registration1.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': ['templates'],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> WSGI_APPLICATION = 'registration1.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/4.1/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'user_registration',
> 'USER': 'shamiit_database',
> 'PASSWORD': 'shamiit123',
> 'HOST': '183.83.187.12',
> 'PORT': '6013',
> }
> }
>
>
> # Password validation
> #
> https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME':
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.CommonPasswordValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.NumericPasswordValidator',
> },
> ]
>
>
> # Internationalization
> # https://docs.djangoproject.com/en/4.1/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/4.1/howto/static-files/
>
> STATIC_URL = 'static/'
> LOGIN_URL = '/login/'
>
> # Default primary key field type
> # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
>
> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
>
> CRISPY_TEMPLATE_PACK = 'bootstrap5'
> CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap5'
>
> # Add this line at the bottom of the file
> AUTH_USER_MODEL = 'app1.CustomUser'
>
> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
> EMAIL_HOST = 'smtp.gmail.com'  # Change to your email provider's SMTP
> server
> EMAIL_PORT = 587  # Change to your email provider's port
> EMAIL_USE_TLS = True  # Change to True if your email provider requires TLS
> EMAIL_HOST_USER = 'koreakhi...@gmail.com'  # Your email address
> EMAIL_HOST_PASSWORD = 'ngxfvpwoasfumnkc'  # Your email password
>
> from django.utils.translation import gettext_lazy as _
>
> PASSWORD_RESET_SUBJECT = _('Password Reset Request')
> 

any any help me to solve below error in my django project

2023-08-07 Thread AKHIL KORE
I got the error in my below existings django files. Please solve this error
and check all below files code.

File "C:\django2pm\myvenv\lib\site-packages\django\urls\resolvers.py", line
725, in url_patterns
  raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e
django.core.exceptions.ImproperlyConfigured: The included URLconf
'registration1.urls' does not appear to have any patterns in it. If you see
the 'urlpatterns' variable with valid patterns in the file then the issue
is probably caused by a circular import.

registration1/settings.py

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY =
'django-insecure-bz1vja=h9vcnl_=j!-1*+t(j(fn!qzzx5wgy_nu_f-i5c%t'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app1',
'crispy_forms',
'crispy_bootstrap5',
'rest_framework',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'registration1.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'registration1.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'user_registration',
'USER': 'shamiit_database',
'PASSWORD': 'shamiit123',
'HOST': '183.83.187.12',
'PORT': '6013',
}
}


# Password validation
#
https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME':
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = 'static/'
LOGIN_URL = '/login/'

# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

CRISPY_TEMPLATE_PACK = 'bootstrap5'
CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap5'

# Add this line at the bottom of the file
AUTH_USER_MODEL = 'app1.CustomUser'

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'  # Change to your email provider's SMTP server
EMAIL_PORT = 587  # Change to your email provider's port
EMAIL_USE_TLS = True  # Change to True if your email provider requires TLS
EMAIL_HOST_USER = 'koreakhi...@gmail.com'  # Your email address
EMAIL_HOST_PASSWORD = 'ngxfvpwoasfumnkc'  # Your email password

from django.utils.translation import gettext_lazy as _

PASSWORD_RESET_SUBJECT = _('Password Reset Request')
PASSWORD_RESET_EMAIL_BODY = _(
'You have requested a password reset. Follow the link below to reset
your password:\n\n'
'{protocol}://{domain}{url}\n\n'
'If you did not request this reset, please ignore this email.\n'
'Your username, in case you\'ve forgotten: {username}'
)

registration1/urls.py
-
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('app1.urls')),
]

app1/models.py
-
from django.contrib.auth.models import AbstractUser

Re: Error regarding Deployment on Vercel

2023-08-07 Thread krishna soni
how?

On Sunday, 6 August, 2023 at 10:09:37 pm UTC+5:30 Mithilesh Rawani wrote:

> Yes it's easy
>
> On Sun, 6 Aug 2023, 4:36 pm krishna soni,  wrote:
>
>> recently I have deployed a project on vercel  "
>> https://blogstar-web.vercel.app/;
>> giving me error 404 not found can any one tell why this error is coming 
>> ??? I have searched on google regarding this but not found helpful
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9aa321e4-7bbc-436e-b6d4-7ceddbb8515bn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c90befaa-a770-40c1-a02a-275f4e02a417n%40googlegroups.com.