bulk copy data from 1 model to another in django

2016-01-12 Thread Rahul Jha
I am having 2 model of similar schema and I want to bulk copy from model1 
to model2  but model2 is having 3 more fields but I want to store null in 
these fields. 


class SubscriberBalanceProcess(models.Model):


VOICE_SOC = models.CharField(max_length=50, null=True)
SMS_SOC = models.CharField(max_length=50, null=True)
DATA_SOC = models.CharField(max_length=50, null=True)
DATE_TIME = models.DateTimeField(auto_now_add=True, blank=True)
TOTAL_REMAIN_VOICE = models.BigIntegerField(default=0, null=True, 
blank=True)
TOTAL_REMAIN_SMS = models.BigIntegerField(default=0, null=True, 
blank=True)
TOTAL_REMAIN_DATA = models.BigIntegerField(max_length=100, null=True, 
blank=True)


class Meta:
db_table = "SUBSCRIBER_BALANCE_PROCESS_TEST"

class SubscriberBalance(models.Model):


VOICE_SOC = models.CharField(max_length=50, null=True)
SMS_SOC = models.CharField(max_length=50, null=True)
DATA_SOC = models.CharField(max_length=50, null=True)
DATE_TIME = models.DateTimeField(auto_now_add=True, blank=True)
FILE_ID = models.CharField(max_length=255, null=True)


class Meta:
db_table = 'subscriber_balance'




SubscriberBalanceProcess.objects.bulk_create(SubscriberBalance.objects.filter(VOICE_STATUS='N',
 
SMS_FLAG=1, TENANT_ID__in=loginIdList))



Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 353, in execute_from_command_line
utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 
348, in run_from_argv
self.execute(*args, **cmd_options)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 
399, in execute
output = self.handle(*args, **options)
  File 
"C:\Users\Development\Desktop\python\crons\management\commands\sendsms_voicebalance_process_rule_tarif.py",
 
line 74, in handle
self.sendsmsVoicebalance()
  File 
"C:\Users\Development\Desktop\python\crons\management\commands\sendsms_voicebalance_process_rule_tarif.py",
 
line 30, in sendsms
Voicebalance
activeMVNO = Functions.updateNonRuleMatchRecordByTarif(categoryId, type)
  File "C:\Users\Development\Desktop\python\crons\includes\functions.py", 
line 49, in updateNonRuleMatchRecordByTarif
Functions.truncateUpdateVoice(loginIdList)
  File "C:\Users\Development\Desktop\python\crons\includes\functions.py", 
line 64, in truncateUpdateVoice

SubscriberBalanceProcess.objects.bulk_create(SubscriberBalance.objects.filter(VOICE_STATUS='N',
 
SMS_FLAG=1, TENANT_ID__in=loginIdL
ist))
  File "C:\Python27\lib\site-packages\django\db\models\manager.py", line 
122, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 447, 
in bulk_create
self._batched_insert(objs_with_pk, fields, batch_size)
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 
1056, in _batched_insert
using=self.db)
  File "C:\Python27\lib\site-packages\django\db\models\manager.py", line 
122, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 
1039, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
  File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", 
line 1059, in execute_sql
for sql, params in self.as_sql():
  File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", 
line 1019, in as_sql
for obj in self.query.objs
  File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", 
line 968, in pre_save_val
return field.pre_save(obj, add=True)
  File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 702, in pre_save
return getattr(model_instance, self.attname)

AttributeError: 'SubscriberBalance' object has no attribute 
'TOTAL_REMAIN_VOICE'

-- 
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/1492bab8-5cbc-4308-97ab-4fc381d94a7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.8 , makemigrations throwing errors

2016-01-12 Thread Atul kumar Gupta
Thanks Christoph , Solved my problem.
Love you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To 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/788792fd-6f1e-4a17-a9c9-ba501a472427%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading to 1.9 - Any Easy Guide ?

2016-01-12 Thread Vibhu Rishi
Hi Tom

So essentially you are saying to go with upgrade to 1.7 - fix issues and
then to 1.8 etc ?

V.
On Jan 11, 2016 11:45 PM, "'Tom Evans' via Django users" <
django-users@googlegroups.com> wrote:

