Re: CSS not working

2019-10-10 Thread Jani Tiainen
Hi.

You could try to diagnose issue with findstatic management command:

./manage.py findstatic -v 3 polls/style.css

You should get a list of paths Django tried to look for your static file
(stylesheet) and of course was it found.


pe 11. lokak. 2019 klo 6.19 yasar arafath Kajamydeen 
kirjoitti:

> Hi All,
>
> I just added style sheet in my application but its not working , Please
> try to help me.
>
>
> Setting.py
>
>
>
> import os
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
>
>
> ]
>
> 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 = 'telusko.urls'
>
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR,'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 = 'telusko.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),  # Or path to database 
> file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for localhost. Not used with 
> sqlite3.
> 'PORT': '',
> }
> }
>
>
> # Password validation
> # https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/2.2/howto/static-files/
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [
> os.path.join(BASE_DIR, 'style.css'),
> ]
>
>
>
>
>
> *style.css*
>
>
>
>
> li a {
> color: green;
> }
>
>
>
>
>
>
>
> *index.html*
>
>
> {% load static %}
>
> 
> {% if latest_question_list %}
> 
> {% for question in latest_question_list %}
>   {{ 
> question.question_text }}
> {% endfor %}
> 
> {% else %}
> No polls are available.
> {% endif %}
>
>
>
>
>
> Regards,
>
> Yasar Arafath K
>
> --
> 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/3a71830f-e494-47b0-be2d-6d43e8d7cb27%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 

Re: CSS not working

2019-10-10 Thread yasar arafath Kajamydeen
@Suraj - Please find the polls.xlsx   attachment in conversation . 





On Friday, October 11, 2019 at 12:10:04 PM UTC+8, Suraj Thapa FC wrote:
>
> Send the directory structure of the project
>
> On Fri, 11 Oct, 2019, 9:29 AM yasar arafath Kajamydeen,  > wrote:
>
>> Hi Suraj,
>>
>> As for your suggestion i tried like this  but its not working , Please do 
>> needful.
>>
>>
>>
>> STATIC_URL = '/static/'
>> STATICFILES_DIRS = [
>> os.path.join(BASE_DIR, 'static'),
>> ]
>>
>>
>>
>>
>>
>>
>> Regards,
>> Yasar Arafath K
>>
>>
>>
>>
>>
>>
>> On Friday, October 11, 2019 at 11:18:42 AM UTC+8, yasar arafath 
>> Kajamydeen wrote:
>>>
>>> Hi All,
>>>
>>> I just added style sheet in my application but its not working , Please 
>>> try to help me.
>>>
>>>
>>> Setting.py
>>>
>>>
>>>
>>> import os
>>>
>>> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
>>> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>>>
>>>
>>> # Quick-start development settings - unsuitable for production
>>> # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
>>>
>>> # SECURITY WARNING: keep the secret key used in production secret!
>>> SECRET_KEY = '@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh'
>>>
>>> # SECURITY WARNING: don't run with debug turned on in production!
>>> DEBUG = True
>>>
>>> ALLOWED_HOSTS = []
>>>
>>>
>>> # Application definition
>>>
>>> INSTALLED_APPS = [
>>> 'polls.apps.PollsConfig',
>>> 'django.contrib.admin',
>>> 'django.contrib.auth',
>>> 'django.contrib.contenttypes',
>>> 'django.contrib.sessions',
>>> 'django.contrib.messages',
>>> 'django.contrib.staticfiles',
>>>
>>>
>>> ]
>>>
>>> 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 = 'telusko.urls'
>>>
>>>
>>> TEMPLATES = [
>>> {
>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>> 'DIRS': [os.path.join(BASE_DIR,'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 = 'telusko.wsgi.application'
>>>
>>>
>>> # Database
>>> # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
>>>
>>> DATABASES = {
>>> 'default': {
>>> 'ENGINE': 'django.db.backends.sqlite3',
>>> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),  # Or path to 
>>> database file if using sqlite3.
>>> 'USER': '',  # Not used with sqlite3.
>>> 'PASSWORD': '',  # Not used with sqlite3.
>>> 'HOST': '',  # Set to empty string for localhost. Not used with 
>>> sqlite3.
>>> 'PORT': '',
>>> }
>>> }
>>>
>>>
>>> # Password validation
>>> # 
>>> https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/
>>>
>>> LANGUAGE_CODE = 'en-us'
>>>
>>> TIME_ZONE = 'UTC'
>>>
>>> USE_I18N = True
>>>
>>> USE_L10N = True
>>>
>>> USE_TZ = True
>>>
>>>
>>> # Static files (CSS, JavaScript, Images)
>>> # https://docs.djangoproject.com/en/2.2/howto/static-files/
>>>
>>> STATIC_URL = '/static/'
>>> STATICFILES_DIRS = [
>>> os.path.join(BASE_DIR, 'style.css'),
>>> ]
>>>
>>>
>>>
>>>
>>>
>>> *style.css*
>>>
>>>
>>>
>>>
>>> li a {
>>> color: green;
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *index.html*
>>>
>>>
>>> {% load static %}
>>>
>>> 
>>> {% if latest_question_list %}
>>> 
>>> {% for question in latest_question_list %}
>>>   {{ 
>>> question.question_text }}
>>> {% endfor %}
>>> 
>>> {% else %}
>>> No polls are available.
>>> {% endif %}
>>>
>>>
>>>
>>>
>>>
>>> Regards,
>>>
>>> Yasar Arafath K
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.

Re: CSS not working

2019-10-10 Thread Suraj Thapa FC
Send the directory structure of the project

On Fri, 11 Oct, 2019, 9:29 AM yasar arafath Kajamydeen, 
wrote:

> Hi Suraj,
>
> As for your suggestion i tried like this  but its not working , Please do
> needful.
>
>
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [
> os.path.join(BASE_DIR, 'static'),
> ]
>
>
>
>
>
>
> Regards,
> Yasar Arafath K
>
>
>
>
>
>
> On Friday, October 11, 2019 at 11:18:42 AM UTC+8, yasar arafath Kajamydeen
> wrote:
>>
>> Hi All,
>>
>> I just added style sheet in my application but its not working , Please
>> try to help me.
>>
>>
>> Setting.py
>>
>>
>>
>> import os
>>
>> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
>> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>>
>>
>> # Quick-start development settings - unsuitable for production
>> # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
>>
>> # SECURITY WARNING: keep the secret key used in production secret!
>> SECRET_KEY = '@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh'
>>
>> # SECURITY WARNING: don't run with debug turned on in production!
>> DEBUG = True
>>
>> ALLOWED_HOSTS = []
>>
>>
>> # Application definition
>>
>> INSTALLED_APPS = [
>> 'polls.apps.PollsConfig',
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>>
>>
>> ]
>>
>> 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 = 'telusko.urls'
>>
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> 'DIRS': [os.path.join(BASE_DIR,'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 = 'telusko.wsgi.application'
>>
>>
>> # Database
>> # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),  # Or path to database 
>> file if using sqlite3.
>> 'USER': '',  # Not used with sqlite3.
>> 'PASSWORD': '',  # Not used with sqlite3.
>> 'HOST': '',  # Set to empty string for localhost. Not used with 
>> sqlite3.
>> 'PORT': '',
>> }
>> }
>>
>>
>> # Password validation
>> # 
>> https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/
>>
>> LANGUAGE_CODE = 'en-us'
>>
>> TIME_ZONE = 'UTC'
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> USE_TZ = True
>>
>>
>> # Static files (CSS, JavaScript, Images)
>> # https://docs.djangoproject.com/en/2.2/howto/static-files/
>>
>> STATIC_URL = '/static/'
>> STATICFILES_DIRS = [
>> os.path.join(BASE_DIR, 'style.css'),
>> ]
>>
>>
>>
>>
>>
>> *style.css*
>>
>>
>>
>>
>> li a {
>> color: green;
>> }
>>
>>
>>
>>
>>
>>
>>
>> *index.html*
>>
>>
>> {% load static %}
>>
>> 
>> {% if latest_question_list %}
>> 
>> {% for question in latest_question_list %}
>>   {{ 
>> question.question_text }}
>> {% endfor %}
>> 
>> {% else %}
>> No polls are available.
>> {% endif %}
>>
>>
>>
>>
>>
>> Regards,
>>
>> Yasar Arafath K
>>
>> --
> 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/bb82f38d-8e9d-4ef7-a1b9-ea3726973ff0%40googlegroups.com
> 

Re: CSS not working

2019-10-10 Thread yasar arafath Kajamydeen
Hi Suraj,

As for your suggestion i tried like this  but its not working , Please do 
needful.



STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]






Regards,
Yasar Arafath K






On Friday, October 11, 2019 at 11:18:42 AM UTC+8, yasar arafath Kajamydeen 
wrote:
>
> Hi All,
>
> I just added style sheet in my application but its not working , Please 
> try to help me.
>
>
> Setting.py
>
>
>
> import os
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
>
>
> ]
>
> 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 = 'telusko.urls'
>
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR,'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 = 'telusko.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),  # Or path to database 
> file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for localhost. Not used with 
> sqlite3.
> 'PORT': '',
> }
> }
>
>
> # Password validation
> # https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/2.2/howto/static-files/
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [
> os.path.join(BASE_DIR, 'style.css'),
> ]
>
>
>
>
>
> *style.css*
>
>
>
>
> li a {
> color: green;
> }
>
>
>
>
>
>
>
> *index.html*
>
>
> {% load static %}
>
> 
> {% if latest_question_list %}
> 
> {% for question in latest_question_list %}
>   {{ 
> question.question_text }}
> {% endfor %}
> 
> {% else %}
> No polls are available.
> {% endif %}
>
>
>
>
>
> Regards,
>
> Yasar Arafath K
>
>

