Re: OSError: [Errno 13] Permission denied:... /_dummy_thread

2017-11-05 Thread Vineet Kothari
try to update your python :
https://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip

On Mon, Nov 6, 2017 at 12:10 AM, Mel DeJesus  wrote:

> Do that only leads to another permission denied error -
>
> Installing collected packages: argparse, configparser, konfig, pyzmq,
> inflect, jaraco.itertools, tempora, jaraco.stream, jaraco.classes,
> backports.functools-lru-cache, jaraco.functools, jaraco.text,
> jaraco.collections, jaraco.logging, irc, webob, WSGIProxy2, greenlet,
> gevent, psutil, waitress, beautifulsoup4, webtest, ws4py, ujson, loads
> Exception:
> Traceback (most recent call last):
>   File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215,
> in main
> status = self.run(options, args)
>   File "/Library/Python/2.7/site-packages/pip/commands/install.py", line
> 342, in run
> prefix=options.prefix_path,
>   File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784,
> in install
> **kwargs
>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line
> 851, in install
> self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line
> 1064, in move_wheel_files
> isolated=self.isolated,
>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 377, in
> move_wheel_files
> clobber(source, dest, False, fixer=fixer, filter=filter)
>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 287, in
> clobber
> ensure_dir(dest)  # common for the 'include' path
>   File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line
> 83, in ensure_dir
> os.makedirs(path)
>   File 
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py",
> line 157, in makedirs
> mkdir(name, mode)
> OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/
> Python.framework/Versions/2.7/include/python2.7/greenlet'
>
>
> On Sunday, November 5, 2017 at 1:36:18 PM UTC-5, Mel DeJesus wrote:
>>
>> as in:
>> sudo pip install -r requirements.txt
>> ?
>>
>> On Sunday, November 5, 2017 at 1:33:07 PM UTC-5, me.vineetkothari wrote:
>>>
>>> Use sudo
>>>
>>> On Nov 6, 2017 12:00 AM, "Mel DeJesus"  wrote:
>>>
>>>
>>>
>>> Any suggestions? -->
>>>
>>> After attempting pip install -r requirements.txt in a virtual
>>> environment, I got a number of files loaded before getting this:
>>>
>>>
>>> Exception:
>>> Traceback (most recent call last):
>>>   File "/Library/Python/2.7/site-packages/pip/basecommand.py", line
>>> 215, in main
>>> status = self.run(options, args)
>>>   File "/Library/Python/2.7/site-packages/pip/commands/install.py",
>>> line 342, in run
>>> prefix=options.prefix_path,
>>>   File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line
>>> 784, in install
>>> **kwargs
>>>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line
>>> 851, in install
>>> self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
>>>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line
>>> 1064, in move_wheel_files
>>> isolated=self.isolated,
>>>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in
>>> move_wheel_files
>>> clobber(source, lib_dir, True)
>>>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in
>>> clobber
>>> ensure_dir(destdir)
>>>   File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line
>>> 83, in ensure_dir
>>> os.makedirs(path)
>>>   File 
>>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py",
>>> line 157, in makedirs
>>> mkdir(name, mode)
>>> OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-pack
>>> ages/_dummy_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-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/ms
>>> gid/django-users/14fac784-dfdb-481b-b6bc-bf03f8499871%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/c204f9f5-ed1d-423

Re: Exception Value: UNIQUE constraint failed: accounts_profile.user_id

2017-11-05 Thread Luiz Guilherme Schiefler de Arruda
Hello,

I got your solution. Just one question, as I posted, I am using CBV. How 
can I do it using CBV?

Thanks,

Luiz