> On Mon, Jan 11, 2016 at 4:36 PM, Vibhu Rishi 
> wrote:
> > Hi
> >
> > I work on a hobby project on and off which is based on django. After a
> long
> > gap, I picked up the work again. In the meantime, it seems that django
> has
> > been evolving faster than I have been working. I am currently on 1.6
> (which
> > I think i had upgraded from 1.4 or 1.3 as my starting base). However, the
> > current new version of Django is 1.9
> >
> > I created a new virtual environment and used pip to get the latest
> version
> > of django.
> >
> > Now I am getting a lot of errors.
>
> That is the hard way.
>
> >
> > Is there an easy way to upgrade django ? Or a howto for best practices ?
> >
>
> (Releases have version components: "1.9.1" is major release 1, minor
> release 9, minor-minor release 1)
>
> If you are on release 1.N, update to release 1.N+1.Y (with Y being the
> highest released minor-minor version), and step through its release
> notes dealing with all the things which have changed or been
> deprecated, and update them accordingly. Run your test suite to
> determine if anything has been broken (pro tip: tests are useful - you
> might want to write some if you don't already test your most common
> features)
>
> Then, do the next minor release until you reach the latest release.
>
> A more complete process would be to update to 1.N+1, ensure tests pass
> and deprecated behaviour handled, THEN subsequently to 1.N+1.Y, ensure
> tests pass and only then go to the next minor version. That can be a
> bit paranoid, as (deliberately) not much functionality or breaking
> changes are added in minor-minor releases of django.
>
> Release notes are here:
> https://docs.djangoproject.com/en/1.9/releases/
>
> Cheers
>
> Tom
>
> PS: Best practices are not to fall that far behind!
>
> --
> 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/CAFHbX1LiKM3pzb1bAFTk88iLmbJKWpEaa3NTMdsVw3WJ%2BRwbdw%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/CAPiONwn%3DWyB_k1L2pHz%2BBu1bmhQFX_Bd0SmAH4o4%2BC3Brj99rQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading to 1.9 - Any Easy Guide ?

2016-01-12 Thread André Jarussi
Hello,

I recently had to upgrade from Django 1.4 to 1.8 (not quite ready for 1.9) 
... I made the upgrade with the minor realeases .. I didn't had much 
trouble with the patches ..

basically .. 1.4 to 1.5 .. deploy .. see whats wrong .. 1.5 to 1.6 .. 
deploy .. see whats wrong ..  until you reach the version you wanna stay.

It's a lot less painfull .. and boring.

Read the release notes before starting any upgrade. It really helps you 
have an understading on what's changing and how that affects you.

https://docs.djangoproject.com/en/stable/releases/1.5/


Good luck!!


On Tuesday, January 12, 2016 at 10:36:28 AM UTC-2, Vibhu Rishi wrote:
>
> Hi Tom
>
> So essentially you are saying to go with upgrade to 1.7 - fix issues and 
> then to 1.8 etc ?
>
> V.
> On Jan 11, 2016 11:45 PM, "'Tom Evans' via Django users" <
> django...@googlegroups.com > wrote:
>
>> On Mon, Jan 11, 2016 at 4:36 PM, Vibhu Rishi > > wrote:
>> > Hi
>> >
>> > I work on a hobby project on and off which is based on django. After a 
>> long
>> > gap, I picked up the work again. In the meantime, it seems that django 
>> has
>> > been evolving faster than I have been working. I am currently on 1.6 
>> (which
>> > I think i had upgraded from 1.4 or 1.3 as my starting base). However, 
>> the
>> > current new version of Django is 1.9
>> >
>> > I created a new virtual environment and used pip to get the latest 
>> version
>> > of django.
>> >
>> > Now I am getting a lot of errors.
>>
>> That is the hard way.
>>
>> >
>> > Is there an easy way to upgrade django ? Or a howto for best practices ?
>> >
>>
>> (Releases have version components: "1.9.1" is major release 1, minor
>> release 9, minor-minor release 1)
>>
>> If you are on release 1.N, update to release 1.N+1.Y (with Y being the
>> highest released minor-minor version), and step through its release
>> notes dealing with all the things which have changed or been
>> deprecated, and update them accordingly. Run your test suite to
>> determine if anything has been broken (pro tip: tests are useful - you
>> might want to write some if you don't already test your most common
>> features)
>>
>> Then, do the next minor release until you reach the latest release.
>>
>> A more complete process would be to update to 1.N+1, ensure tests pass
>> and deprecated behaviour handled, THEN subsequently to 1.N+1.Y, ensure
>> tests pass and only then go to the next minor version. That can be a
>> bit paranoid, as (deliberately) not much functionality or breaking
>> changes are added in minor-minor releases of django.
>>
>> Release notes are here:
>> https://docs.djangoproject.com/en/1.9/releases/
>>
>> Cheers
>>
>> Tom
>>
>> PS: Best practices are not to fall that far behind!
>>
>> --
>> 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/CAFHbX1LiKM3pzb1bAFTk88iLmbJKWpEaa3NTMdsVw3WJ%2BRwbdw%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/3f247925-dc62-4109-8add-379ce704b8c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django job opportunity in Bordeaux, France

2016-01-12 Thread bruno desthuilliers
We're looking for a Python / Django dev : 
http://emploi.alsacreations.com/offre-565470-Developpeur-django-python.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 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/ed27fc12-ca66-4be7-bec2-c09ea764d0a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Strange behaviour of filter() on related model (RelatedManager) - django 1.9.1