-- 
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/bb82f38d-8e9d-4ef7-a1b9-ea3726973ff0%40googlegroups.com.


Re: CSS not working

2019-10-10 Thread yasar arafath Kajamydeen
Hi Mike,

I created separate folder for static, Please find the att (polls.xlsx).


Regards,
Yasar Arafath K


On Friday, October 11, 2019 at 11:18:42 AM UTC+8, yasar arafath Kajamydeen 
wrote:
>
> Hi All,
>
> I just added style sheet in my application but its not working , Please 
> try to help me.
>
>
> Setting.py
>
>
>
> import os
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
>
>
> ]
>
> 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 = 'telusko.urls'
>
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR,'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 = 'telusko.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),  # Or path to database 
> file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for localhost. Not used with 
> sqlite3.
> 'PORT': '',
> }
> }
>
>
> # Password validation
> # https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/2.2/howto/static-files/
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [
> os.path.join(BASE_DIR, 'style.css'),
> ]
>
>
>
>
>
> *style.css*
>
>
>
>
> li a {
> color: green;
> }
>
>
>
>
>
>
>
> *index.html*
>
>
> {% load static %}
>
> 
> {% if latest_question_list %}
> 
> {% for question in latest_question_list %}
>   {{ 
> question.question_text }}
> {% endfor %}
> 
> {% else %}
> No polls are available.
> {% endif %}
>
>
>
>
>
> Regards,
>
> Yasar Arafath K
>
>

-- 
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/fd8a59a9-5145-4f11-9fef-44f3132453e1%40googlegroups.com.


polls.xlsx
Description: MS-Excel 2007 spreadsheet


Re: CSS not working

2019-10-10 Thread Suraj Thapa FC
In your settings.py
At STATICFILES_DIRS you had write basedir, style. Css instead style.css
write "static"

On Fri, 11 Oct, 2019, 8:49 AM yasar arafath Kajamydeen, 
wrote:

> Hi All,
>
> I just added style sheet in my application but its not working , Please
> try to help me.
>
>
> Setting.py
>
>
>
> import os
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
>
>
> ]
>
> 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 = 'telusko.urls'
>
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR,'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 = 'telusko.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),  # Or path to database 
> file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for localhost. Not used with 
> sqlite3.
> 'PORT': '',
> }
> }
>
>
> # Password validation
> # https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/2.2/howto/static-files/
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [
> os.path.join(BASE_DIR, 'style.css'),
> ]
>
>
>
>
>
> *style.css*
>
>
>
>
> li a {
> color: green;
> }
>
>
>
>
>
>
>
> *index.html*
>
>
> {% load static %}
>
> 
> {% if latest_question_list %}
> 
> {% for question in latest_question_list %}
>   {{ 
> question.question_text }}
> {% endfor %}
> 
> {% else %}
> No polls are available.
> {% endif %}
>
>
>
>
>
> Regards,
>
> Yasar Arafath K
>
> --
> 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/3a71830f-e494-47b0-be2d-6d43e8d7cb27%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/CAPjsHcGVNSnj-4oa00jvqy9Py_KgYsFr-hzDaji_f5or0SPL6Q%40mail.gmail.com.


Re: CSS not working

2019-10-10 Thread Mike Dewhirst

On 11/10/2019 2:18 pm, yasar arafath Kajamydeen wrote:

Hi All,

I just added style sheet in my application but its not working , 
Please try to help me.


I think you need to put your stylesheet in a separate directory reserved 
for static files such as css, js etc and perhaps call it polls/static. 
Then you need to run manage.py collectstatic which will copy such static 
files to the directory nominated in settings.STATIC_ROOT from where they 
will be served at settings.STATIC_URL


See: https://docs.djangoproject.com/en/2.2/howto/static-files/




Setting.py