Em sábado, 4 de novembro de 2017 21:46:05 UTC-2, Jani Tiainen escreveu:
>
> Hi.
>
> Using formset to handle profile is a bit incorrect solution.
>
> See 
> http://musings.tinbrain.net/blog/2015/jun/10/updating-two-models-single-post/ 
> for proper solution.
>
> 5.11.2017 0.01 "Luiz Guilherme Schiefler de Arruda"  > kirjoitti:
>
>> Hello folks,
>>
>> I'm studying Django and everything was ok until this morning. After 
>> creating a form using inlineformset_factory, I can't create an user. I got 
>> this error when creating the user inside the form I've created:
>>
>> Exception Value: 
>>
>> UNIQUE constraint failed: accounts_profile.user_id
>>
>>
>> Analising and debugging a little, I think that the error occurs because, 
>> on this SQL line code (generated automatically by django) it tries to save 
>> a String inside an integer field (user_id).
>>
>>
>>- 
>>
>> /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/db/backends/utils.py
>> in execute
>>1. 
>>   
>>   return self.cursor.execute(sql, params)
>>   
>>   ...
>>▼ Local vars 
>>VariableValue
>>params 
>>
>>[19, '', None, None, 'F', '', '', '']
>>
>>self 
>>
>>
>>
>>sql 
>>
>>('INSERT INTO "accounts_profile" ("user_id", "location", "birthdate", 
>> "role", '
>> '"gender", "site_facebook", "site_twitter", "profile_picture") VALUES 
>> (%s, '
>> '%s, %s, %s, %s, %s, %s, %s)')
>>
>>
>>
>>
>>1. 
>>
>>profile_formset.save()
>>
>>...
>>
>> ▼ Local vars 
>> VariableValue
>> __class__ 
>>
>> 
>>
>> context 
>>
>> {'form': > fields=(username;email;password1;password2)>,
>>  'profile': ,
>>  'view': }
>>
>> form 
>>
>> > fields=(username;email;password1;password2)>
>>
>> profile_formset 
>>
>> 
>>
>> self 
>>
>> 
>>
>>
>>
>> Here is the codes:
>>
>> models.py
>> class Profile(models.Model):
>> user = models.OneToOneField(User, on_delete=models.CASCADE)
>> location = models.CharField(max_length=30, blank=True)
>> birthdate = models.DateField(null=True, blank=True)
>>
>> profile_picture = models.ImageField(upload_to='profile_pictures', 
>> blank=True)
>>
>> def __str__(self):
>> return self.user.username
>>
>> @property
>> def age(self):
>> TODAY = datetime.date.today()
>> if self.birthdate:
>> return u"%s" % relativedelta.relativedelta(TODAY, self.birthdate).years
>> else:
>> return None
>>
>> @receiver(post_save, sender=User)
>> def create_or_update_user_profile(sender, instance, created, **kwargs):
>> if created:
>> Profile.objects.create(user=instance)
>> instance.profile.save()
>>
>> forms.py
>> class FormSignUp(UserCreationForm):
>> email = forms.CharField(max_length=254, required=True, 
>> widget=forms.EmailInput())
>>
>> class Meta:
>> model = User
>> fields = ['username', 'email', 'password1', 'password2']
>>
>> class FormProfile(forms.ModelForm):
>> class Meta:
>> model = Profile
>> fields = ['birthdate', 'gender', 'site_facebook', 'site_twitter', 
>> 'profile_picture']
>>
>> FormSetProfile = inlineformset_factory(User, Profile, form=FormProfile)
>>
>>
>>
>>
>> view.py
>> class CreateUser(CreateView):
>> form_class = FormSignUp
>> template_name = 'signup.html'
>> success_url = reverse_lazy('home')
>>
>> def get_context_data(self, **kwargs):
>> data = super(CreateUser, self).get_context_data(**kwargs)
>> if self.request.POST:
>> data['profile'] = FormSetProfile(self.request.POST)
>> else:
>> data['profile'] = FormSetProfile()
>> return data
>>
>> def form_valid(self, form):
>> context = self.get_context_data()
>> profile_formset = context['profile']
>>
>>
>> with transaction.atomic():
>> form.instance.created_by = self.request.user
>> form.instance.updated_by = self.request.user
>> self.object = form.save()
>> if profile_formset.is_valid():
>> profile_formset.instance = self.object
>> profile_formset.save() # Linha onde está dando o erro
>>
>> return super(CreateUser, self).form_valid(form)
>>
>> Thanks for your help
>>
>> Luiz Guilherme
>>
>> -- 
>> 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/ec6cbe06-6252-408f-a36c-7b863b33ad6c%40googlegroups.com
>>  
>> 

Re: is anybody in NYC?

2017-11-05 Thread Larry Martell
On Sun, Nov 5, 2017 at 5:01 PM, li qiongyao  wrote:
> is anybody in NYC?

No, everyone left.

-- 
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/CACwCsY5xXpbBtRpLEPTK-e1Y2hOmudktydNEFO-rPHvQC6KsLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: is anybody in NYC?

2017-11-05 Thread Huy T
+1 -- Upper West Side.

On Sun, Nov 5, 2017 at 5:01 PM, li qiongyao  wrote:

> is anybody in NYC?
>
> --
> 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/f01ba3d4-b9f2-4d20-a56a-eaf27bf4a8a5%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/CAMRgKmFhjbrciynK7q6WGVLm1jNUiZRjW%2B1%2BbDiUgiiwboXf8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


is anybody in NYC?

2017-11-05 Thread li qiongyao
is anybody in NYC?

-- 
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/f01ba3d4-b9f2-4d20-a56a-eaf27bf4a8a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ManytoMany field in Django admin not appearing

2017-11-05 Thread mohammad k
class UserAdminPanel(admin.ModelAdmin):
inlines = (UserPlaylist, UserVideos, UserComment, UserReplays, )
list_per_page = 20
fieldsets = (
(None, {'fields': ('username', )}),
(_('Personal info'), {'fields': ('first_name', 'last_name',
'email')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff',
'is_superuser',
   'groups', 'user_permissions')}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('username', 'password1', 'password2'),
}),
)
list_display = [
'username',
'email',
'last_name',
'user_reg',  # refer to Registration model
'is_staff',
]
list_filter = ('date_joined', 'is_staff', 'is_superuser', 'is_active',
'groups')
search_fields = [
'date_joined',
'email',
'first_name',
'last_name',
'username',
]
ordering = ['-date_joined', 'username']
filter_horizontal = ('groups', 'user_permissions',)