2016-01-12 Thread Balázs Oroszi
Hi,

I noticed something strange with filtering related objects. Below is a 
complete sample demonstrating the problem. This is only for demonstrating 
the problem.
Django version is 1.9.1

Given the model in a "testapp" app:


from django.db import models

class Blog(models.Model):
title = models.CharField(max_length=100)
# subscribers - related from Person
# subscriptions - related from Subscription

def __str__(self):
return self.title

class Person(models.Model):
name = models.CharField(max_length=100)
subscribed_blogs = models.ManyToManyField(Blog, 
related_name="subscribers", through="Subscription")
# subscriptions - related from Subscription

def __str__(self):
return self.name

class Subscription(models.Model):
person = models.ForeignKey(Person, related_name="subscriptions")
blog = models.ForeignKey(Blog, related_name="subscriptions")
subscribed_date = models.DateField()

def __str__(self):
return ''.join([self.person.name, " - ", self.blog.title])



When I filter "subscribers" of a Blog instance, the results are not 
consistent.
Here is the code demonstrating the effect:



from testapp.models import *
from datetime import datetime

adam = Person.objects.create(name="Adam")
blog_1 = Blog.objects.create(title="Blog 1")
blog_2 = Blog.objects.create(title="Blog 2")
Subscription.objects.create(person=adam, blog=blog_1, 
subscribed_date=datetime(2016,1,10))
Subscription.objects.create(person=adam, blog=blog_2, 
subscribed_date=datetime(2016,1,20))

queryparams = {"subscriptions__subscribed_date__gt": datetime(2016,1,15)}

q1 = blog_1.subscribers.filter(**queryparams)
q2 = blog_1.subscribers.all().filter(**queryparams)
q3 = blog_1.subscribers.get_queryset().filter(**queryparams)
print(q1.query)
print(q1)
print(q2.query)
print(q2)
print(q3.query)
print(q3)

print("--")

q1 = blog_1.subscribers.filter().filter(**queryparams)
q2 = blog_1.subscribers.all().all().filter(**queryparams)
q3 = blog_1.subscribers.get_queryset().all().filter(**queryparams)
print(q1.query)
print(q1)
print(q2.query)
print(q2)
print(q3.query)
print(q3)



The output is:


SELECT "testapp_person"."id", "testapp_person"."name" FROM "testapp_person" 
INNER JOIN "testapp_subscription" ON ("testapp_person"."id" = 
"testapp_subscription"."person_id") WHERE ("testapp_subscription"."blog_id" 
= 1 AND "testapp_subscription"."subscribed_date" > 2016-01-15)
[]
SELECT "testapp_person"."id", "testapp_person"."name" FROM "testapp_person" 
INNER JOIN "testapp_subscription" ON ("testapp_person"."id" = 
"testapp_subscription"."person_id") WHERE ("testapp_subscription"."blog_id" 
= 1 AND "testapp_subscription"."subscribed_date" > 2016-01-15)
[]
SELECT "testapp_person"."id", "testapp_person"."name" FROM "testapp_person" 
INNER JOIN "testapp_subscription" ON ("testapp_person"."id" = 
"testapp_subscription"."person_id") WHERE ("testapp_subscription"."blog_id" 
= 1 AND "testapp_subscription"."subscribed_date" > 2016-01-15)
[]
--
SELECT "testapp_person"."id", "testapp_person"."name" FROM "testapp_person" 
INNER JOIN "testapp_subscription" ON ("testapp_person"."id" = 
"testapp_subscription"."person_id") INNER JOIN "testapp_subscription" T4 ON 
("testapp_person"."id" = T4."person_id") WHERE 
("testapp_subscription"."blog_id" = 1 AND T4."subscribed_date" > 2016-01-15)
[]
SELECT "testapp_person"."id", "testapp_person"."name" FROM "testapp_person" 
INNER JOIN "testapp_subscription" ON ("testapp_person"."id" = 
"testapp_subscription"."person_id") INNER JOIN "testapp_subscription" T4 ON 
("testapp_person"."id" = T4."person_id") WHERE 
("testapp_subscription"."blog_id" = 1 AND T4."subscribed_date" > 2016-01-15)
[]
SELECT "testapp_person"."id", "testapp_person"."name" FROM "testapp_person" 
INNER JOIN "testapp_subscription" ON ("testapp_person"."id" = 
"testapp_subscription"."person_id") INNER JOIN "testapp_subscription" T4 ON 
("testapp_person"."id" = T4."person_id") WHERE 
("testapp_subscription"."blog_id" = 1 AND T4."subscribed_date" > 2016-01-15)
[]