import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...) 
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production # See 
https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # 
SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY ='@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh' # SECURITY 
WARNING: don't run with debug turned on in production! DEBUG =True ALLOWED_HOSTS = []



# Application definition INSTALLED_APPS = [
 'polls.apps.PollsConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',


]

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 ='telusko.urls' TEMPLATES = [
 {
 'BACKEND':'django.template.backends.django.DjangoTemplates',
 'DIRS': [os.path.join(BASE_DIR,'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 ='telusko.wsgi.application' # Database # 
https://docs.djangoproject.com/en/2.2/ref/settings/#databases DATABASES = {

 'default': {
 'ENGINE':'django.db.backends.sqlite3',
 'NAME': os.path.join(BASE_DIR,'db.sqlite3'),# Or path to database file 
if using sqlite3. 'USER':'',# Not used with sqlite3. 'PASSWORD':'',# Not used 
with sqlite3. 'HOST':'',# Set to empty string for localhost. Not used with 
sqlite3. 'PORT':'',
 }
}


# Password validation # 
https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/ LANGUAGE_CODE ='en-us' TIME_ZONE ='UTC' USE_I18N =True USE_L10N =True USE_TZ =True # Static files (CSS, JavaScript, Images) # 
https://docs.djangoproject.com/en/2.2/howto/static-files/ STATIC_URL ='/static/' STATICFILES_DIRS = [

 os.path.join(BASE_DIR,'style.css'),
]
*_style.css_*
li a {
 color: green;
}
*_index.html_*
{% load static %}



{% if latest_question_list %}
 
 {% for question in latest_question_list %}
   {{ question.question_text 
}}
 {% endfor %}
 
{% else %}
 No polls are available.
{% endif %}
Regards,
Yasar Arafath K
--
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/3a71830f-e494-47b0-be2d-6d43e8d7cb27%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/c5c4c973-1f8c-f1c5-5c3c-cab23a7a4e30%40dewhirst.com.au.


CSS not working

2019-10-10 Thread yasar arafath Kajamydeen
Hi All,

I just added style sheet in my application but its not working , Please try 
to help me.


Setting.py



import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '@$k&=42v@e7u26@0+woy#%aopsiv&55jjj$a=x2tr52f_5ipyh'

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

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',


]

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 = 'telusko.urls'


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,'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 = 'telusko.wsgi.application'


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

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),  # Or path to database 
file if using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for localhost. Not used with sqlite3.
'PORT': '',
}
}


# Password validation
# https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


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

STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'style.css'),
]





*style.css*




li a {
color: green;
}







*index.html*


{% load static %}


{% if latest_question_list %}

{% for question in latest_question_list %}
  {{ 
question.question_text }}
{% endfor %}

{% else %}
No polls are available.
{% endif %}





Regards,

Yasar Arafath K

-- 
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/3a71830f-e494-47b0-be2d-6d43e8d7cb27%40googlegroups.com.


Re: FK forms in a Single CreateView

2019-10-10 Thread Suraj Thapa FC
It's the same... Thing
You should read the django official docs


Class myview()
   def post()
  model.objects.create
  model2.objects.create

On Fri, 11 Oct, 2019, 5:00 AM Shazia Nusrat,  wrote:

> I am not trying to use Function based Views. I need to use Generic views.
> Thanks.
> Shazia
>
> On Thursday, October 10, 2019 at 4:13:56 PM UTC-7, Suraj Thapa FC wrote:
>>
>> What do you want to do... With it...
>> Use Create it for creating object..
>>
>>
>> def view() :
>> model.objects.create()
>> model2.objects.create()
>>
>> On Fri, 11 Oct, 2019, 4:33 AM Shazia Nusrat,  wrote:
>>
>>> Again I need to use multiple models in one CreateView. I couldn't make
>>> it work by just importing and using it.
>>> @Suraj can you share an example.
>>>
>>> Regards,
>>>
>>> Shazia
>>>
>>> On Thu, Oct 10, 2019 at 3:27 PM Suraj Thapa FC 
>>> wrote:
>>>
 Just import and use it..

 On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat, 
 wrote:

> ForeignKey.
>
> On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus 
> wrote:
>
>> What is mean FK Shaziya
>>
>> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat, 
>> wrote:
>>
>>> Hi I have a situation to manage multiple models with FK for a single
>>> CreateView.
>>>
>>> Can someone give me a solution for the below.
>>>
>>> class Client(models.Model):
>>>  name = models.CharField(max_length=100)
>>>  email = models.EmailField()
>>>  phone = models.CharField(max_length=100)
>>>  business = models.ForeignKey(Business,
>>> on_delete=models.CASCADE, related_name = 'user_business')
>>> contact = models.ForeignKey(Contact,
>>> on_delete=models.CASCADE,related_name='client_contact')
>>> class Business(models.Model):
>>>   name= models.CharField(max_length=100)
>>>   #some other fields
>>> class Contact(models.Model):
>>>   #some fields
>>>
>>>
>>> class ClientCreateView(CreateView):
>>> # I need help to get related models in create view. Please
>>> advise.
>>>
>>>
>>> Help is much appreciated.
>>>
>>> Regards,
>>> Shazia
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.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...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAPjsHcHf%3Dc4R_ADVn9k%3DJaiLmL-ux2RqOwDMkRfb_9W%3DAqmtew%40mail.gmail.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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAD83tOw64VkK2oFgevxSUuJxVKCN%3D7y4Ke4taGmkS5j63GkqCg%40mail.gmail.com
>>> 

Re: FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
I am not trying to use Function based Views. I need to use Generic views. 
Thanks.
Shazia

On Thursday, October 10, 2019 at 4:13:56 PM UTC-7, Suraj Thapa FC wrote:
>
> What do you want to do... With it...
> Use Create it for creating object..
>
>
> def view() :
> model.objects.create()
> model2.objects.create()
>
> On Fri, 11 Oct, 2019, 4:33 AM Shazia Nusrat,  > wrote:
>
>> Again I need to use multiple models in one CreateView. I couldn't make it 
>> work by just importing and using it. 
>> @Suraj can you share an example.
>>
>> Regards,
>>
>> Shazia
>>
>> On Thu, Oct 10, 2019 at 3:27 PM Suraj Thapa FC > > wrote:
>>
>>> Just import and use it.. 
>>>
>>> On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat, >> > wrote:
>>>
 ForeignKey.

 On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus >>> > wrote:

> What is mean FK Shaziya
>
> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat,  > wrote:
>
>> Hi I have a situation to manage multiple models with FK for a single 
>> CreateView. 
>>
>> Can someone give me a solution for the below.
>>
>> class Client(models.Model):
>>  name = models.CharField(max_length=100)
>>  email = models.EmailField()
>>  phone = models.CharField(max_length=100)
>>  business = models.ForeignKey(Business, on_delete=models.CASCADE, 
>> related_name = 'user_business')
>> contact = models.ForeignKey(Contact, 
>> on_delete=models.CASCADE,related_name='client_contact')
>> class Business(models.Model):
>>   name= models.CharField(max_length=100)
>>   #some other fields
>> class Contact(models.Model):
>>   #some fields
>>
>>
>> class ClientCreateView(CreateView):
>> # I need help to get related models in create view. Please 
>> advise.
>>
>>
>> Help is much appreciated.
>>
>> Regards,
>> Shazia
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.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...@googlegroups.com .
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAPjsHcHf%3Dc4R_ADVn9k%3DJaiLmL-ux2RqOwDMkRfb_9W%3DAqmtew%40mail.gmail.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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAD83tOw64VkK2oFgevxSUuJxVKCN%3D7y4Ke4taGmkS5j63GkqCg%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and 

Re: FK forms in a Single CreateView

2019-10-10 Thread Suraj Thapa FC
What do you want to do... With it...
Use Create it for creating object..


def view() :
model.objects.create()
model2.objects.create()

On Fri, 11 Oct, 2019, 4:33 AM Shazia Nusrat,  wrote:

> Again I need to use multiple models in one CreateView. I couldn't make it
> work by just importing and using it.
> @Suraj can you share an example.
>
> Regards,
>
> Shazia
>
> On Thu, Oct 10, 2019 at 3:27 PM Suraj Thapa FC 
> wrote:
>
>> Just import and use it..
>>
>> On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat, 
>> wrote:
>>
>>> ForeignKey.
>>>
>>> On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus 
>>> wrote:
>>>
 What is mean FK Shaziya

 On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat, 
 wrote:

> Hi I have a situation to manage multiple models with FK for a single
> CreateView.
>
> Can someone give me a solution for the below.
>
> class Client(models.Model):
>  name = models.CharField(max_length=100)
>  email = models.EmailField()
>  phone = models.CharField(max_length=100)
>  business = models.ForeignKey(Business, on_delete=models.CASCADE,
> related_name = 'user_business')
> contact = models.ForeignKey(Contact,
> on_delete=models.CASCADE,related_name='client_contact')
> class Business(models.Model):
>   name= models.CharField(max_length=100)
>   #some other fields
> class Contact(models.Model):
>   #some fields
>
>
> class ClientCreateView(CreateView):
> # I need help to get related models in create view. Please
> advise.
>
>
> Help is much appreciated.
>
> Regards,
> Shazia
>
> --
> 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/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.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/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.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/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.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/CAPjsHcHf%3Dc4R_ADVn9k%3DJaiLmL-ux2RqOwDMkRfb_9W%3DAqmtew%40mail.gmail.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/CAD83tOw64VkK2oFgevxSUuJxVKCN%3D7y4Ke4taGmkS5j63GkqCg%40mail.gmail.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/CAPjsHcGruah3b4maP-v1yF8V_TEF0nsrEhx6kAzk81LErA7wGA%40mail.gmail.com.


Re: FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
Again I need to use multiple models in one CreateView. I couldn't make it
work by just importing and using it.
@Suraj can you share an example.

Regards,

Shazia

On Thu, Oct 10, 2019 at 3:27 PM Suraj Thapa FC 
wrote:

> Just import and use it..
>
> On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat, 
> wrote:
>
>> ForeignKey.
>>
>> On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus 
>> wrote:
>>
>>> What is mean FK Shaziya
>>>
>>> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat, 
>>> wrote:
>>>
 Hi I have a situation to manage multiple models with FK for a single
 CreateView.

 Can someone give me a solution for the below.

 class Client(models.Model):
  name = models.CharField(max_length=100)
  email = models.EmailField()
  phone = models.CharField(max_length=100)
  business = models.ForeignKey(Business, on_delete=models.CASCADE,
 related_name = 'user_business')
 contact = models.ForeignKey(Contact,
 on_delete=models.CASCADE,related_name='client_contact')
 class Business(models.Model):
   name= models.CharField(max_length=100)
   #some other fields
 class Contact(models.Model):
   #some fields


 class ClientCreateView(CreateView):
 # I need help to get related models in create view. Please
 advise.


 Help is much appreciated.

 Regards,
 Shazia

 --
 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/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.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/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.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/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.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/CAPjsHcHf%3Dc4R_ADVn9k%3DJaiLmL-ux2RqOwDMkRfb_9W%3DAqmtew%40mail.gmail.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/CAD83tOw64VkK2oFgevxSUuJxVKCN%3D7y4Ke4taGmkS5j63GkqCg%40mail.gmail.com.


Re: FK forms in a Single CreateView

2019-10-10 Thread Suraj Thapa FC
Just import and use it..

On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat,  wrote:

> ForeignKey.
>
> On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus  wrote:
>
>> What is mean FK Shaziya
>>
>> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat, 
>> wrote:
>>
>>> Hi I have a situation to manage multiple models with FK for a single
>>> CreateView.
>>>
>>> Can someone give me a solution for the below.
>>>
>>> class Client(models.Model):
>>>  name = models.CharField(max_length=100)
>>>  email = models.EmailField()
>>>  phone = models.CharField(max_length=100)
>>>  business = models.ForeignKey(Business, on_delete=models.CASCADE,
>>> related_name = 'user_business')
>>> contact = models.ForeignKey(Contact,
>>> on_delete=models.CASCADE,related_name='client_contact')
>>> class Business(models.Model):
>>>   name= models.CharField(max_length=100)
>>>   #some other fields
>>> class Contact(models.Model):
>>>   #some fields
>>>
>>>
>>> class ClientCreateView(CreateView):
>>> # I need help to get related models in create view. Please
>>> advise.
>>>
>>>
>>> Help is much appreciated.
>>>
>>> Regards,
>>> Shazia
>>>
>>> --
>>> 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/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.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/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.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/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.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/CAPjsHcHf%3Dc4R_ADVn9k%3DJaiLmL-ux2RqOwDMkRfb_9W%3DAqmtew%40mail.gmail.com.


Re: How to increase file upload size in twitter in django rest api

2019-10-10 Thread Cornelis Poppema
Are you perhaps looking for 
https://docs.djangoproject.com/en/2.2/ref/settings/#data-upload-max-memory-size
 ?

On Thursday, 10 October 2019 07:04:31 UTC+2, ajitkumar wrote:
>
> Hi, 
>
> can anyone help me how to increase media upload size in django rest api, 
>
>
>
>
> Thanks in advance. 
>
>
>

-- 
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/a087ef9d-0fe5-4565-9597-2bd536030511%40googlegroups.com.


Re: I am new in Django. Getting below errors when i am trying to install psycopg2. Please help me.....

2019-10-10 Thread Peter van der Does
Literally the first search result on google:

https://www.google.com/search?q=psycopg2+ld%3A+library+not+found+for+lssl


Google and Stack Overflow is my workflow.

-- 
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/1feaa14a-0e9a-68f2-409d-09fec904055b%40oneilinteractive.com.


Re: filter search from 2 models

2019-10-10 Thread sotiris moustogiannis
generally, i want to use the 2 models(shops,appointments) in one list view 
in order to find available dates  for booking. I dont know the way to do 
this
On Thursday, October 10, 2019 at 5:36:51 PM UTC+3, lemme smash wrote:
>
> suggestion:
> it's better to post code snippets as text (i.e. use `code` markup)
> about your question: what you mean by "i want to do a combination"? you 
> what to display both filters and both lists on the same page? in that case 
> you want to setup custom view.
>
> On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, sotiris moustogiannis 
> wrote:
>>
>> I want to do dynamic filter search from 2 different models 
>>
>> i have 2 models
>>
>> [image: md1.png]
>>
>> [image: md2.png]
>>
>>
>>
>> i have this filters.py file to find shops and dates
>>
>>
>> [image: fi.png]
>>
>>
>> and this shop listview
>>
>> [image: li.png]
>>
>>
>>
>> i can only show the results of shopfilter and i want to do a combination 
>> of shops and appointments model
>>
>>
>>
>>
>>

-- 
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/79bbb77d-16d3-4c7e-a7d5-3a5aff69d4ec%40googlegroups.com.


Re: FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
ForeignKey.

On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus  wrote:

> What is mean FK Shaziya
>
> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat,  wrote:
>
>> Hi I have a situation to manage multiple models with FK for a single
>> CreateView.
>>
>> Can someone give me a solution for the below.
>>
>> class Client(models.Model):
>>  name = models.CharField(max_length=100)
>>  email = models.EmailField()
>>  phone = models.CharField(max_length=100)
>>  business = models.ForeignKey(Business, on_delete=models.CASCADE,
>> related_name = 'user_business')
>> contact = models.ForeignKey(Contact,
>> on_delete=models.CASCADE,related_name='client_contact')
>> class Business(models.Model):
>>   name= models.CharField(max_length=100)
>>   #some other fields
>> class Contact(models.Model):
>>   #some fields
>>
>>
>> class ClientCreateView(CreateView):
>> # I need help to get related models in create view. Please advise.
>>
>>
>> Help is much appreciated.
>>
>> Regards,
>> Shazia
>>
>> --
>> 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/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.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/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.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/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.com.


Re: Docker

2019-10-10 Thread Nick Sarbicki
Don't use git inside the container, this is not the standard way of doing
things.

Docker has its own guide for using django with compose. This works fine for
a single server setup: https://docs.docker.com/compose/django/

- Nick


On Thu, Oct 10, 2019 at 5:09 PM vineet daniel 
wrote:

> Use git to clone the code within the container to fetch latest copy of
> code.
>
> On Thu, 10 Oct 2019, 20:59 balogun tobi,  wrote:
>
>> How does one deploy an already developed django app using Docker?
>>
>> --
>> 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/da969e88-ccdc-4cac-9a37-6096b3704de1%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/CAJPbAW9mQwb4%2BLOuS0-3c0W0pW3Dt_GQfMhZ%3D_ZBw%2BvnLVxuhA%40mail.gmail.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/CAGuvt903iPdjT%3DNu4iHun%2BkJ-O8EtH-AN7TOmhto7oShqYKsDQ%40mail.gmail.com.


Re: FK forms in a Single CreateView

2019-10-10 Thread Mohammad yunus
What is mean FK Shaziya

On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat,  wrote:

> Hi I have a situation to manage multiple models with FK for a single
> CreateView.
>
> Can someone give me a solution for the below.
>
> class Client(models.Model):
>  name = models.CharField(max_length=100)
>  email = models.EmailField()
>  phone = models.CharField(max_length=100)
>  business = models.ForeignKey(Business, on_delete=models.CASCADE,
> related_name = 'user_business')
> contact = models.ForeignKey(Contact,
> on_delete=models.CASCADE,related_name='client_contact')
> class Business(models.Model):
>   name= models.CharField(max_length=100)
>   #some other fields
> class Contact(models.Model):
>   #some fields
>
>
> class ClientCreateView(CreateView):
> # I need help to get related models in create view. Please advise.
>
>
> Help is much appreciated.
>
> Regards,
> Shazia
>
> --
> 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/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.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/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.com.


Re: Docker

2019-10-10 Thread vineet daniel
Use git to clone the code within the container to fetch latest copy of
code.

On Thu, 10 Oct 2019, 20:59 balogun tobi,  wrote:

> How does one deploy an already developed django app using Docker?
>
> --
> 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/da969e88-ccdc-4cac-9a37-6096b3704de1%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/CAJPbAW9mQwb4%2BLOuS0-3c0W0pW3Dt_GQfMhZ%3D_ZBw%2BvnLVxuhA%40mail.gmail.com.


FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
Hi I have a situation to manage multiple models with FK for a single
CreateView.

Can someone give me a solution for the below.

class Client(models.Model):
 name = models.CharField(max_length=100)
 email = models.EmailField()
 phone = models.CharField(max_length=100)
 business = models.ForeignKey(Business, on_delete=models.CASCADE,
related_name = 'user_business')
contact = models.ForeignKey(Contact,
on_delete=models.CASCADE,related_name='client_contact')
class Business(models.Model):
  name= models.CharField(max_length=100)
  #some other fields
class Contact(models.Model):
  #some fields


class ClientCreateView(CreateView):
# I need help to get related models in create view. Please advise.


Help is much appreciated.

Regards,
Shazia

-- 
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/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.com.


I am new in Django. Getting below errors when i am trying to install psycopg2. Please help me.....

2019-10-10 Thread shailendra singh
ook-Air:ioadigital shailendra$ pip install psycopg2
Collecting psycopg2
  Using cached 