On Mon, Nov 6, 2017 at 12:32 AM, mohammad k  wrote:

> use this code for ManytoMany fields in django admin :
>
> filter_horizontal = ('groups', 'user_permissions',)
>
> On Fri, Nov 3, 2017 at 1:45 PM, Paul  wrote:
>
>> I have a Product model, an Image Model and a Category Model.
>>
>> A Product can have multiple Images(Foreign Key) and a Product can be in
>> multiple Categories a Category can contain multiple Products.
>>
>> A Category can have multiple subcategories(key to itself).
>>
>>
>> class Category(MetaData):
>>  parent = models.ForeignKey('self', blank=True, null=True, 
>> verbose_name='parent
>> category', on_delete=models.CASCADE)
>>
>> class ProductMetaData):
>>   categories = models.ManyToManyField(Category)
>>
>> class ProductImage(models.Model):
>>   product = models.ForeignKey(Product, related_name='image', on_delete=
>> models.CASCADE)
>>
>>
>>
>> In Product Django Admin:
>>
>> class ProductDocumentInline(admin.TabularInline):
>>  model = ProductDocument class ProductAdmin(MetaData):
>>  inlines = [ProductImageInline]
>>  fieldsets = (
>>  ('Product Data', {
>>  'fields': ('name', 'short_description', 'description')
>>  }),
>>  ('SEO', {
>>  'classes': ('collapse',),
>>  'fields': ('meta_title', 'meta_description', 'slug', 'canonical')
>>  }),
>>  ('MetaData', {
>>  'classes': ('collapse',),
>>  'fields': (('created_at', 'created_by'), ('updated_at', 'updated_by'))
>>  }),
>>  )
>>  readonly_fields = ('created_at', 'updated_at', 'created_by',
>> 'updated_by')
>>  list_display = ('name', 'updated_at')
>>  ordering = ('-updated_at',)
>>  search_fields = ('name',)
>>
>>
>> admin.site.register(Product, ProductAdmin)
>> admin.site.register(ProductImage)
>>
>>
>>
>> Issues:
>>
>>1.
>>
>>If I don't customize fieldsets (grouped, ordered) the Categories
>>appear like default in the middle of the form. If there are customized as
>>in my example they don't appear.
>>2.
>>
>>If they don't appear Products without Categories can be created and I
>>don't want that. I want a product to have at least one category.
>>3.
>>
>>Now the inline Images appear below all Product fields.
>>
>> I want the Categories to appear first, then normal fields for
>> Product(grouped,ordered), Images inline and at the end the SEO and metadata
>> fields. How can this be done ?
>>
>> --
>> 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/ms
>> gid/django-users/37bf83ae-cdca-4c73-8ace-747386513e53%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/CACOk0Ty8qYBHRiGY6VajbH5mh2o67gOw%3DwgJob0ktrx52-c8WQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ManytoMany field in Django admin not appearing