The first set of queries simply "AND" the filter params with the 
"subscribers" RelatedManager's inherent related-filtering, while the second 
set of queries do a separate chain filtering.
This is exactly the kind of situation that is described in the django docs 
(with the blogs, "Lennon" and "2008"):
https://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships

I believe the second set of queries should be the correct one, and that 
should be happening also in the first set of queries, but that is not what 
is happening.

Am I missing something or does this seem like a bug?

Greets,
Balázs


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

Admin is still annoying regarding model save(), and model post_save signals.

2016-01-12 Thread Luis Masuelli
If you want to perform additional logic when you save your model...
   
class MyModel(models.Model):

#...

def save(self, *args, **kwargs):
self.a_rel_model_set.add(O)
super(MyModel, self).save(*args, **kwargs)
self.another_rel_model_set.add(O2)

Or similar login in pre_save and post_save signals, since they are 
many2many fields, they will be overriden on an admin form, since the 
form.save_m2m is called *after* the model save, and whatever changes I do 
on those signals, will be wiped out.

The logic I had to put it in log_change (ModelAdmin method). I don't know 
whether it is the appropriate method, but is the first method executed 
*after* model saving. Is it the appropriate method for that? Admin 
post-save logic... or should we have an additional method in the admin for 
that?

-- 
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/2a1d230f-1dee-4f2b-8a07-3f9f06ee60e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin is still annoying regarding model save(), and model post_save signals.

2016-01-12 Thread Luis Masuelli
Notes: This is only annoying when the logic involves many2many fields.

-- 
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/12c53143-dfb7-44c8-96bc-9a6de447b547%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


invalid literal for int() with base 10: '' using FormSet with File Upload

2016-01-12 Thread Néstor Boscán
Hi Django Forum

I'm working on a web application that has a page with form set that 
requires file upload. When I upload the files I get:

Django Version:1.9.1Exception Type:ValueErrorException Value:

invalid literal for int() with base 10: ''

Exception 
Location:C:\desarrollo\Python27\lib\site-packages\django\db\models\fields\__init__.py
 
in get_prep_value, line 976Python Executable:
C:\desarrollo\Python27\python.exePython Version:2.7.3

On this line of code:

study_form_set = DiagnosticStudyFormSet(request.POST, request.FILES, 
prefix='studies', 
queryset=DiagnosticStudy.objects.filter(diagnostic__id=pk))

My model:

class DiagnosticStudy(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(verbose_name='Name', max_length=255)
link = models.CharField(verbose_name='Link', max_length=255, 
blank=True, null=True)
path = models.FileField(upload_to='files', max_length=255, blank=True, 
null=True)
diagnostic = models.ForeignKey(Diagnostic, blank=True, null=True)
study_type = models.ForeignKey(StudyType, blank=True, null=True)
class Meta:
managed = False
db_table = 't_udm_diagnostic_study'

My forms:

class DiagnosticStudyForm(ModelForm):
class Meta(object):
model = DiagnosticStudy
fields = [ 'id', 'name', 'link', 'path', 'study_type' ]
widgets = {
   'id': HiddenInput(attrs={ 'class': 'campo' }),
'name': TextInput(attrs={ 'class': 'campo', 'size': '40', 
'onchange': 'validate(this)' }),
'link': TextInput(attrs={ 'class': 'campo', 'size': '40', 'onchange': 
'validate(this)' }),
'path': FileInput(attrs={ 'class': 'campo', 'size': '40', 'accept': 
'image/gif,image/jpeg,image/pjpeg,image/png,image/tiff,image/x-tiff,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation',
 
'onchange': 'validate(this)' }),
'study_type': HiddenInput(attrs={ 'class': 'campo', 'size': '40', 
'onchange': 'validate(this)' }),
}

DiagnosticStudyFormSet = modelformset_factory(DiagnosticStudy, 
form=DiagnosticStudyForm, extra=5, can_delete=True)

The Form does not have a IntegerField only CharFields and ForeignKeys. Any 
ideas on how to know which field is generating the error?

Regards,

Néstor

-- 
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/00b3ccfa-d092-4027-97fe-31fd6a828129%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Compilation Error while installing

2016-01-12 Thread Kshitij Saraogi
Hello,

I was installing django via pip and I got a few errors. Here is the 
traceback:

➜  ~  pip3 install Django
Downloading/unpacking Django
  Downloading Django-1.9.1-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: Django
*** Error compiling 
'/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/apps.py'...
  File "/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/apps.py", 
line 1
{{ unicode_literals }}from django.apps import AppConfig
 ^
SyntaxError: invalid syntax


*** Error compiling 
'/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/models.py'...
  File "/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/models.py", 
line 1
{{ unicode_literals }}from django.db import models
 ^
SyntaxError: invalid syntax


Successfully installed Django
Cleaning up...

I wanted to know why this is happening ?
Also, how should I fix it if this is something to worry about ?

-- 
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/0eff4689-4257-4f6e-9cfe-e0b5842e25d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Compilation Error while installing

2016-01-12 Thread Simon Charette
Hi,

These warnings are safe to ignore, please see 1.9 release notes for more 
details 

.

Simon

Le mardi 12 janvier 2016 12:06:43 UTC-5, Kshitij Saraogi a écrit :
>
> Hello,
>
> I was installing django via pip and I got a few errors. Here is the 
> traceback:
>
> ➜  ~  pip3 install Django
> Downloading/unpacking Django
>   Downloading Django-1.9.1-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
> Installing collected packages: Django
> *** Error compiling 
> '/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/apps.py'...
>   File "/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/apps.py", 
> line 1
> {{ unicode_literals }}from django.apps import AppConfig
>  ^
> SyntaxError: invalid syntax
>
>
> *** Error compiling 
> '/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/models.py'...
>   File "/tmp/pip-build-7s8zc2i5/Django/django/conf/app_template/models.py"
> , line 1
> {{ unicode_literals }}from django.db import models
>  ^
> SyntaxError: invalid syntax
>
>
> Successfully installed Django
> Cleaning up...
>
> I wanted to know why this is happening ?
> Also, how should I fix it if this is something to worry about ?
>
>

-- 
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/20ebdb1a-599a-4c13-82bb-41db34331fdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


apps.populate deadlock

2016-01-12 Thread John Bazik
I'm porting a site from django 1.6 -> 1.8, and getting deadlock (no errors) 
at load time.  The problem is that apps.populate is getting called twice 
and hanging on the lock.  This is from executing "python manage.py help".  
There are lots of moving parts, but a trace shows something like this:

django.setup -> apps.populate -> import  cmsplugin_zinnia -> django-cms 
discover_plugins -> load templates -> django-multisite template loader -> 
get site-id from locmem cache -> django.db.models.base.model_unpickle -> 
apps.populate

Since apps.populate isn't reentrant, and hangs when called recursively, it 
might be nice to have it throw an exception instead.

Can anyone suggest which component is most at fault above?  Any insights 
appreciated.

John

-- 
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/3ffbe0a8-7f9c-4ad8-bd40-ce24daa0939f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: apps.populate deadlock

2016-01-12 Thread John Bazik
Here's the actual traceback.

John

-- 
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/5e74ab00-2ee0-40f2-b00c-7f05ae6bd04d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


zz
Description: Binary data


Re: apps.populate deadlock

2016-01-12 Thread John Bazik
Breaking it down:

   - Django.setup wants to load all apps, and calls apps.populate
   - Django-cms plugins register themselves at load time
   - Django-cms plugin registration involves loading templates
   - Django-multisite provides a template loader (for per-site templates)
   - Django-multisite also monkey-patches Sites' cache (normally a dict) 
   with a wrapper around a django cache
   - The django-multisite template loader fetches the current site from 
   cache when loading templates
   - Django's LocMemCache backend fetches a pickled model from cache
   - It is implicitly unpickled by django.db.models.base.Model which calls 
   model_unpickle
   - model_unpickle tests if apps.ready is true and if not, calls 
   apps.populate

I could break the cycle any number of places, but it seems to me that all 
the apps are doing reasonable things (monkey patching aside), and django 
shouldn't be calling apps.populate to unpickle a model.  Perhaps that is 
unavoidable?

John

-- 
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/f5271566-56ce-4171-a21e-fa24bbd73451%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid literal for int() with base 10: '' using FormSet with File Upload

2016-01-12 Thread Luis Zárate
What is the value of pk in

study_form_set = DiagnosticStudyFormSet(request.POST, request.FILES,
prefix='studies',
queryset=DiagnosticStudy.objects.filter(diagnostic__id=pk)). ?

Is pk an int?  try print type(pk)


El martes, 12 de enero de 2016, Néstor Boscán  escribió:
> Hi Django Forum
> I'm working on a web application that has a page with form set that
requires file upload. When I upload the files I get:
> Django Version:1.9.1
> Exception Type:ValueError
> Exception Value:
>
> invalid literal for int() with base 10: ''
>
> Exception
Location:C:\desarrollo\Python27\lib\site-packages\django\db\models\fields\__init__.py
in get_prep_value, line 976
> Python Executable:C:\desarrollo\Python27\python.exe
> Python Version:2.7.3
> On this line of code:
> study_form_set = DiagnosticStudyFormSet(request.POST, request.FILES,
prefix='studies',
queryset=DiagnosticStudy.objects.filter(diagnostic__id=pk))
> My model:
> class DiagnosticStudy(models.Model):
> id = models.AutoField(primary_key=True)
> name = models.CharField(verbose_name='Name', max_length=255)
> link = models.CharField(verbose_name='Link', max_length=255,
blank=True, null=True)
> path = models.FileField(upload_to='files', max_length=255,
blank=True, null=True)
> diagnostic = models.ForeignKey(Diagnostic, blank=True, null=True)
> study_type = models.ForeignKey(StudyType, blank=True, null=True)
> class Meta:
> managed = False
> db_table = 't_udm_diagnostic_study'
> My forms:
> class DiagnosticStudyForm(ModelForm):
> class Meta(object):
> model = DiagnosticStudy
> fields = [ 'id', 'name', 'link', 'path', 'study_type' ]
> widgets = {
>'id': HiddenInput(attrs={ 'class': 'campo' }),
> 'name': TextInput(attrs={ 'class': 'campo', 'size': '40',
'onchange': 'validate(this)' }),
> 'link': TextInput(attrs={ 'class': 'campo', 'size': '40', 'onchange':
'validate(this)' }),
> 'path': FileInput(attrs={ 'class': 'campo', 'size': '40', 'accept':
'image/gif,image/jpeg,image/pjpeg,image/png,image/tiff,image/x-tiff,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation',
'onchange': 'validate(this)' }),
> 'study_type': HiddenInput(attrs={ 'class': 'campo', 'size': '40',
'onchange': 'validate(this)' }),
> }
> DiagnosticStudyFormSet = modelformset_factory(DiagnosticStudy,
form=DiagnosticStudyForm, extra=5, can_delete=True)
> The Form does not have a IntegerField only CharFields and ForeignKeys.
Any ideas on how to know which field is generating the error?
> Regards,
> Néstor
>
> --
> 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/00b3ccfa-d092-4027-97fe-31fd6a828129%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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/CAG%2B5VyMmp%2B7dJNRKCE_KvE%2BQGcV%3DHMOt-mSuU3PihBzy66KL-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Custom field reference flowchart

2016-01-12 Thread martin f krafft
Dear Django people,

I'm working on something I called "IndirectGenericForeignKey",¹ and
following suggestionsi I received on django-developers, I've made
a bit of progress on my implementation, using a custom
(pseudo-)field.²

My code works, but I can't exactly say I understand all of it, which
isn't really a good basis to work from. In particular, studying
the custom model fields howto³ left my brain smoking. All these
different adapter functions (e.g. get_prep_lookup, etc.) certainly
have very well-defined purposes, but I can't say that these are
easily discerned from reading the documentation.

Are you aware of some sort of flow-chart that depicts the
translations that are happening, for all the different functions and
use-cases (e.g. INSERT, UPDATE, SELECT)?

It would already help a lot to know what gets called when, and maybe
have a few immutables established in between.

If such a picture/document does not yet exist, maybe some of you
would be interested in working with me on creating it? I'd do the
heavy lifting, but if there'd be people around offering their
experience for querying and sanity checks, that'd be great. If
interested, maybe the best would be for you to reply off-list, and
then we could go about it? Or would it be acceptable to develop this
on-list?

Take care,
-m

¹) https://groups.google.com/forum/#!topic/django-developers/jx-14OddSqA
²) https://github.com/madduck/wafer/tree/147-kvpairs
³) https://docs.djangoproject.com/en/1.9/howto/custom-model-fields/