https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
Complete output from command /Users/shailendra/venv/bin/python -u -c 
"import setuptools, 
tokenize;__file__='/private/var/folders/6w/7hpnz4fd22g9vjpb8_9dt6z0gn/T/pip-install-ntzsc_2h/psycopg2/setup.py';f=getattr(tokenize,
 
'open', open)(__file__);code=f.read().replace('\r\n', 
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
/private/var/folders/6w/7hpnz4fd22g9vjpb8_9dt6z0gn/T/pip-record-c2_6wmah/install-record.txt
 
--single-version-externally-managed --compile --install-headers 
/Users/shailendra/venv/include/site/python3.7/psycopg2:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.7
creating build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/_json.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/extras.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/compat.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/errorcodes.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/tz.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/_range.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/_ipaddress.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/_lru_cache.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/__init__.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/extensions.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/errors.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/sql.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
copying lib/pool.py -> build/lib.macosx-10.6-intel-3.7/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.6-intel-3.7
creating build/temp.macosx-10.6-intel-3.7/psycopg
gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG 
-g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt 
dec pq3 ext lo64) -DPG_VERSION_NUM=110005 -DHAVE_LO64=1 
-I/Users/shailendra/venv/include 
-I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. 
-I/usr/local/Cellar/postgresql/11.5_1/include 
-I/usr/local/Cellar/postgresql/11.5_1/include/server -c 
psycopg/psycopgmodule.c -o 
build/temp.macosx-10.6-intel-3.7/psycopg/psycopgmodule.o
gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG 
-g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt 
dec pq3 ext lo64) -DPG_VERSION_NUM=110005 -DHAVE_LO64=1 
-I/Users/shailendra/venv/include 
-I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. 
-I/usr/local/Cellar/postgresql/11.5_1/include 
-I/usr/local/Cellar/postgresql/11.5_1/include/server -c psycopg/green.c -o 
build/temp.macosx-10.6-intel-3.7/psycopg/green.o
gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG 
-g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt 
dec pq3 ext lo64) -DPG_VERSION_NUM=110005 -DHAVE_LO64=1 
-I/Users/shailendra/venv/include 
-I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. 
-I/usr/local/Cellar/postgresql/11.5_1/include 
-I/usr/local/Cellar/postgresql/11.5_1/include/server -c psycopg/pqpath.c -o 
build/temp.macosx-10.6-intel-3.7/psycopg/pqpath.o
psycopg/pqpath.c:135:17: warning: implicit conversion from enumeration 
type 'ConnStatusType' to different enumeration type 'ExecStatusType' 
[-Wenum-conversion]
PQstatus(conn->pgconn) : PQresultStatus(*pgres)));
^~
psycopg/pqpath.c:1817:17: warning: implicit conversion from enumeration 
type 'ConnStatusType' to different enumeration type 'ExecStatusType' 
[-Wenum-conversion]
PQstatus(curs->conn->pgconn) : 
PQresultStatus(curs->pgres)));
^~~~
2 warnings generated.
psycopg/pqpath.c:135:17: warning: implicit conversion from enumeration 
type 'ConnStatusType' to different enumeration type 'ExecStatusType' 
[-Wenum-conversion]
PQstatus(conn->pgconn) : PQresultStatus(*pgres)));
^~
psycopg/pqpath.c:1817:17: warning: implicit conversion from enumeration 
type 'ConnStatusType' to different enumeration type 'ExecStatusType' 
[-Wenum-conversion]
PQstatus(curs->conn->pgconn) : 
PQresultStatus(curs->pgres)));
^~~~
2 warnings generated.
gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG 
-g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 

"http://127.0.0.1:8000/help/" Show me still 'index page' instead of 'help page'

2019-10-10 Thread Parvez Khan Pathan
NB :i'm new to learn django... as well student and stuck in Template Tag 
task (Sorry if i asked silly question).

-- 
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/a17e2a68-64a6-4476-b621-2b010213b76d%40googlegroups.com.


db.sqlite3
Description: Binary data
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proThree.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
from django.contrib import admin

# Register your models here.
from django.apps import AppConfig


class AppthreeConfig(AppConfig):
name = 'appThree'
from django.db import models

# Create your models here.
from django.test import TestCase

# Create your tests here.
from django.urls import path
from appThree import views

urlpatterns = [
path('',views.index,name='index'),
path('',views.help,name='help'),
]
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
myDict = {'heading':"this is heading tag"}
return render(request,'appThree/index.html',context=myDict)