2017-11-05 Thread mohammad k
use this code for ManytoMany fields in django admin :

filter_horizontal = ('groups', 'user_permissions',)

On Fri, Nov 3, 2017 at 1:45 PM, Paul  wrote:

> I have a Product model, an Image Model and a Category Model.
>
> A Product can have multiple Images(Foreign Key) and a Product can be in
> multiple Categories a Category can contain multiple Products.
>
> A Category can have multiple subcategories(key to itself).
>
>
> class Category(MetaData):
>  parent = models.ForeignKey('self', blank=True, null=True, 
> verbose_name='parent
> category', on_delete=models.CASCADE)
>
> class ProductMetaData):
>   categories = models.ManyToManyField(Category)
>
> class ProductImage(models.Model):
>   product = models.ForeignKey(Product, related_name='image', on_delete=
> models.CASCADE)
>
>
>
> In Product Django Admin:
>
> class ProductDocumentInline(admin.TabularInline):
>  model = ProductDocument class ProductAdmin(MetaData):
>  inlines = [ProductImageInline]
>  fieldsets = (
>  ('Product Data', {
>  'fields': ('name', 'short_description', 'description')
>  }),
>  ('SEO', {
>  'classes': ('collapse',),
>  'fields': ('meta_title', 'meta_description', 'slug', 'canonical')
>  }),
>  ('MetaData', {
>  'classes': ('collapse',),
>  'fields': (('created_at', 'created_by'), ('updated_at', 'updated_by'))
>  }),
>  )
>  readonly_fields = ('created_at', 'updated_at', 'created_by', 'updated_by'
> )
>  list_display = ('name', 'updated_at')
>  ordering = ('-updated_at',)
>  search_fields = ('name',)
>
>
> admin.site.register(Product, ProductAdmin)
> admin.site.register(ProductImage)
>
>
>
> Issues:
>
>1.
>
>If I don't customize fieldsets (grouped, ordered) the Categories
>appear like default in the middle of the form. If there are customized as
>in my example they don't appear.
>2.
>
>If they don't appear Products without Categories can be created and I
>don't want that. I want a product to have at least one category.
>3.
>
>Now the inline Images appear below all Product fields.
>
> I want the Categories to appear first, then normal fields for
> Product(grouped,ordered), Images inline and at the end the SEO and metadata
> fields. How can this be done ?
>
> --
> 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/37bf83ae-cdca-4c73-8ace-747386513e53%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/CACOk0Tz4qDf_jb%2BRN8VRZyc3gxWaXY%2By-tV%3DfpgQY4DHPE-f%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: OSError: [Errno 13] Permission denied:... /_dummy_thread