-- 
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
 
"it isn't pollution that's harming the environment.
 it's the impurities in our air and water that are doing it."
  - dan quayle
 
spamtraps: madduck.bo...@madduck.net

-- 
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/20160113032821.GA6726%40fishbowl.rw.madduck.net.
For more options, visit https://groups.google.com/d/optout.


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: apps.populate deadlock

2016-01-12 Thread James Schneider
Have you tried the Django dev mailing list? You're dealing with the deep
internals of Django, the black magic of which us lowly end users take for
granted.

You may have better luck there, since they have a much better understanding
of the gears and gizmos behind the scenes.

-James
On Jan 12, 2016 2:55 PM, "John Bazik"  wrote:

> Breaking it down:
>
>- Django.setup wants to load all apps, and calls apps.populate
>- Django-cms plugins register themselves at load time
>- Django-cms plugin registration involves loading templates
>- Django-multisite provides a template loader (for per-site templates)
>- Django-multisite also monkey-patches Sites' cache (normally a dict)
>with a wrapper around a django cache
>- The django-multisite template loader fetches the current site from
>cache when loading templates
>- Django's LocMemCache backend fetches a pickled model from cache
>- It is implicitly unpickled by django.db.models.base.Model which
>calls model_unpickle
>- model_unpickle tests if apps.ready is true and if not, calls
>apps.populate
>
> I could break the cycle any number of places, but it seems to me that all
> the apps are doing reasonable things (monkey patching aside), and django
> shouldn't be calling apps.populate to unpickle a model.  Perhaps that is
> unavoidable?
>
> John
>
> --
> 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/f5271566-56ce-4171-a21e-fa24bbd73451%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/CA%2Be%2BciVGwYEkY93XaL6Xes1wEDmC%3DyM-YrC7xeLdP9AA4P6qTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Not getting any results back using DRF Haystack