def help(request):
helpDict = {'help':"Help Page"}
return render(request,'appThree/help.html',context=helpDict)
"""
Django settings for proThree project.

Generated by 'django-admin startproject' using Django 2.2.3.

For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR,"templates")

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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '7-3+$cka1hnzkn_6!%bx$qfus68zb%bxp_s@6_d3bmm%ky+'

# 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',
'appThree'
]

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 = 'proThree.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR,],
'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 = 'proThree.wsgi.application'


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

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, 

Docker

2019-10-10 Thread balogun tobi
How does one deploy an already developed django app using Docker?

-- 
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/da969e88-ccdc-4cac-9a37-6096b3704de1%40googlegroups.com.


Re: Anyone used RENDER product for hosting?

2019-10-10 Thread 王智超
Sorry , I dont't know.

Devender Kumar  于2019年10月9日周三 下午1:30写道:

> Digital ocean
>
>
> On Tue 8 Oct, 2019, 3:02 PM ram.mullapudi, 
> wrote:
>
>>
>> Hello,
>>
>> I'm looking for cheaper, secure and reliable way to host my website? The
>> site is being developed on DJango FWK.  We are currently on GCP and also
>> reviewed other popular vendors too. I recently came to know about Render
>> platform and am wondering if anyone tried it?
>>
>> Regards,
>> ~Ram
>>
>> --
>> 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/62fe233b-924d-4257-9ad3-2a14a147ae0d%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/CALZ%3DbE%2B2KLmhzOfvZng3ASj_8WH5V5TDzz3E2Rs0m2tRCCwFww%40mail.gmail.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/CA%2BA7i%3DjxKuKC9MBNpOqT4YA9DdYdbmMbit1%2BcAfrFud41_KAgg%40mail.gmail.com.


Re: Templates rendering problem

2019-10-10 Thread Boris Romero
Hi! Yes, it's reproducing when I run it locally, but with DEBUG=FALSE and 
with nginx and uwsgi. And no, it's not a database encoding problem, it just 
involves the templates, because the same database, with diferents instances 
of the app (with the upload and without it) not make any differences.

Thanks for the ideas!


On Thursday, October 10, 2019 at 11:38:48 AM UTC-3, lemme smash wrote:
>
> so, it's not reproducing when you run it locally?
> also, can you provide an example of string where you have "strange" 
> character? most probably you store it in database.
>
> On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, Boris Romero wrote:
>>
>> Hi! 
>>
>> I recently update Django from 1.11 to 2.2.6 and I have a serious problem 
>> with the templates rendering when i put on production my site (Nginx + 
>> uWSGI + Django). The problem is a lot of '/n' and strangers characters that 
>> appears when I render any page, that obviuosly suggest is a encoding 
>> problem, but I can't find the exact configuration problem. It just happen 
>> when the app is deployed, that is, when DEBUG = False.
>>
>> Any help?
>>
>> Thanks!
>>
>

-- 
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/65b14679-482d-4272-b7a8-c09c4c19e279%40googlegroups.com.


Re: Templates rendering problem

2019-10-10 Thread lemme smash
so, it's not reproducing when you run it locally?
also, can you provide an example of string where you have "strange" 
character? most probably you store it in database.

On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, Boris Romero wrote:
>
> Hi! 
>
> I recently update Django from 1.11 to 2.2.6 and I have a serious problem 
> with the templates rendering when i put on production my site (Nginx + 
> uWSGI + Django). The problem is a lot of '/n' and strangers characters that 
> appears when I render any page, that obviuosly suggest is a encoding 
> problem, but I can't find the exact configuration problem. It just happen 
> when the app is deployed, that is, when DEBUG = False.
>
> Any help?
>
> Thanks!
>

-- 
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/3914c6cc-d7e0-4f9a-a479-176d59b53958%40googlegroups.com.


Re: filter search from 2 models

2019-10-10 Thread lemme smash
suggestion:
it's better to post code snippets as text (i.e. use `code` markup)
about your question: what you mean by "i want to do a combination"? you 
what to display both filters and both lists on the same page? in that case 
you want to setup custom view.

On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, sotiris moustogiannis 
wrote:
>
> I want to do dynamic filter search from 2 different models 
>
> i have 2 models
>
> [image: md1.png]
>
> [image: md2.png]
>
>
>
> i have this filters.py file to find shops and dates
>
>
> [image: fi.png]
>
>
> and this shop listview
>
> [image: li.png]
>
>
>
> i can only show the results of shopfilter and i want to do a combination 
> of shops and appointments model
>
>
>
>
>

-- 
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/e5549cf5-7160-4d77-95de-37609e35c18a%40googlegroups.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Rain
Thanks Alot. its just my  code editor not reading it. appreciate your
Help..!!

On Thu, Oct 10, 2019 at 6:55 PM wd  wrote:

> hi,
>
> I didn't think django template tags are relevant with script or any html
> code. They are totally different things.
> I think it's just your code editor didn't recognize the tags, have you
> tried ignore them and see if django will report an error ?
>
> On Thu, Oct 10, 2019 at 6:22 PM Rain  wrote:
>
>> I want to add an for each method in inside script but for some reason
>> django template tags not working in this case only.
>> can someone please help me ! thanks alot
>>
>>
>>
>>
>> --
>> 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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%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/CABexzmgjJLFD4YTE1jCE22a-SBb%3DdSLJKw0suzSOB86WnSRrgQ%40mail.gmail.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/CAM-q_1fdro7%3D9Mh8ZcWEkmXO3x3t3idGXWUHq8%3DLY%3DRyT0h7PQ%40mail.gmail.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Rain
its totally fine now its just my code editor not reading it thanks for your
help. Appreciated..!!

On Thu, Oct 10, 2019 at 7:04 PM Andréas Kühne 
wrote:

> Hi,
>
> This is completely vaid, as long as you use a render method to render the
> html file. It shouldn't be a problem. How do you include this in your html
> page?
>
> Regards,
>
> Andréas
>
>
> Den tors 10 okt. 2019 kl 12:22 skrev Rain :
>
>> I want to add an for each method in inside script but for some reason
>> django template tags not working in this case only.
>> can someone please help me ! thanks alot
>>
>>
>>
>>
>> --
>> 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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%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/CAK4qSCfg37R-W3rYCH3VX%3DPguXoWE2eJABtJCnhOPzMi1xYCkA%40mail.gmail.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/CAM-q_1dtnkniK1s9X7A%2BnTPPJ9pc4gs8aEieiH6CU%2BH7ch7JsQ%40mail.gmail.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Andréas Kühne
Hi,

This is completely vaid, as long as you use a render method to render the
html file. It shouldn't be a problem. How do you include this in your html
page?

Regards,

Andréas


Den tors 10 okt. 2019 kl 12:22 skrev Rain :

> I want to add an for each method in inside script but for some reason
> django template tags not working in this case only.
> can someone please help me ! thanks alot
>
>
>
>
> --
> 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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%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/CAK4qSCfg37R-W3rYCH3VX%3DPguXoWE2eJABtJCnhOPzMi1xYCkA%40mail.gmail.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread wd
hi,

I didn't think django template tags are relevant with script or any html
code. They are totally different things.
I think it's just your code editor didn't recognize the tags, have you
tried ignore them and see if django will report an error ?

On Thu, Oct 10, 2019 at 6:22 PM Rain  wrote:

> I want to add an for each method in inside script but for some reason
> django template tags not working in this case only.
> can someone please help me ! thanks alot
>
>
>
>
> --
> 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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%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/CABexzmgjJLFD4YTE1jCE22a-SBb%3DdSLJKw0suzSOB86WnSRrgQ%40mail.gmail.com.


Re: QuerySet not iterable

2019-10-10 Thread Abhijeet Viswa
Hey there guys,

I'm happy to say that we've finally figured out the bug. It was never an 
error with the underlying DBMS or Django itself. It was our code. It's sad 
that we didn't figure it out sooner and had to spend so many man hours on 
this. 

As I said, the *select_for_update *was never a problem to begin with. The 
TransactionManagementError was due to us executing queries inside 
Transaction block even after the transaction had rollbacked due to some 
reason (which we couldn't figure out). After having PSQL log all queries, 
we realized someone was sending an explicit rollback message after we do a 
SELECT COUNTER(*) (etither Django or our code). We thought it was some 
hidden bug with Django while using aggregation. 

We test the result of the SELECT statement and deny the request (or so we 
thought we did). We properly rollback and then instead of returning a 
*Response*, we just continued forward issuing more queries. Thankfully, the 
TransactionManagementError helped us and resulted in us not losing any 
data. Bottom line, if you guys face this error, make sure your user code is 
correct and you are doing everything as expected. Also, try logging the 
DBMS to see whether error is originating so you can narrow it down further.

Thanks to all those who helped. I did learn a whole lot over this process, 
and for that I'm glad.

-- 
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/680a4bd8-f433-4a65-8f98-da10919765b5%40googlegroups.com.


Django Template Tags not working inside script

2019-10-10 Thread Rain

I want to add an for each method in inside script but for some reason 
django template tags not working in this case only.
can someone please help me ! thanks alot




-- 
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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com.


https://stackoverflow.com/questions/58080545/mysql-too-many-connections-django-sqlalchemy

2019-10-10 Thread amith chowdri
Hi all,

I'm developing a tool in which I'm using* Angular 6* for frontend and *Django 
rest framework* for the backend. To connect Django and MySql I'm using 
*SqlAlchemy*.

Now, I'm facing issue "*MySql Too many connections"* when there is an 
increase in usage of API or you can say no. of users(currently 10 users). 
When I see *show processlist* all the connections are in sleep. when no. of 
connections reaches maximum I'm getting this error. So I tried using 
connection pooling to solve this issue (link 
). But still not able 
resolve as the connections are continuing to be in sleep mode. I have also 
tried giving 'CONN_MAX_AGE' as 0 but of no use.

1) Why is Django not closing the connections or reuse the connections which 
are in sleep instead of creating a new connection every time?
2) Should I close the connections manually? How?
3) The proper way to handle the connection pooling in Django.
4) Any other ways to handle this issue?

*Quick fix*: I have set wait_timeout and interactive_timeout as 800 for 
temp purpose and it is working fine as the connections which are in sleep 
mode for more than 800s are getting dropped. I feel this is not a proper 
way to fix this issue.

I have posted this issue on stack overflow(link 
)
 
but haven't got any response.

Thank you

-- 
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/972dd9d4-9e54-45e6-acd9-7915087bf0ab%40googlegroups.com.


MySql Too many connections: Django sqlAlchemy

2019-10-10 Thread amith chowdri
Hi all,

I'm developing a tool in which I'm using* Angular 6* for frontend and *Django 
rest framework* for the backend. To connect Django and MySql I'm using 
*SqlAlchemy*.

Now, I'm facing issue "*MySql Too many connections"* when there is an 
increase in usage of API or you can say no. of users(currently 10 users). 
When I see *show processlist* all the connections are in sleep. when no. of 
connections reaches maximum I'm getting this error. So I tried using 
connection pooling to solve this issue (link 
). But still not able 
resolve as the connections are continuing to be in sleep mode. I have also 
tried giving 'CONN_MAX_AGE' as 0 but of no use.

1) Why is Django not closing the connections or reuse the connections which 
are in sleep instead of creating a new connection every time?
2) Should I close the connections manually? How?
3) The proper way to handle the connection pooling in Django.
4) Any other ways to handle this issue?

*Quick fix*: I have set wait_timeout and interactive_timeout as 800 for 
temp purpose and it is working fine as the connections which are in sleep 
mode for more than 800s are getting dropped. I feel this is not a proper 
way to fix this issue.

I have posted this issue on stack overflow(link 
)
 
but haven't got any response.

Thank you

-- 
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/9bf85bbd-21c7-4ff9-8fd2-1c578ba5c9f9%40googlegroups.com.


Re: University management system

2019-10-10 Thread Ankita Gupta


On Thursday, October 10, 2019 at 2:51:00 AM UTC+5:30, Jani Tiainen wrote:
>
> Hi.
>
> How realistic, given your requirements, you think you as a developer can 
> implement all that in one week?
>
I know it's not realistic, but I have to do it myself. 

>
> Ok, lets break this down a bit.
>
> Requirement 1 hierarchical users. 
>
 
>
This is rather trivial to do if you don't need fancy ui but can rely on 
> admin facilities.
>
With admin as in group permissions? 

>
> Requirement 2 blogging. If you checkout Django Girls tutorial it gives 
> basis to write one.
>
Yeas, I have started doing that part.

>
> Requirement 3 fancy stuff like images etc in blogs. Now it starts to get 
> tricky. Like how you upload images? How to size and position them? How you 
> add links? Do you want to make sure all user input is safe or do you trust 
> users not to do bad things. This is one of the big requirements which has 
> possibilty to be real time sink. You said that you have checked out some 
> blogs. Why they didn't fit to your requirements?
>
For now, I just want it to work, I can do validation stuff later on. Other 
blogs were very simple, just a paragraph post with no styling nothing 
extra. 

>
> Requirement 4 forums or comments. If you think a bit there is actually 
> very little difference between those two. Both are usually time based and 
> might be hierarchical also.
>
Yeas. 

>
> Requirement 5 reports. This might be one of the simplest things to 
> implement since django orm provides pretty good aggregation support. You 
> just need to figure out what and how you want to represent the data.
>
Okay. I'll check that. Thank you. 

>
> Requirement 6 grading system. Or "rating" fortunately there exists quite 
> many django apps that does this.
>
Can you list some of them? 

>
>
> ke 9. lokak. 2019 klo 19.55 Ankita Gupta  > kirjoitti:
>
>> Hello everyone!
>> I have a project to make on university management system.
>> BASIC requirements- 
>> 1. Heirarichal mode(multiple users like mentor, student, Dean, advisors 
>> etc)
>> 2. Students need to post daily blogs about their progress(if certain task 
>> is given to them by their mentors). 
>> 3. Blogs will have images, url, links, etc.
>> 4. Discussion forum or maybe comment system in simple language where 
>> mentor and student can interact over the blog. 
>> 5. Weekly and monthly report generator of student's progress like no. Of 
>> blogs, how much they were active etc.
>> 6. Mentor provided with grading facility just like we have different 
>> emojis on Facebook post. 
>> I want to know if is this possible with any cms because I am very much 
>> short of time. And I have less practical knowledge of django. I have tried 
>> many open source projects regarding blog part but couldn't find useful to 
>> me. I have to submit this project in 1 week. 
>> Django users, waiting for your valuable response to this thread.
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5740d448-d6ad-48b7-a8ab-11bb6a6982ab%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/c958e302-f426-4990-bdee-6b674be67755%40googlegroups.com.


Re: list cycle in template

2019-10-10 Thread Luca Bertolotti
Hello I have solved using a tuple because i need to compare value:

{% for matric,lotto,rimanenza in lista_finale %} {% if matric == dati.partn 
%}{{ lotto }} -- {{ rimanenza }}{% endif %}{% endfor %}

Where lista finale is a list of tuple

Thanks to all

Il giorno mercoledì 9 ottobre 2019 19:28:50 UTC+2, Luqman Shofuleji ha 
scritto:
>
> Sorry little mistake there:
>
> Then in your template:
>   
> {% for a in mylist %}
>   {{ a }}
> {% endfor %}
>   
>
> On Wed, Oct 9, 2019 at 2:27 PM Luqman Shofuleji  > wrote:
>
>> 1) you forgot to include  {% endfor %} in you template
>>
>> 2) I believe in your view all you actually need is:
>> mylist = ['aa','bb'] 
>> return render({'mylist':mylist})  
>>
>> Then in your template:
>>   
>> {% for a in mylist %}
>>   {{ mylist }}
>> {% endfor %}
>>   
>>
>>
>>
>>
>>  
>>
>>
>> On Wed, Oct 9, 2019 at 9:17 AM Luca Bertolotti > > wrote:
>>
>>> Hello in the view a hve a list
>>> mylist = ['aa','bb']
>>> n = range(len(mylist))
>>>
>>> return render({'mylist':mylist,'n':n,.})
>>>
>>> in the template i do this:
>>>
>>> {% for a in n %} {{ mylist.a }}
>>>
>>> it never show nothing, but if i do:
>>>
>>> {% for a in n %} {{ mylist.0 }}
>>> it show 'aa'
>>>
>>> Where is the mistake?
>>>
>>> Thanks
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/af0a2286-6bf9-4b9e-9a77-626ae5309ee6%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/fe2c2400-f685-41a4-a81b-bededaec3f30%40googlegroups.com.