2017-11-05 Thread Mel DeJesus
Do that only leads to another permission denied error - 

Installing collected packages: argparse, configparser, konfig, pyzmq, 
inflect, jaraco.itertools, tempora, jaraco.stream, jaraco.classes, 
backports.functools-lru-cache, jaraco.functools, jaraco.text, 
jaraco.collections, jaraco.logging, irc, webob, WSGIProxy2, greenlet, 
gevent, psutil, waitress, beautifulsoup4, webtest, ws4py, ujson, loads
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in 
main
status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 
342, in run
prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in 
install
**kwargs
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
1064, in move_wheel_files
isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 377, in 
move_wheel_files
clobber(source, dest, False, fixer=fixer, filter=filter)
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 287, in 
clobber
ensure_dir(dest)  # common for the 'include' path
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, 
in ensure_dir
os.makedirs(path)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", 
line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 1] Operation not permitted: 
'/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/greenlet'
 

On Sunday, November 5, 2017 at 1:36:18 PM UTC-5, Mel DeJesus wrote:
>
> as in: 
> sudo pip install -r requirements.txt 
> ?
>
> On Sunday, November 5, 2017 at 1:33:07 PM UTC-5, me.vineetkothari wrote:
>>
>> Use sudo
>>
>> On Nov 6, 2017 12:00 AM, "Mel DeJesus"  wrote:
>>
>>
>>
>> Any suggestions? --> 
>>
>> After attempting pip install -r requirements.txt in a virtual 
>> environment, I got a number of files loaded before getting this: 
>>
>>
>> Exception:
>> Traceback (most recent call last):
>>   File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, 
>> in main
>> status = self.run(options, args)
>>   File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 
>> 342, in run
>> prefix=options.prefix_path,
>>   File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, 
>> in install
>> **kwargs
>>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
>> 851, in install
>> self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
>>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
>> 1064, in move_wheel_files
>> isolated=self.isolated,
>>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in 
>> move_wheel_files
>> clobber(source, lib_dir, True)
>>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in 
>> clobber
>> ensure_dir(destdir)
>>   File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 
>> 83, in ensure_dir
>> os.makedirs(path)
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py",
>>  
>> line 157, in makedirs
>> mkdir(name, mode)
>> OSError: [Errno 13] Permission denied: 
>> '/Library/Python/2.7/site-packages/_dummy_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-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/14fac784-dfdb-481b-b6bc-bf03f8499871%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/c204f9f5-ed1d-4239-b64d-bac70b62c8b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OSError: [Errno 13] Permission denied:... /_dummy_thread

2017-11-05 Thread Mel DeJesus
as in: 
sudo pip install -r requirements.txt 
?

On Sunday, November 5, 2017 at 1:33:07 PM UTC-5, me.vineetkothari wrote:
>
> Use sudo
>
> On Nov 6, 2017 12:00 AM, "Mel DeJesus" > 
> wrote:
>
>
>
> Any suggestions? --> 
>
> After attempting pip install -r requirements.txt in a virtual environment, 
> I got a number of files loaded before getting this: 
>
>
> Exception:
> Traceback (most recent call last):
>   File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, 
> in main
> status = self.run(options, args)
>   File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 
> 342, in run
> prefix=options.prefix_path,
>   File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, 
> in install
> **kwargs
>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
> 851, in install
> self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
>   File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
> 1064, in move_wheel_files
> isolated=self.isolated,
>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in 
> move_wheel_files
> clobber(source, lib_dir, True)
>   File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in 
> clobber
> ensure_dir(destdir)
>   File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, 
> in ensure_dir
> os.makedirs(path)
>   File 
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py",
>  
> line 157, in makedirs
> mkdir(name, mode)
> OSError: [Errno 13] Permission denied: 
> '/Library/Python/2.7/site-packages/_dummy_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-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/14fac784-dfdb-481b-b6bc-bf03f8499871%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/549c04b0-7de3-460d-b7d9-fae2c2be7db5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OSError: [Errno 13] Permission denied:... /_dummy_thread