2016-01-12 Thread amarshall
So I've used django rest framework to serialize my data to make api calls. 
Great, that all worked well. Now I wanted to implement a search and return 
the serialized data in JSON format like I do with normal data. I feel like 
I followed the drf-haystack basic usage guide(
https://drf-haystack.readthedocs.org/en/latest/basic_usage.html) correctly 
to get started. But I'm not getting any results when I make a call to the 
url. So, I'm going to use this event app. I want to be able to search 
through the titles. i.e( "party downtown")

So here's what I'm working with.

Model: 

class Event(models.Model):

business = models.ForeignKey(Business)
title = models.CharField(max_length=75)
event_date = models.DateField(blank=True,default=datetime.date.today)   
 
startTime = models.DateTimeField(blank=True,default=datetime.datetime.
now) 
endTime = models.DateTimeField(blank=True,null=True)
description = models.TextField(blank=True)


search_indexes.py:



class EventIndex(indexes.SearchIndex,indexes.Indexable):

text = indexes.CharField(document=True,use_template=True)
title = indexes.CharField(model_attr="title")
description = indexes.CharField(model_attr="description")

))

def get_model(self):
return Event

def index_queryset(self,using=None):
return self.get_model().objects.all()


Serializer(EventSearchSerializer):
class EventSearchSerializer(HaystackSerializer):

class Meta:
# The `index_classes` attribute is a list of which search indexes
# we want to include in the search.
index_classes = [EventIndex]

# The `fields` contains all the fields we want to include.
# NOTE: Make sure you don't confuse these with model attributes. 
These
# fields belong to the search index!
fields = [
"text", "title", "description"
]




Views: ( I've tried both ways mentioned in the docs. With viewsets and 
without):

class EventSearchView(HaystackViewSet):
# `index_models` is an optional list of which models you would like to 
include
# in the search result. You might have several models indexed, and this 
provides
# a way to filter out those of no interest for this particular view.
# (Translates to `SearchQuerySet().models(*index_models)` behind the 
scenes.
index_models = [Event]   

serializer_class = EventSearchSerializer

class EventSearchView2(ListModelMixin, HaystackGenericAPIView):

serializer_class = EventSearchSerializer

def get(self,request, *args,**kwargs):
return self.list(request,*args,**kwargs)



Urls:
router = routers.DefaultRouter()
router.register("event/search", EventSearchView, base_name="event-search")

urlpatterns = [
# api url for User to Create, Read, View 
url(r'^~api/v1/', include(router.urls)),

url(
regex=r'^~api/v2/search/$',
view = views.EventSearchView2.as_view(),
name="event_search_api"
),]

I perform a search in the url:
url:  http://localhost/events/~api/v2/search/?title=club
and I get nothing,but there's data there for sure with that title. I get a 
200 OK code back. But 0 results

I'm trying to figure this out, but I got nothing so far. Thanks for reading 
this far.

-- 
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/450186a9-2b7f-4dc9-9803-aa156d669f21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Commenting system to use to build with REST API

2016-01-12 Thread amarshall
Thank you. I ended up doing just that and writing my own. works great :D

On Wednesday, December 23, 2015 at 1:18:52 PM UTC-5, Dheerendra Rathor 
wrote:
>
> You can write your own system with just two models - Post and Comment. 
> Then write custom serializers and viewsets to submit comments. 
> It's an easy task and won't take much of your time. 
>
> I've worked in similar fashion on few of my own works. Here is a link of 
> custom models I wrote: 
> https://github.com/bird-labs/MHRDApp-Server/blob/master/post/models.py
>
>
> On Wed, 23 Dec 2015 at 23:40 amarshall > 
> wrote:
>
>> Hi, I'm working on an android app and using django as the backend. I 
>> created an api using django rest framework and everything is fine so far. I 
>> want to add commenting to my main object. i.e - lets call it a "Post". I 
>> want each post to have a set of comments associated with it. simple 
>> comments.one after the other. I'm not looking to do threaded commenting. 
>> What is the best way I should go about doing this? 
>>
>> I see apps like Disquis and django-comments-xtd 
>> , but 
>> they all seem to just use the templating system on the web front end. I 
>> just want the data in some text/JSON format and send it to android(or any 
>> other device). i.e [ comments: {id:1,user: User23,comment: I totally agree 
>> } }
>>
>> Also, I seen this post: 
>> http://stackoverflow.com/questions/28369418/struggling-to-get-django-comments-to-work-with-django-rest-framework
>>  
>>
>> and wondered should I try still using django.contrib.comments even though 
>> it's depreciated ? 
>>
>> I'm using Django verson 1.8.4 
>>
>> Any advice would be great. Thanks.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@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/12c52875-c1f1-4465-ade7-37dc5dca75c1%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/f48693a7-a629-49ca-a956-255e7cbc4fd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [melbourne-pug] OS license requirements

