Re: Getting one single entry from model via ajax

2019-01-14 Thread ANi
You need to make it iterable, so there are two ways to do it.
One is to let it become a list with single object while another one is to 
use filter so the result will be a QuerySet.
In your case will be the first one.


Stéphane Manguette於 2019年1月15日星期二 UTC+8上午9時26分14秒寫道:
>
> Hello Django community,
>
> I'm pretty new to Django and I'm getting stuck on the following issue. 
>
> I have a model defined as follows :
>
> class temp_db(models.Model):
> date = models.DateTimeField()
> tempext = models.DecimalField(max_digits=4, decimal_places=2)
> tempeau = models.DecimalField(max_digits=4, decimal_places=2)
> humid = models.DecimalField(max_digits=4, decimal_places=2)
>
> def __str__(self):
> return str(self.date)
>
> temp_db is being update every two minutes with a new entry thanks to a 
> dedicated python script.
>
> I'm trying to develop a website page which would constantly show the last 
> value recorded in the table temp_db.
>
> I would like to use ajax to retrieve the last entry (and you will 
> understand : without refreshing my webpage)
>
> I've been consulting many tutorials to understand ajax and I think I'm 
> pretty ok with the way to do that from the client side.
>
> From a django standpoint; I'm getting trouble in transferring the last 
> entry of my table to the client. I think that json could help me but when 
> I'm trying to convert my entry into json with the following view code...
>
> def myview1(request):
> end_range = datetime.now()
> range = timedelta(days=1)
> beg_range = end_range - range
> chart = temp_db.objects.filter(date__gte=beg_range)
> last_entry = chart.latest('date')
> data = serializers.serialize('json', last_entry)
> return JsonResponse(data, safe=False)
>
> ...Django returns the following error :
>
> Internal Server Error: /myview1/
> Traceback (most recent call last):
>   File 
> "/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/exception.py",
>  
> line 41, in inner
> response = get_response(request)
>   File 
> "/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/base.py",
>  
> line 187, in _get_response
> response = self.process_exception_by_middleware(e, request)
>   File 
> "/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/base.py",
>  
> line 185, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "/home/pi/Projects/dashboard/views.py", line 55, in myview1
> data = serializers.serialize('json', last_entry)
>   File 
> "/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/serializers/__init__.py",
>  
> line 129, in serialize
> s.serialize(queryset, **options)
>   File 
> "/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/serializers/base.py",
>  
> line 80, in serialize
> for count, obj in enumerate(queryset, start=1):
> TypeError: 'temp_db' object is not iterable
>
>
> I guess that the problem is that one single entry is trying to be 
> serialized since when I'm trying to serialize temp_db.objects.all(). -> it 
> works. Maybe json is not the the way to do this but the only thing I would 
> like to do is to properly get my object from a client side and use it like 
> Myentry.tempext in the Js code of the client webpage
>
> Thanks in advance for your help.
>
> Stéphane
>
>
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bea5076d-586e-4c11-a8b7-be4c3694ecf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: keep getting an error on there is no module

2019-01-14 Thread Saeed Pooladzadeh


در یکشنبه 13 ژانویهٔ 2019، ساعت 7:28:11 (UTC-8)، Saeed Pooladzadeh نوشته:
>
> :In my Django project while I have made an app named employee. And have 
> registered it in my apps but I keep getting this error:
>
> No module named 'employee'
>
> Leading to the app not being able to run properly.
>
 

> My Django version is 2.1.5 and and use visual studio 2017.
>
Here comes my setting code:

"""
Django settings for CRUD4 project.

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

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

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

import os
import posixpath

# 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/1.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '1f179624-7472-4502-9b5e-af7a9c44c1f2'

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

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'employee',
# Add your apps here to enable them
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

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

ROOT_URLCONF = 'CRUD4.urls'

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


# Database
# https://docs.djangoproject.com/en/1.9/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/1.9/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/1.9/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/1.9/howto/static-files/

STATIC_URL = '/static/'

STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))


 
 
 

> please inform.
>
 

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f234855f-3581-496b-b538-64dd74b0c7a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Getting one single entry from model via ajax

2019-01-14 Thread Stéphane Manguette
Hello Django community,

I'm pretty new to Django and I'm getting stuck on the following issue. 

I have a model defined as follows :

class temp_db(models.Model):
date = models.DateTimeField()
tempext = models.DecimalField(max_digits=4, decimal_places=2)
tempeau = models.DecimalField(max_digits=4, decimal_places=2)
humid = models.DecimalField(max_digits=4, decimal_places=2)

def __str__(self):
return str(self.date)

temp_db is being update every two minutes with a new entry thanks to a 
dedicated python script.

I'm trying to develop a website page which would constantly show the last 
value recorded in the table temp_db.

I would like to use ajax to retrieve the last entry (and you will 
understand : without refreshing my webpage)

I've been consulting many tutorials to understand ajax and I think I'm 
pretty ok with the way to do that from the client side.

>From a django standpoint; I'm getting trouble in transferring the last 
entry of my table to the client. I think that json could help me but when 
I'm trying to convert my entry into json with the following view code...

def myview1(request):
end_range = datetime.now()
range = timedelta(days=1)
beg_range = end_range - range
chart = temp_db.objects.filter(date__gte=beg_range)
last_entry = chart.latest('date')
data = serializers.serialize('json', last_entry)
return JsonResponse(data, safe=False)

...Django returns the following error :

Internal Server Error: /myview1/
Traceback (most recent call last):
  File 
"/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/exception.py",
 
line 41, in inner
response = get_response(request)
  File 
"/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/base.py",
 
line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
  File 
"/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/base.py",
 
line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/pi/Projects/dashboard/views.py", line 55, in myview1
data = serializers.serialize('json', last_entry)
  File 
"/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/serializers/__init__.py",
 
line 129, in serialize
s.serialize(queryset, **options)
  File 
"/home/pi/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/serializers/base.py",
 
line 80, in serialize
for count, obj in enumerate(queryset, start=1):
TypeError: 'temp_db' object is not iterable


I guess that the problem is that one single entry is trying to be 
serialized since when I'm trying to serialize temp_db.objects.all(). -> it 
works. Maybe json is not the the way to do this but the only thing I would 
like to do is to properly get my object from a client side and use it like 
Myentry.tempext in the Js code of the client webpage

Thanks in advance for your help.

Stéphane




-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/870930f9-df04-4018-8ea2-38baef73529d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: migrate failed due to Permission

2019-01-14 Thread ANi
Okay,
>
> *those queries that you're executing in module scope should go into 
> functions and methods that you only call when you actually need that data.*


This is enough to me. lol
I did query outside the functions, I didn't notice that it would be a 
problem.
Thank you very much.

ANi於 2019年1月14日星期一 UTC+8下午3時49分44秒寫道:
>
> Hello.
>
> I want to migrate all tables into new database but bumped into an error 
> that it said "auth_permission" is not found.
> Then I searched for the possible causes, it turned out that it is because 
> I accessed the auth model "Permission" in my code before the migrate 
> creating table in database.
> I tried to run *python manage.py migrate auth, *but nothing changed.
>
> So maybe I have to change my code ... I have to filter out managers by its 
> permission.
>
> manager_permission = Permission.objects.get(codename='manager')
> managers = User.objects.filter(project=project).filter(user_permissions=
> manager_permission)
>
> User.user_permissions is only allowed to use the permission code which 
> could be different every time I re-migrate the whole database.
>
> So I am asking if there is a better way to filter out managers by its perm 
> or other solutions ? :)
>
> Thank you 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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59fd6bb6-be5a-4bdc-9350-fd5382bf0ff9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how handle high incoming data and sending throttled data to web sockets in django-channels

2019-01-14 Thread Andrew Godwin
You'll have to design your own consumption architecture if you want to
reliably handle 100 messages a second - since it's UDP, channels won't be
handling it natively so you'll need to terminate and process the UDP
yourself. I'd recommend either getting a UDP loadbalancer if you have
messages coming in from multiple sources, or do your own work queue if it's
a single source and you can't process them fast enough.

Andrew

On Mon, Jan 14, 2019 at 7:31 AM Sahil Mangotra <
sahil.mango...@utradesolutions.com> wrote:

> I am facing a problem in my django web server.
>
> We are using python3, django2, django-rest-framework3.8 and channels2.x
>
> Scenario is we are receiving DATA from a UDP connection at very fast rate
> (~100 messages per second). The data revived is in proto format (you can
> say we are receiving byte data). some data gets starved in this process as 
> *Rate
> of production >>> rate of consumption* we are implementing throttling but
> still at 100 concurrent users data starves again. Can anyone help us in
> this scenario.
>
> If anyone has any new architecture idea please share.
>
> *This is surely an interesting problem. This is about stock market feed*
>
> PS :- I cannot post any code as it is my companies. but i can help any
> time you need clarification on any point.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/02c1735d-dc05-44b3-b0a0-d343aa59f8ef%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1uqFZ%3DKe4yyPdG8-LTGRYLHYegotao9JbQNWOVWLJLoPcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where do you place your application code in production

2019-01-14 Thread PASCUAL Eric
Hi,


It depends on the type of deployment you use.


The options I use are :


  *   for deployment on a "bare server", I create a standard user which id is 
used for running the application, and the application code is stored under the 
home dir of this user. This solves the security problem of running the 
application with a user having the lowest possible privileges
  *   for Docker based deployments, I place most of the time the application in 
a directory directly at the root of the file system of its container (e.g. 
"/app"). No need to bother with standard user home dir or conventions commonly 
used in Linux  FHS (involving places such as /usr or /opt), since the container 
host your stuff only. Not directly related to the topic, but in containers 
also, it's wiser to run the application under a standard user identity.


Hope this helps

Regards

Eric



From: django-users@googlegroups.com  on behalf 
of vineeth sagar 
Sent: Monday, January 14, 2019 9:52:26 AM
To: django-users@googlegroups.com
Subject: Where do you place your application code in production

Hi,

This is not concerned with django itself, but I would love to get the general 
consensus here, In my college days while deploying a php application all the 
tutorials pointed to place my code in /var/www or something of that sort. For 
my django applications I tend to put it in /home//services/. What are the 
potential drawbacks of placing it inside home? Where do you generally place you 
application code?



regards
Vineeth

--
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 post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMMZq8NuE_M0nrU0Hxt7oeFuTVOZNJbgDL%2BAL5vM%3D9SL6T2uJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AM0P193MB0308B6CFE7A51627D2ABB5128C800%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: keep getting an error on there is no module

2019-01-14 Thread Saeed Pooladzadeh
When I register my app in installed apps in setting I get an error message.
*When I run the server or make the migration. My Django version is 2.1.5*.
What is the problem?

Saeed



On Sun, Jan 13, 2019 at 12:03 PM Nebojsa Hajdukovic <
nebojsa.zero...@gmail.com> wrote:

> when you get this error, when want to run the server?
> do you have any models inside of that app?
>
>
> нед, 13. јан 2019. у 16:28 Saeed Pooladzadeh  је
> написао/ла:
>
>> :In my Django project while I have made an app named employee. And have
>> registered it in my apps but I keep getting this error:
>>
>> No module named 'employee'
>>
>> Leading to the app not being able to run properly.
>>
>>
>> please inform.
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/7273ab19-1c0f-4e7e-9cb7-177a48da3a69%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ60hW1uqvUKcy3UR0ppEgkCC968Q74zttpfmkcMxrPmW_pYQg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKh%2BqawBw%3D2CyZyoMcxUhN3FdS4POhgSsmxyn6kEahNJ3c1HKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: working fine with sqllite but not showing result in mysql

2019-01-14 Thread Danylo K.
if you change the code to this, it will work:

   post = get_object_or_404(Post, slug=post,
 status='published',
 publish__year=year)
 # publish__month=month,
 # publish__day=day)


On Mon, Jan 14, 2019 at 2:22 PM tribhuvan kishor <
tribhuvankishor...@gmail.com> wrote:

> yes all things are working fine like post list are working fine
>
> from django.shortcuts import render, get_object_or_404
> from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
> from django.views.generic import ListView
> from .models import Post
>
> def post_list(request):
> object_list = Post.published.all()
> paginator = Paginator(object_list, 3) # 3 posts in each page
> page = request.GET.get('page')
> try:
> posts = paginator.page(page)
> except PageNotAnInteger:
> # If page is not an integer deliver the first page
> posts = paginator.page(1)
> except EmptyPage:
> # If page is out of range deliver last page of results
> posts = paginator.page(paginator.num_pages)
> return render(request,
>   'blog/post/list.html',
>   {'page': page,
>'posts': posts})
>
> # Create your views here.
> def post_detail(request, year, month, day, post):
> post = get_object_or_404(Post, slug=post,
>  status='published',
>  publish__year=year,
>  publish__month=month,
>  publish__day=day)
>
> return render(request,
>   'blog/post/details.html',
>   {'post': post})
>
> class PostListView(ListView):
> queryset = Post.published.all()
> context_object_name = 'posts'
> paginate_by = 3
> template_name = 'blog/post/list.html'
>
> def test_test(request):
> return render(request,'blog/post/test.html')
>
>
> On Tue, Jan 15, 2019 at 12:24 AM Alex Kimeu  wrote:
>
>> Have you configured MySQL correctly?
>>
>> On Mon, Jan 14, 2019 at 9:07 PM tribhuvan kishor <
>> tribhuvankishor...@gmail.com> wrote:
>>
>>> this view is retrieving data with SQlite but not fetching data in
>>> MySQL saying no data found.
>>>
>>>
>>> def post_detail(request, year, month, day, post):
>>> post = get_object_or_404(Post, slug=post,
>>>  status='published',
>>>  publish__year=year,
>>>  publish__month=month,
>>>  publish__day=day)
>>>
>>> return render(request,
>>>   'blog/post/details.html',
>>>   {'post': post})
>>>
>>> --
>>> regards
>>> Tribhuvan Kishor Bhaskar
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CACiphSVVyMgpNmgFj16ROZGqpohaq0fYJKV2bES4D1aVeg1LbA%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>>
>>
>> *"It's when nothing happens that anything can happen."*
>> *https://kodenaut.github.io/ **+
>> 254 723494571*
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACYP3VGYe96j6vYWYC8-7GCzODUfu8b5xc1qo2Lh6KhHevKgYQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> regards
> Tribhuvan Kishor Bhaskar
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 

Re: Django UserForm Help Texts

2019-01-14 Thread Alex Kimeu
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
from django.contrib import messages
from .models import Profile
from quiz.models import Question


def register(request):
if request.method == 'POST':
form = UserRegisterForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
messages.success(request, f'Account Created for {username}!')
return redirect('quiz:quiz-index')

else:
form = UserRegisterForm()
return render(request, 'users/register.html', {'form': form})


On Mon, Jan 14, 2019 at 11:39 PM Alex Kimeu  wrote:

> *views.py*
>
>
> On Mon, Jan 14, 2019 at 11:36 PM Nebojsa Hajdukovic <
> nebojsa.zero...@gmail.com> wrote:
>
>> can you show your views.py?
>>
>> пон, 14. јан 2019. у 19:52 kimeualexis  је
>> написао/ла:
>>
>>> Hello, guys.
>>>
>>> Anyone with an idea how to hide help texts in Django User Registration
>>> Form?
>>>
>>> Regards.
>>>
>>> [image: Screenshot from 2019-01-14 21-48-53.png]
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/331219f5-b547-456c-a7c4-759c0574d82b%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJ60hW2T%3DVnYyXGwhaFS-SyK5kg7Voi7at9N-c%2BTiGkpJ4EMVg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
>
> *"It's when nothing happens that anything can happen."*
> *https://kodenaut.github.io/ **+
> 254 723494571*
>
>

-- 


*"It's when nothing happens that anything can happen."*
*https://kodenaut.github.io/ **+
254 723494571*

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACYP3VHKKKFquA081tDpBmcBfA3N9Ko%2BwtAKxYKwcHHpsC3MHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Storing SSN and other PII in Django

2019-01-14 Thread cpyle
Hey all,

My company requires us to store a user's SSN to report business on his or 
her behalf. I'll admit that I've never built out a django production app, 
so I'm not sure the best practices for storing PII. Is there any way to 
encrypt the information on the backend so even the admins like me couldn't 
read the data? It needs to be stored so that I Can run a script on our 
database that produces a large concatenated string of each user's 
information.

Thanks for any suggestions!
Charlie

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7be00203-9d50-461b-943e-13f80b14305c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: working fine with sqllite but not showing result in mysql

2019-01-14 Thread Danylo K.
I have the same issue. In MySQL, search works fine by the *year part*, but
not by the *month* and *day* *parts*.

Cheers!

On Mon, Jan 14, 2019 at 1:54 PM Alex Kimeu  wrote:

> Have you configured MySQL correctly?
>
> On Mon, Jan 14, 2019 at 9:07 PM tribhuvan kishor <
> tribhuvankishor...@gmail.com> wrote:
>
>> this view is retrieving data with SQlite but not fetching data in
>> MySQL saying no data found.
>>
>>
>> def post_detail(request, year, month, day, post):
>> post = get_object_or_404(Post, slug=post,
>>  status='published',
>>  publish__year=year,
>>  publish__month=month,
>>  publish__day=day)
>>
>> return render(request,
>>   'blog/post/details.html',
>>   {'post': post})
>>
>> --
>> regards
>> Tribhuvan Kishor Bhaskar
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACiphSVVyMgpNmgFj16ROZGqpohaq0fYJKV2bES4D1aVeg1LbA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
>
> *"It's when nothing happens that anything can happen."*
> *https://kodenaut.github.io/ **+
> 254 723494571*
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACYP3VGYe96j6vYWYC8-7GCzODUfu8b5xc1qo2Lh6KhHevKgYQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADnU5JEv4ZfCY8Yk8utBnRvs%3D8fPkd8%3D%3DdhaU_uiJC8_aueAOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django UserForm Help Texts

2019-01-14 Thread Nebojsa Hajdukovic
can you show your views.py?

пон, 14. јан 2019. у 19:52 kimeualexis  је
написао/ла:

> Hello, guys.
>
> Anyone with an idea how to hide help texts in Django User Registration
> Form?
>
> Regards.
>
> [image: Screenshot from 2019-01-14 21-48-53.png]
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/331219f5-b547-456c-a7c4-759c0574d82b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ60hW2T%3DVnYyXGwhaFS-SyK5kg7Voi7at9N-c%2BTiGkpJ4EMVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: working fine with sqllite but not showing result in mysql

2019-01-14 Thread Alex Kimeu
Kindly post your urls mappings.

On Mon, Jan 14, 2019 at 10:22 PM tribhuvan kishor <
tribhuvankishor...@gmail.com> wrote:

> yes all things are working fine like post list are working fine
>
> from django.shortcuts import render, get_object_or_404
> from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
> from django.views.generic import ListView
> from .models import Post
>
> def post_list(request):
> object_list = Post.published.all()
> paginator = Paginator(object_list, 3) # 3 posts in each page
> page = request.GET.get('page')
> try:
> posts = paginator.page(page)
> except PageNotAnInteger:
> # If page is not an integer deliver the first page
> posts = paginator.page(1)
> except EmptyPage:
> # If page is out of range deliver last page of results
> posts = paginator.page(paginator.num_pages)
> return render(request,
>   'blog/post/list.html',
>   {'page': page,
>'posts': posts})
>
> # Create your views here.
> def post_detail(request, year, month, day, post):
> post = get_object_or_404(Post, slug=post,
>  status='published',
>  publish__year=year,
>  publish__month=month,
>  publish__day=day)
>
> return render(request,
>   'blog/post/details.html',
>   {'post': post})
>
> class PostListView(ListView):
> queryset = Post.published.all()
> context_object_name = 'posts'
> paginate_by = 3
> template_name = 'blog/post/list.html'
>
> def test_test(request):
> return render(request,'blog/post/test.html')
>
>
> On Tue, Jan 15, 2019 at 12:24 AM Alex Kimeu  wrote:
>
>> Have you configured MySQL correctly?
>>
>> On Mon, Jan 14, 2019 at 9:07 PM tribhuvan kishor <
>> tribhuvankishor...@gmail.com> wrote:
>>
>>> this view is retrieving data with SQlite but not fetching data in
>>> MySQL saying no data found.
>>>
>>>
>>> def post_detail(request, year, month, day, post):
>>> post = get_object_or_404(Post, slug=post,
>>>  status='published',
>>>  publish__year=year,
>>>  publish__month=month,
>>>  publish__day=day)
>>>
>>> return render(request,
>>>   'blog/post/details.html',
>>>   {'post': post})
>>>
>>> --
>>> regards
>>> Tribhuvan Kishor Bhaskar
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CACiphSVVyMgpNmgFj16ROZGqpohaq0fYJKV2bES4D1aVeg1LbA%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>>
>>
>> *"It's when nothing happens that anything can happen."*
>> *https://kodenaut.github.io/ **+
>> 254 723494571*
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACYP3VGYe96j6vYWYC8-7GCzODUfu8b5xc1qo2Lh6KhHevKgYQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> regards
> Tribhuvan Kishor Bhaskar
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACiphSUvx06-PwJpxxMWyaKce_CTRagh4JDmkm3Mm-4j5UR-4Q%40mail.gmail.com
> 

Re: working fine with sqllite but not showing result in mysql

2019-01-14 Thread tribhuvan kishor
yes all things are working fine like post list are working fine

from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import ListView
from .models import Post

def post_list(request):
object_list = Post.published.all()
paginator = Paginator(object_list, 3) # 3 posts in each page
page = request.GET.get('page')
try:
posts = paginator.page(page)
except PageNotAnInteger:
# If page is not an integer deliver the first page
posts = paginator.page(1)
except EmptyPage:
# If page is out of range deliver last page of results
posts = paginator.page(paginator.num_pages)
return render(request,
  'blog/post/list.html',
  {'page': page,
   'posts': posts})

# Create your views here.
def post_detail(request, year, month, day, post):
post = get_object_or_404(Post, slug=post,
 status='published',
 publish__year=year,
 publish__month=month,
 publish__day=day)

return render(request,
  'blog/post/details.html',
  {'post': post})

class PostListView(ListView):
queryset = Post.published.all()
context_object_name = 'posts'
paginate_by = 3
template_name = 'blog/post/list.html'

def test_test(request):
return render(request,'blog/post/test.html')


On Tue, Jan 15, 2019 at 12:24 AM Alex Kimeu  wrote:

> Have you configured MySQL correctly?
>
> On Mon, Jan 14, 2019 at 9:07 PM tribhuvan kishor <
> tribhuvankishor...@gmail.com> wrote:
>
>> this view is retrieving data with SQlite but not fetching data in
>> MySQL saying no data found.
>>
>>
>> def post_detail(request, year, month, day, post):
>> post = get_object_or_404(Post, slug=post,
>>  status='published',
>>  publish__year=year,
>>  publish__month=month,
>>  publish__day=day)
>>
>> return render(request,
>>   'blog/post/details.html',
>>   {'post': post})
>>
>> --
>> regards
>> Tribhuvan Kishor Bhaskar
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACiphSVVyMgpNmgFj16ROZGqpohaq0fYJKV2bES4D1aVeg1LbA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
>
> *"It's when nothing happens that anything can happen."*
> *https://kodenaut.github.io/ **+
> 254 723494571*
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACYP3VGYe96j6vYWYC8-7GCzODUfu8b5xc1qo2Lh6KhHevKgYQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
regards
Tribhuvan Kishor Bhaskar

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACiphSUvx06-PwJpxxMWyaKce_CTRagh4JDmkm3Mm-4j5UR-4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: working fine with sqllite but not showing result in mysql

2019-01-14 Thread Alex Kimeu
Have you configured MySQL correctly?

On Mon, Jan 14, 2019 at 9:07 PM tribhuvan kishor <
tribhuvankishor...@gmail.com> wrote:

> this view is retrieving data with SQlite but not fetching data in
> MySQL saying no data found.
>
>
> def post_detail(request, year, month, day, post):
> post = get_object_or_404(Post, slug=post,
>  status='published',
>  publish__year=year,
>  publish__month=month,
>  publish__day=day)
>
> return render(request,
>   'blog/post/details.html',
>   {'post': post})
>
> --
> regards
> Tribhuvan Kishor Bhaskar
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACiphSVVyMgpNmgFj16ROZGqpohaq0fYJKV2bES4D1aVeg1LbA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 


*"It's when nothing happens that anything can happen."*
*https://kodenaut.github.io/ **+
254 723494571*

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACYP3VGYe96j6vYWYC8-7GCzODUfu8b5xc1qo2Lh6KhHevKgYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django UserForm Help Texts

2019-01-14 Thread kimeualexis
Hello, guys.

Anyone with an idea how to hide help texts in Django User Registration Form?

Regards.

[image: Screenshot from 2019-01-14 21-48-53.png]

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/331219f5-b547-456c-a7c4-759c0574d82b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


working fine with sqllite but not showing result in mysql

2019-01-14 Thread tribhuvan kishor
this view is retrieving data with SQlite but not fetching data in
MySQL saying no data found.


def post_detail(request, year, month, day, post):
post = get_object_or_404(Post, slug=post,
 status='published',
 publish__year=year,
 publish__month=month,
 publish__day=day)

return render(request,
  'blog/post/details.html',
  {'post': post})

-- 
regards
Tribhuvan Kishor Bhaskar

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACiphSVVyMgpNmgFj16ROZGqpohaq0fYJKV2bES4D1aVeg1LbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: template not exist error snap in attechment

2019-01-14 Thread tribhuvan kishor
thanks shiva . thanks alot i think a lack of concentration

On Sat, Jan 12, 2019 at 1:32 PM shiva kumar 
wrote:

> It's not detail it's details.html
>
> On Sat 12 Jan, 2019 12:42 pm tribhuvan kishor <
> tribhuvankishor...@gmail.com wrote:
>
>> even list.html is in the same place and its accessible . i am not getting
>> why showing problem with details.html
>>
>>
>> On Sat, Jan 12, 2019 at 12:40 PM tribhuvan kishor <
>> tribhuvankishor...@gmail.com> wrote:
>>
>>> """
>>> Django settings for mysite project.
>>>
>>> Generated by 'django-admin startproject' using Django 2.0.5.
>>>
>>> For more information on this file, see
>>> https://docs.djangoproject.com/en/2.0/topics/settings/
>>>
>>> For the full list of settings and their values, see
>>> https://docs.djangoproject.com/en/2.0/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__)))
>>>
>>>
>>> # Quick-start development settings - unsuitable for production
>>> # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
>>>
>>> # SECURITY WARNING: keep the secret key used in production secret!
>>> SECRET_KEY = 'po3(*jzn*8yzi$765qqcke+ewdc()g6xbwvx(g64i^bw28ulc@'
>>>
>>> # 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',
>>> 'blog',
>>> ]
>>>
>>> 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 = 'mysite.urls'
>>>
>>> TEMPLATES = [
>>> {
>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>> 'DIRS': [],
>>> '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 = 'mysite.wsgi.application'
>>>
>>>
>>> # Database
>>> # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
>>>
>>> DATABASES = {
>>> 'default': {
>>> 'NAME': 'mysite',
>>> 'ENGINE': 'django.db.backends.mysql',
>>> 'HOST': 'localhost',
>>> 'PORT':'3306',
>>> 'USER': 'root',
>>> 'PASSWORD': 'root',
>>> }
>>> }
>>>
>>>
>>> # Password validation
>>> # 
>>> https://docs.djangoproject.com/en/2.0/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.0/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.0/howto/static-files/
>>>
>>> STATIC_URL = '/static/'
>>>
>>>
>>> On Sat, Jan 12, 2019 at 11:33 AM shiva kumar <
>>> kannamshivakumar...@gmail.com> wrote:
>>>
 once post your setting.py file content . i will try to figure it out.


 On Sat, Jan 12, 2019 at 11:16 AM tribhuvan kishor <
 tribhuvankishor...@gmail.com> wrote:

> this is my directory structure
>
> On Fri, Jan 11, 2019 at 9:19 PM Martin K  wrote:
>
>> TEMplate DIrectory
>>> PROJECT/APP/template/blog/detail.html
>>>
>>>
>> You see directly in the error that template should be located in
>> PROJECT/APP/template/blog/*post*/detail.html
>>
>> --
>> 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 

Re: migrate failed due to Permission

2019-01-14 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Sun, Jan 13, 2019 at 11:49:44PM -0800, ANi wrote:
> Hello.
> 
> I want to migrate all tables into new database but bumped into an error 
> that it said "auth_permission" is not found.
> Then I searched for the possible causes, it turned out that it is because I 
> accessed the auth model "Permission" in my code before the migrate creating 
> table in database.
> I tried to run *python manage.py migrate auth, *but nothing changed.
> 
> So maybe I have to change my code ... I have to filter out managers by its 
> permission.
> 
> manager_permission = Permission.objects.get(codename='manager')
> managers = User.objects.filter(project=project).filter(user_permissions=
> manager_permission)
> 
> User.user_permissions is only allowed to use the permission code which 
> could be different every time I re-migrate the whole database.
> 
> So I am asking if there is a better way to filter out managers by its perm 
> or other solutions ? :)

Hi,

The problem is that you're not supposed to execute any database
queries when your application is getting imported – you should only do
that at runtime, when everything has been initialized, and when you're
handling a request (or a management command, or a background job, such
as celery, or whatnot).

It's a bit difficult to go into more detail, because you haven't
provided a whole lot of information, but those queries that you're
executing in module scope should go into functions and methods that
you only call when you actually need that data. It would be easier to
give you more specific advice if you posted the relevant parts of your
code, though.

Good luck,

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJcPMMcAAoJEHA7T/IPM/klYBEQAIq+exMdhBSLR7Vskpzavd2p
HHLIZYl9DuVOaxtW5sg0qIu92rLVGf8taPLzhIZJA5LHGlnYaFPMo0Bs6eNCdUnr
Bpxzt1xzJFiqou96NFFveG1N1ywCfAvPNqNhyTRJjX0iRv3n2LFk5XQ05V3GUcvv
V/+wvTm6ZlffVHuCWKIWypkY2yMZhFryTebmZOmavptNVMx5FpU4FcEBLufE5qvw
j0BmnvXRqUkuEhtyqGNcnjl496khb5Zu9zKfZcrjyDDvTlhC0nS4hS5MDZxkih6x
RfX2p0vjOctJhnKiywBIjOGNR5jFEYGCqVkyYds0rF6kNSvLRelxgJtB8Ms8yIkE
VffEsuVlS56DTtxIyyhJcnwYVA0JqO4QvEDY4VB6N7Is+Kd/dGrk0+qdhd4psawb
pNYhwWNMjvvl6aCpvPd+5rKFUW7I25mD2F+tx7/5EcVCp7767NG0nnMiSTqXnz5w
4aU09pzM7TCwr+2rTvdsM94jui/0bfWA437sLcpyQ+uALwzqc89i3vN4aVrnJRDv
W2Y1TJxS2v1uyqwvTYmx+7vNFT7lsDfFKKabwGvcMP7YdbwFCYNIvQKj229N3Y53
Fn25XOJe/WdfNAtzJP/m7UBuyaVorBZWVpFR4QHG+LTLRieEySmhgVe5seu9G50i
XCW0pAY72G3Kblzb4ZWI
=Nwlv
-END PGP SIGNATURE-

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20190114171301.GX8269%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Re: Set default value in field dependant on another model?

2019-01-14 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Mon, Jan 14, 2019 at 04:05:27PM +1100, Lachlan Musicman wrote:
> We have two models: Resources and Quota
> 
> Resources model instances include:
> - red things
> - yellow things
> - blue things
> 
> Quota have two fields, one is a FK to a Resource, the other is "desired
> quota".
> When instantiating the Quota request form, we create a form for each
> Resource.
> 
> I'd like to autofill the "desired quota" field on each form, but make it
> dependent on which Resource it is representing.
> 
> IE, when someone makes a resource request, we expect them to want
> 
> 1 red thing
> 5 yellow things
> 10 blue things
> 
> Do some searching, there's a lot pointing to Signals, but I remember
> someone once saying "if you are using signals, you should re-write you
> logic" or somesuch, so I thought I'd ask here.
> 
> FWIW - and this is well beyond my control - we are on Django 1.8

Hi Lachlan,

This sounds like logic that would be triggered by the view handling
the form – when you're displaying a new empty form, ask your business
logic layer for the default number of things to request in a new
“Quota” for that specific resource, and then pass that number to your
form as the “initial” argument.

Cheers,

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJcPMF3AAoJEHA7T/IPM/kl7aMQAKxO1sPQptRYCDYFzh/7UVLL
pBxxHT258Bnd3Oos73U05HQX7cij2Ca0aiJaFFK3nhd8SRl+WAKrzyNT40JBaEGC
dXXZrVxU4aUcHWsUKmGsbEXDEejnyGUM2sNU3rVzfs7zBdJl69fHKAFCeRc+iCJ8
ckWb/f0QCzqxEu5mVDC6UVqxWZY5QNws2bJ9zIeWVQZHaAhIeJrmrklKEEbstodi
9QGh64NHNZSn9kgNHiBYP39TKaTxa8QTN0pojB/U0VPt46AUx3Dyq/03GwK/8+mN
F4eUViiTntTCFsY0Py6jGh9/Oc8Yx0dRaQfalCj2uq6BSMLzIG+aZ8ubhkLq3DkK
6WvJ/nhhVNRyFjHFjV5lk7R5V/2mOPBFzIuPeWhUDFqYX8RA+SIZyqdZ9iabTxIJ
JG5Cp5FYZ0ToteQq8hWZcE9e/ZoB6c/b3aJwQ8MIqcCp8Rmh3cyjVFa1z3r3UJmG
j73T15NMwNk9b7g91sfluqhBWtPL31mH/7qTDtNXYC6WWawqCiol7y/Yu0xn2iws
xmPUYM4CDkF257t8KJxLzU69qhcB0xtRaqD5F31ioM4S+3WfCpXXmYUk7kPUUDzP
7KMr6s4sMq7BtdVxP4P3NEgfnfmyPkhiFuGX+v9OqV2VdbGTe7UkLuwCeXlD5zBb
cY+/1Z/YnrNn+EaspENW
=bT81
-END PGP SIGNATURE-

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20190114170600.GW8269%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Re: Can a class which inherits from factory.DjangoModelFactory use Django TestCase asserts?

2019-01-14 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Sat, Jan 12, 2019 at 03:59:59PM +0200, אורי wrote:
> Hi,
> 
> I have a problem with tests. We defined a class called DefaultUserFactory
> which inherits from factory.DjangoModelFactory, and I want to use asserts
> in this class such as assertEqual. What is the best approach to do it? I
> tried to inherit both from factory.DjangoModelFactory and from Django class
> TestCase but it doesn't work. I thought about passing a parameter from the
> calling function and then call assertEqual of the calling function's self.
> But it seems too complicated. Is there a better approach?
> 
> You can see our code on GitHub:
> 
> master:
> https://github.com/speedy-net/speedy-net/blob/master/speedy/core/accounts/tests/test_factories.py
> 
> staging (under development):
> https://github.com/speedy-net/speedy-net/blob/staging/speedy/core/accounts/tests/test_factories.py

Hi,

The factory class is not really the place to put your test assertions.
That would be the responsibility of the code of your actual test
cases. Factories are just one of the tools that you happen to mostly
use in tests, but you can totally use them to generate a sample
database outside of an automated test environment.

Running this kind of test code in your factory would also have the
drawback that you'd run the same asserts over and over and over again
every single time you invoke the factory – which might be thousands of
times during one run of your test suite.

As I understand it, you want to test your factories, which is a good
idea. What I suggest you do is to just write a separate test module
for your factories.

Good luck,

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJcPL0tAAoJEHA7T/IPM/klKeUQAMYUPpVVXAazNEt6Ga2He5V3
ZmmCDyYqQIJvrDAEwX7S1HbOq2K+EjvKeL2/dAf0Si7SQJPsjHcElUOIuSs+ch+/
46C5KM+3LLf3v2H6u1793TQy+oImoaygv8Mp3OZ8j7bfUH2dsBiLhECmfwQz48Ra
Uw/p7FoKKsT5saVK/bA4uoI2mIrnBKCj2KiZyYbkRs928tP9tAYIsHAotSXHDZVo
at8yyJ+J1nFFAzhZPJWN72zK0Pw5RdPF2L3wOrRhVgHLDfYsaZI9O4+6HYBjKkPn
6YWTVG1xq5p+dfofvtdzzFOiDn2rBRWgLlx3zl9cVE6xY7HjaieCI1a9IaePFXy8
MRIytt1Cc41tyT1lCl2yFBc+NT0+DFZMizNUkTgdzwM2uL2BlIh3+GsEY82ZzX/H
iwZ8DSOVuE2Iqpo132LrqcllHqNehxSYya7WBeBYHJiuDq2b2OaJp6ko5eb13ukn
LaVZGVwl+dmSx9HhVDqYHWHxK7AuEiE0CI+Y7Oy7RQhSH97L2MEw1qQlt6UxZtiz
83U0+RbNjDqXN0oMhswHtbnvnqnvKMg5zHVjzoLdAxrT+IIWUAnP6IqIM9v4UkgX
1aPof7eI6nm//ZA+fjmjCRorF3rHi98ZeK0a9Xccakl09zNKX7Vc/nlIbQqlKV8e
YawH4kZesUSUWBkIuIV/
=0T5r
-END PGP SIGNATURE-

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20190114164741.GV8269%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Re: integrating themes in django

2019-01-14 Thread Jani Tiainen
Hi,

Django is web development framework, in other words it's more a low level
library that you use when programming web sites rather than CMS like
wordpress is and thus there isn't really concept of themes in Django.

What Django can do is to render for example HTML and link it to CSS for
styling your web application, but you have to program all this yourself.

If you're more interested in pre-made CMS applications with Django, you may
want to take a look at Wagtail or Django-CMS


On Mon, Jan 14, 2019 at 4:31 PM Out Reach 
wrote:

> Hi I'm Looking for a theme like that https://www.couponsmith.com in
> Django framework please tell me where can I find these types of themes.
>
> On Thursday, May 10, 2018 at 9:10:58 AM UTC+5, Hitesh Goyal wrote:
>>
>> Hi team, I am new to Django.
>> How can i integrate ready-made website themes in a django project ?
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/051f0cfd-05a0-40fc-afd1-793da8f1e75f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91ofBtgrkaC_E2Ka4y_bjju18xYvcCvPXZ4CH%2BT7G2x8-cA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: part time or full time job opportunity for Django developers

2019-01-14 Thread Sankalp Saxena
Freelancer profile for any technology attached

On Mon, Jan 14, 2019 at 8:00 PM Muhammad Mahir 
wrote:

> Hi there Atul,
>
> Is it fine for you if the candidate will work remotely?
>
> On Mon, Jan 14, 2019 at 12:30 PM Atul Anand 
> wrote:
>
>> Hi All,
>>
>> I am in search for Django developer for a project.
>>
>> Interested candidate may share his/her resume with you at
>> atul.anand.n...@gmail.com
>>
>>
>> Regards,
>> Atul
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAKHpVdSJuJp1C0A%3D00mKJBe5SGSoHtt7NGAbksAix9eyNUEXLA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKgs%2BxxfJ95%2BtbgR4T3n1A0YUkKZvr2NpZbtEkHNstec1NdVTA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
*Regards,*
*Sankalp*
*Skype: sankalpsaxena7*
*Mobile: +91-9968017105*
*What Apps: +91-9968017105*

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALnq_%2BvnYUZv2ao_eBXuOgQnXyXDAmmNBMT5Lo9yCw2ZaE9e3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


SankalpSaxena_Freelancer_JavaAWSJ2EEHybrisSAPOracle_Freelancer_14yrs.docx
Description: MS-Word 2007 document


how handle high incoming data and sending throttled data to web sockets in django-channels

2019-01-14 Thread Sahil Mangotra


I am facing a problem in my django web server.

We are using python3, django2, django-rest-framework3.8 and channels2.x

Scenario is we are receiving DATA from a UDP connection at very fast rate 
(~100 messages per second). The data revived is in proto format (you can 
say we are receiving byte data). some data gets starved in this process as 
*Rate 
of production >>> rate of consumption* we are implementing throttling but 
still at 100 concurrent users data starves again. Can anyone help us in 
this scenario.

If anyone has any new architecture idea please share.

*This is surely an interesting problem. This is about stock market feed*

PS :- I cannot post any code as it is my companies. but i can help any time 
you need clarification on any point.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/02c1735d-dc05-44b3-b0a0-d343aa59f8ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: integrating themes in django

2019-01-14 Thread Out Reach
Hi I'm Looking for a theme like that https://www.couponsmith.com in Django 
framework please tell me where can I find these types of themes.

On Thursday, May 10, 2018 at 9:10:58 AM UTC+5, Hitesh Goyal wrote:
>
> Hi team, I am new to Django.
> How can i integrate ready-made website themes in a django project ?
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/051f0cfd-05a0-40fc-afd1-793da8f1e75f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: part time or full time job opportunity for Django developers

2019-01-14 Thread Muhammad Mahir
Hi there Atul,

Is it fine for you if the candidate will work remotely?

On Mon, Jan 14, 2019 at 12:30 PM Atul Anand 
wrote:

> Hi All,
>
> I am in search for Django developer for a project.
>
> Interested candidate may share his/her resume with you at
> atul.anand.n...@gmail.com
>
>
> Regards,
> Atul
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKHpVdSJuJp1C0A%3D00mKJBe5SGSoHtt7NGAbksAix9eyNUEXLA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKgs%2BxxfJ95%2BtbgR4T3n1A0YUkKZvr2NpZbtEkHNstec1NdVTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Where do you place your application code in production

2019-01-14 Thread vineeth sagar
Hi,

This is not concerned with django itself, but I would love to get the
general consensus here, In my college days while deploying a php
application all the tutorials pointed to place my code in /var/www or
something of that sort. For my django applications I tend to put it in
/home//services/. What are the potential drawbacks of placing it
inside home? Where do you generally place you application code?



regards
Vineeth

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMMZq8NuE_M0nrU0Hxt7oeFuTVOZNJbgDL%2BAL5vM%3D9SL6T2uJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: order_by function gets error if the field name or json key, has a dash.

2019-01-14 Thread Bill Freeman
At least on 2.7,  python has no trouble with this:

d={'x-y': 4}
>>> import json
>>> json.dumps(d)
'{"x-y": 4}'
>>>

So that leave's Django's parsing of the order_by string, or just possibly
the database connector.

It probably won't work, but you could try:

MyTable.objects.all().order_by("'myfield__en-us'")

(Single quotes inside double quotes, of vice versa.)

It would be instructive if you would post the original error.

There are problems with using internal interfaces, but you might climb down
inside the order_by to find something that is called after Django has
finished parsing, and substitute the version with the hyphen/minus in
arguments below.  Of once it has build the query, but before you evaluate
it, you could find the order key in the generated SQL (or the string that
will be used at generation time if that doesn't happen until evaluation)
and edit in the hyphen.  I don't promise that there actually are points
where you can do either of these things.  And whatever you do may break at
the next Django version (or the next revision of the database connector.

The better alternative is to figure out where the problem occurs, using
code inspection, or by single stepping in with the debugger (PDB directly
if you're not using something like PyCharm), then design and test an
alternate implementation that is only sensitive to hyphens where required,
and propose that code as an enhancement to the Django team (though if the
problem is somewhere deeper in the database connector, or heaven forbid, in
the DB itself, you may have a harder time finding a sympathetic ear).

Or, at a performance cost, you could skip the order_by clause, and do the
sorting in python.

Raw SQL is a possibility.

Good luck.


On Sun, Jan 13, 2019 at 9:11 PM Jason  wrote:

> I think the easiest way would be to convert the dash to an underscore to
> follow python standards when it comes to naming.  reason being, a dash is
> analogous to the subtraction mathematical operation so you're requiring
> python to know the difference in the usage of this character in names and
> operations.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/607c1021-bde0-4dbd-ac16-415eca8606c8%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0sFj1M760EPkDc-m0r5q7okqqad--sOaoQ2_e0E-pjhsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to connect mysqlclient on my pc

2019-01-14 Thread ANi
https://medium.com/@bencleary/django-mysql-for-windows-528272b3169b

As easy as this goes.

DIPU SARKER於 2019年1月13日星期日 UTC+8上午11時03分06秒寫道:
>
> hello i use windows10.How i use mysql in my django project and how to 
> install mysqlclient  in my pc.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b076581e-556e-47f5-83c6-48b3407d4428%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread Kuber Sodari
I am glad to be helpful. Your welcome!

On Monday, 14 January 2019 15:48:00 UTC+5:45, Tarık Kantar wrote:
>
> THANK YOU VERY MUCH İT WORKS! :)
>
> Kuber Sodari >, 14 Oca 2019 Pzt, 10:59 
> tarihinde şunu yazdı:
>
>> I see the problem is with 
>>
>>
>> *class Choice(models.Model) question = models.ForeignKey(Question) *
>> Update it as this
>>
>> *class Choice(models.Model) question = 
>> models.ForeignKey(Question, on_delete=models.CASCADE) *
>>
>> *CASCADE: *What this does it, when you delete the related object of 
>> Question, it will also delete the Choice object 
>> if you don't want that and when deleting Question object, if you want the 
>> choice object should remain even after then simple do this instead of 
>> CASCADE
>> *models.SET_NULL*
>>
>> On Monday, 14 January 2019 15:38:09 UTC+5:45, tarikk...@gmail.com wrote:
>>>
>>> This my screenshut of models.py
>>>
>>> 14 Ocak 2019 Pazartesi 10:43:32 UTC+1 tarihinde tarikk...@gmail.com 
>>> yazdı:

 Hi everyone!
 Could you please help me why I cant see this part below when I run this 
 command, python manage.py makemigrations polls,?

 <<<>>>
   0001_initial.py:
 - Create model Question
 - Create model Choice
 - Add field question to choice>


 I saw just that screen shut.

 -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/17fde7c1-fd2c-4d4a-92ec-058bc448b298%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Tarık Kantar
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cb60ed70-172f-40f8-87fd-3c1c1bcfd983%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread Tarık Kantar
THANK YOU VERY MUCH İT WORKS! :)

Kuber Sodari , 14 Oca 2019 Pzt, 10:59 tarihinde şunu
yazdı:

> I see the problem is with
>
>
> *class Choice(models.Model) question = models.ForeignKey(Question) *
> Update it as this
>
> *class Choice(models.Model) question =
> models.ForeignKey(Question, on_delete=models.CASCADE) *
>
> *CASCADE: *What this does it, when you delete the related object of
> Question, it will also delete the Choice object
> if you don't want that and when deleting Question object, if you want the
> choice object should remain even after then simple do this instead of
> CASCADE
> *models.SET_NULL*
>
> On Monday, 14 January 2019 15:38:09 UTC+5:45, tarikk...@gmail.com wrote:
>>
>> This my screenshut of models.py
>>
>> 14 Ocak 2019 Pazartesi 10:43:32 UTC+1 tarihinde tarikk...@gmail.com
>> yazdı:
>>>
>>> Hi everyone!
>>> Could you please help me why I cant see this part below when I run this
>>> command, python manage.py makemigrations polls,?
>>>
>>> <<<>>
>>>   0001_initial.py:
>>> - Create model Question
>>> - Create model Choice
>>> - Add field question to choice>
>>>
>>>
>>> I saw just that screen shut.
>>>
>>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/17fde7c1-fd2c-4d4a-92ec-058bc448b298%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Tarık Kantar

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGgwCPFPy2jqfZ%2BHJK1UZg-Ty4NeHUmt15qVG0BZwno_ULXTeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread Kuber Sodari
I see the problem is with 


*class Choice(models.Model) question = models.ForeignKey(Question) *
Update it as this

*class Choice(models.Model) question = 
models.ForeignKey(Question, on_delete=models.CASCADE) *

*CASCADE: *What this does it, when you delete the related object of 
Question, it will also delete the Choice object 
if you don't want that and when deleting Question object, if you want the 
choice object should remain even after then simple do this instead of 
CASCADE
*models.SET_NULL*

On Monday, 14 January 2019 15:38:09 UTC+5:45, tarikk...@gmail.com wrote:
>
> This my screenshut of models.py
>
> 14 Ocak 2019 Pazartesi 10:43:32 UTC+1 tarihinde tarikk...@gmail.com yazdı:
>>
>> Hi everyone!
>> Could you please help me why I cant see this part below when I run this 
>> command, python manage.py makemigrations polls,?
>>
>> <<<>
>>   0001_initial.py:
>> - Create model Question
>> - Create model Choice
>> - Add field question to choice>
>>
>>
>> I saw just that screen shut.
>>
>>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/17fde7c1-fd2c-4d4a-92ec-058bc448b298%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread Kuber Sodari
I see the problem is with 


*class Choice(models.Model) question = models.ForeignKey(Question) *
Update it as this

*class Choice(models.Model) question = models.ForeignKey(Question, 
on_delete=models.CASCADE) *

On Monday, 14 January 2019 15:38:09 UTC+5:45, tarikk...@gmail.com wrote:
>
> This my screenshut of models.py
>
> 14 Ocak 2019 Pazartesi 10:43:32 UTC+1 tarihinde tarikk...@gmail.com yazdı:
>>
>> Hi everyone!
>> Could you please help me why I cant see this part below when I run this 
>> command, python manage.py makemigrations polls,?
>>
>> <<<>
>>   0001_initial.py:
>> - Create model Question
>> - Create model Choice
>> - Add field question to choice>
>>
>>
>> I saw just that screen shut.
>>
>>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2dc41ed0-765c-4b87-bb28-dc604a50f966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread tarikkantar25
This my screenshut of models.py

14 Ocak 2019 Pazartesi 10:43:32 UTC+1 tarihinde tarikk...@gmail.com yazdı:
>
> Hi everyone!
> Could you please help me why I cant see this part below when I run this 
> command, python manage.py makemigrations polls,?
>
> <<<
>   0001_initial.py:
> - Create model Question
> - Create model Choice
> - Add field question to choice>
>
>
> I saw just that screen shut.
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3bff162d-4253-444d-86ee-9634db2b28ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread Kuber Sodari
Can you screenshot and paste the Model Class for that? The one with Foreign 
Key on Polls. It should have on_delete=models.SET_NULL or on_delete
=models.CASCADE

On Monday, 14 January 2019 15:28:32 UTC+5:45, tarikk...@gmail.com wrote:
>
> Hi everyone!
> Could you please help me why I cant see this part below when I run this 
> command, python manage.py makemigrations polls,?
>
> <<<
>   0001_initial.py:
> - Create model Question
> - Create model Choice
> - Add field question to choice>
>
>
> I saw just that screen shut.
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6d81c402-0c38-4ba2-be77-6281db61692e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread Tarık Kantar
No, how should I do?

On 14 Jan 2019 Mon at 10:47 Kuber Sodari  wrote:

> Did you import the Model changes on init file of Model??
>
> On Monday, 14 January 2019 15:28:32 UTC+5:45, tarikk...@gmail.com wrote:
>>
>> Hi everyone!
>> Could you please help me why I cant see this part below when I run this
>> command, python manage.py makemigrations polls,?
>>
>> <<<>
>>   0001_initial.py:
>> - Create model Question
>> - Create model Choice
>> - Add field question to choice>
>>
>>
>> I saw just that screen shut.
>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/61a2c4dc-bfd9-47a3-9916-f78c24052c10%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Tarık Kantar

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGgwCPF385Lo12T9i5ou4Fcw_gSi2d-KLx83JGM-SrYna-L5fA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO-POLLS

2019-01-14 Thread Kuber Sodari
Did you import the Model changes on init file of Model??

On Monday, 14 January 2019 15:28:32 UTC+5:45, tarikk...@gmail.com wrote:
>
> Hi everyone!
> Could you please help me why I cant see this part below when I run this 
> command, python manage.py makemigrations polls,?
>
> <<<
>   0001_initial.py:
> - Create model Question
> - Create model Choice
> - Add field question to choice>
>
>
> I saw just that screen shut.
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61a2c4dc-bfd9-47a3-9916-f78c24052c10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


DJANGO-POLLS

2019-01-14 Thread tarikkantar25
Hi everyone!
Could you please help me why I cant see this part below when I run this 
command, python manage.py makemigrations polls,?

<<<


I saw just that screen shut.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0c8af8e5-a318-48ae-9674-79e489f40582%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


part time or full time job opportunity for Django developers

2019-01-14 Thread Atul Anand
Hi All,

I am in search for Django developer for a project.

Interested candidate may share his/her resume with you at
atul.anand.n...@gmail.com


Regards,
Atul

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKHpVdSJuJp1C0A%3D00mKJBe5SGSoHtt7NGAbksAix9eyNUEXLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.