2017-11-05 Thread Vineet Kothari
Use sudo

On Nov 6, 2017 12:00 AM, "Mel DeJesus"  wrote:



Any suggestions? -->

After attempting pip install -r requirements.txt in a virtual environment,
I got a number of files loaded before getting this:


Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in
main
status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line
342, in run
prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in
install
**kwargs
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line
851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line
1064, in move_wheel_files
isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in
move_wheel_files
clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in
clobber
ensure_dir(destdir)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83,
in ensure_dir
os.makedirs(path)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py",
line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-
packages/_dummy_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-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/14fac784-dfdb-481b-b6bc-bf03f8499871%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/CAAcansvfsg0rqb3yqhh%3D0f7AffjMSLLwnprL6GYE-m6Li0LPig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


OSError: [Errno 13] Permission denied:... /_dummy_thread

2017-11-05 Thread Mel DeJesus


Any suggestions? --> 

After attempting pip install -r requirements.txt in a virtual environment, 
I got a number of files loaded before getting this: 


Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in 
main
status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 
342, in run
prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in 
install
**kwargs
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 
1064, in move_wheel_files
isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in 
move_wheel_files
clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in 
clobber
ensure_dir(destdir)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, 
in ensure_dir
os.makedirs(path)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", 
line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: 
'/Library/Python/2.7/site-packages/_dummy_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-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/14fac784-dfdb-481b-b6bc-bf03f8499871%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Seeking design guidance on a Team model where a user sends invitation to other users to join the team

2017-11-05 Thread shreekant bohra
You don't need to download source code if you have installed via pip. You
can add it to INSTALLED_APPS list in settings.py and follow other
instructions given in their github page.

--
Shree Kant Bohra
Co-founder
Geekybuddha Technologies




On Sun, Nov 5, 2017 at 7:46 PM, Jack  wrote:

> Thanks, I'm looking into it and you are right, it seems quite fitting for
> my project.
>
> Stupid question as I've never used a 3rd party app before...  Am I
> supposed to download the source code and put that into my project folder?
> I already did 'pip install django-invitations'.
>
> On Saturday, November 4, 2017 at 11:49:19 PM UTC-4, Shree Kant Bohra wrote:
>>
>> Check out django-invitations app, which does exactly what you need -
>> https://github.com/bee-keeper/django-invitations
>>
>>
>> --
>> Shree Kant Bohra
>> Co-founder
>> Geekybuddha Technologies
>>
>>
>>
>>
>> On Sun, Nov 5, 2017 at 8:57 AM, Jack  wrote:
>>
>>> I have a model called *Team*, which has a ForeignKey relationship with
>>> *User* (a team can have many users, but a user can only be part of one
>>> team).
>>>
>>> A user can create a team, and that user will automatically become a *Team
>>> Leader* (a group, not a model).  The team leader can query the database
>>> for other users and send invitations to other users join his team.  Users
>>> who receive an invitation can either accept or decline the invitation; if a
>>> user accepts an invitation, he joins the team as as a *Team Member*
>>>
>>> My question is, how do I go about designing the invitation system?
>>> After the team leader clicks the 'Send Invitation' button, the
>>> receiving-user should see a special invitation message on his dashboard,
>>> which he can either accept or decline.
>>>
>>> My current thinking tells me I should create a model called *Invitation*
>>> which has a OneToOne relationship with User.  When an invitation is sent,
>>> an instance of Invitation is created which is assigned to the
>>> receiving-user.  The invitation instance will be deleted when the
>>> receiving-user accepts or declines the invitation.
>>>
>>> Another method I can think of is to send an Email to the
>>> receiving-user.  The Email will be like an account activation Email, except
>>> the activation link adds the receiving-user to the team and marks the
>>> receiving-user as a *team member.*
>>>
>>> Pointers and guidance welcome.  I feel like both my methods are clumsy
>>> and maybe there is a built-in feature in Django which I missed which could
>>> solve this problem much easier.
>>>
>>> --
>>> 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/ms
>>> gid/django-users/029d4382-fdb2-4fc5-8832-337e1f870e24%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/6c96ca21-20e9-49b4-9f17-407abcc66ea8%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/CAD5EYcoh%2BC7GCOesy%2B8dBdP9mFTs5qxov9LJuRmORXSOeUHEqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Seeking design guidance on a Team model where a user sends invitation to other users to join the team