2016-01-12 Thread Mike Dewhirst
Further to this, for the SharedSDS project licensing is now settled on GNU 
GPL v3 for the bulk of the software. API code will be GNU LGPL v3

Mike

On Tuesday, August 12, 2014 at 10:43:58 AM UTC+10, Mike Dewhirst wrote:
>
> Cross posting again to thank everyone for responding ... 
>
> I'm going with LGPL. 
>
> Oliver suggested I consider Mozilla Public License and part of a 
> stackexchange conversation goes [1] ... 
>
> > The major difference is how MPL / LGPL licensed code must be linked 
> > into the project. MPL source code files can be directly copied into a 
> > (possibly) proprietary software project (static linking), while LGPL 
> > licensed code must be dynamically linked (loosely linked to the 
> > possibly proprietary software project, so that end-users can switch 
> > out the licensed software library for another version of the licensed 
> > software library). 
>
> ... but in the context of Python running in a server (IANAL) I can't see 
> "linking" being applicable to the point where it would prevent the real 
> objective of ensuring my source (modified or not) is available for the 
> end user of the whole work. Running on someone else's server makes it 
> moot and on the end-user's server it is fait accompli. 
>
> Russ suggested staying within the big five and that was why I was 
> leaning towards LGPL anyway. My thought was about who might be 
> interested in helping if the license is breached. MSF or FSF? I assume 
> FSF because that is their entire mission. 
>
> In truth I was originally going for GPLv3 until I realised it would 
> prevent some of my intended users from interfacing their software with 
> mine. 
>
> Again - thanks to all 
>
> Cheers 
>
> Mike 
>
> [1] 
>
> http://programmers.stackexchange.com/questions/221365/mozilla-public-license-mpl-2-0-vs-lesser-gnu-general-public-license-lgpl-3-0
>  
>
> On 11/08/2014 10:34 AM, Mike Dewhirst wrote: 
> > Apologies for cross-posting 
> > 
> > I'm getting near to open sourcing a Django project and have to choose 
> > an appropriate license. Can anyone help me choose? 
> > 
> > I have settled on the following requirements ... 
> > 
> > 1. Project source must be freely available for end users to view and 
> >  download and modify and further distribute to others 
> > 
> > 2. But if user modified source is distributed the modified source 
> > must be freely available for others to view and download and modify 
> > and be subject to the identical license as the project source 
> > 
> > 3. However, if the user modified source is kept in-house and not 
> > further distributed the changed source may be kept private or offered 
> > back to the project as a patch at the whim of that user. 
> > 
> > 4. Project (and user modified) source may be combined with 
> > proprietary software but the project (or user mofified) source 
> > component remains subject to the same license. It cannot be 
> > distributed as a combined whole under any other license than the 
> > project license. 
> > 
> > 5. But it can be distributed as a combined whole with proprietary 
> > software provided the project (or user modified) source component is 
> >  freely available for end users to view and download and further 
> > distribute to others under the project license even if the 
> > proprietary component is not. 
> > 
> > BTW, Django doesn't require that my project use the Django license 
> > and of course I won't be distributing Django. 
> > 
> > I'm leaning towards the LGPL but would appreciate feedback from 
> > anyone with contrary views. 
> > 
> > Thanks 
> > 
> > Mike ___ melbourne-pug 
> > mailing list melbourne-...@python.org 
> > https://mail.python.org/mailman/listinfo/melbourne-pug 
> > 
>
>

-- 
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/89f3802a-952f-4565-ac2c-d1cbed5ac06d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


'python manage.py createsuperuser' error

2016-01-12 Thread Lansana Camara
Learning Python and Django for the first time and I'm stuck at this part of 
the intro 
tutorial: 
https://docs.djangoproject.com/en/1.9/intro/tutorial02/#introducing-the-django-admin

The 'python manage.py createsuperuser' command gives me this error: 

*Superuser creation skipped due to not running in a TTY. You can run 
`manage.py createsuperuser` in your project to create one manually.*

Looking through the source, namely createsuperuser.py, it catches the 
NotRunningInTTYException:

except NotRunningInTTYException:
self.stdout.write(
"Superuser creation skipped due to not running in a TTY. "
"You can run `manage.py createsuperuser` in your project "
"to create one manually."
)


Anyone know how I can resolve this error? if it makes any difference, my 
installation process was a headache... getting 'python manage.py runserver' 
took me a good day. Maybe I don't have things configured properly... Using 
Windows.

-- 
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/1d8ffb9f-f8f5-436f-b9c1-c20afb042060%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.