2017-11-05 Thread Jack
Thanks, I'm looking into it and you are right, it seems quite fitting for 
my project.

Stupid question as I've never used a 3rd party app before...  Am I supposed 
to download the source code and put that into my project folder?  I already 
did 'pip install django-invitations'. 

On Saturday, November 4, 2017 at 11:49:19 PM UTC-4, Shree Kant Bohra wrote:
>
> Check out django-invitations app, which does exactly what you need - 
> https://github.com/bee-keeper/django-invitations
>
>
> --
> Shree Kant Bohra
> Co-founder 
> Geekybuddha Technologies
>
>
>
>
> On Sun, Nov 5, 2017 at 8:57 AM, Jack > 
> wrote:
>
>> I have a model called *Team*, which has a ForeignKey relationship with 
>> *User* (a team can have many users, but a user can only be part of one 
>> team).
>>
>> A user can create a team, and that user will automatically become a *Team 
>> Leader* (a group, not a model).  The team leader can query the database 
>> for other users and send invitations to other users join his team.  Users 
>> who receive an invitation can either accept or decline the invitation; if a 
>> user accepts an invitation, he joins the team as as a *Team Member*
>>
>> My question is, how do I go about designing the invitation system?  After 
>> the team leader clicks the 'Send Invitation' button, the receiving-user 
>> should see a special invitation message on his dashboard, which he can 
>> either accept or decline.
>>
>> My current thinking tells me I should create a model called *Invitation* 
>> which has a OneToOne relationship with User.  When an invitation is sent, 
>> an instance of Invitation is created which is assigned to the 
>> receiving-user.  The invitation instance will be deleted when the 
>> receiving-user accepts or declines the invitation.
>>
>> Another method I can think of is to send an Email to the receiving-user.  
>> The Email will be like an account activation Email, except the activation 
>> link adds the receiving-user to the team and marks the receiving-user as a 
>> *team 
>> member.*
>>
>> Pointers and guidance welcome.  I feel like both my methods are clumsy 
>> and maybe there is a built-in feature in Django which I missed which could 
>> solve this problem much easier.
>>
>> -- 
>> 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/029d4382-fdb2-4fc5-8832-337e1f870e24%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/6c96ca21-20e9-49b4-9f17-407abcc66ea8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: tutorial site not working

2017-11-05 Thread Vijay Khemlani
did you keep the manage.py shell open while making the code changes? you
need to close/open it again

On Sat, Nov 4, 2017 at 10:36 PM, Kyle Foley  wrote:

> Let me also show what I have placed in the terminal
>
> >>> Question.objects.get(pk=1)
>
> 
>
> >>> q = Question.objects.get(pk=1)
>
> >>> q.was_published_recently()
>
> I also don't understand why I am outputting:
>
> 
>
> And the website says the output should be:
>
> 
>
>
>
> --
> 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/6087580b-5be3-484e-a929-d0e4e6a7ad5c%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/CALn3ei1b2AHyRsNA3fHMwPtnUAhTAKJpC%2BZsrsWaQ7%3Dds%3DKg7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.