Re: cant start a new project ,just installed django

2016-10-04 Thread new user
python 2.7.10 
django 1.10.2

i think its  what is says here:

https://code.djangoproject.com/ticket/18296

but i cant solve it 






On Tuesday, October 4, 2016 at 5:19:59 AM UTC+3, Sylvain Dégué wrote:
>
> What Django & python version do you have?
>
> Le lundi 3 octobre 2016 19:07:03 UTC-4, new user a écrit :
>>
>> followed the intro:
>> https://docs.djangoproject.com/en/1.10/intro/tutorial01/
>>
>> when i run django-admin startproject mysite
>>
>> its prompt : "manage.py already exists, overlaying a project or app into 
>> an existing directory won't replace conflicting files" not matter what name 
>> i give to the project , its creating new dir wit the project name , and 
>> manage.py and this error. google didnt helped me and i saw someone 
>> complained it a bug. windows 10 
>>
>>
>>
>> anyone?
>>
>

-- 
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/69e806b7-0cac-46e0-8399-74a18b738790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Sqlmigrate generated SQL

2016-10-04 Thread andrea crotti
Related to this other thread:

https://groups.google.com/forum/#!msg/django-users/V8Ei2qZJ8VI/bFUeY2wTAQAJ;context-place=forum/django-users

I'm working on trying to find a workaround for migrations killing our 
local/CI servers, until there is a better fix in Django stable..

So started this project to do some analysis:
https://github.com/AndreaCrotti/django-migrations-analysis


One interesting thing is that it looks like using sqlmigrate (taking some 
code from it) to generate the raw SQL and composing ti basically generates 
exactly the same final schema for the database.

https://github.com/AndreaCrotti/django-migrations-analysis/blob/master/commands/sqlmigrate_all.py

In general the question is, assuming all the settings are the same, can 
they differ under some conditions?
I guess for example that using RunPython would cause issues in this case 
right?

-- 
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/acccdd2d-044c-4771-ae79-b99e89f0301b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sqlmigrate generated SQL

2016-10-04 Thread andrea crotti
Answering to myself obviously sqlmigrate can't really do anything with code 
in RunPython.
So I suspect the biggest problem would be something like this:

- early data migration that uses an initial schema a certain model
- a later schema migration that changes that

so trying to generate the SQL after would not apply because the schema 
changed in the meanwhile..

On Tuesday, October 4, 2016 at 10:41:25 AM UTC+1, andrea crotti wrote:
>
> Related to this other thread:
>
>
> https://groups.google.com/forum/#!msg/django-users/V8Ei2qZJ8VI/bFUeY2wTAQAJ;context-place=forum/django-users
>
> I'm working on trying to find a workaround for migrations killing our 
> local/CI servers, until there is a better fix in Django stable..
>
> So started this project to do some analysis:
> https://github.com/AndreaCrotti/django-migrations-analysis
>
>
> One interesting thing is that it looks like using sqlmigrate (taking some 
> code from it) to generate the raw SQL and composing ti basically generates 
> exactly the same final schema for the database.
>
>
> https://github.com/AndreaCrotti/django-migrations-analysis/blob/master/commands/sqlmigrate_all.py
>
> In general the question is, assuming all the settings are the same, can 
> they differ under some conditions?
> I guess for example that using RunPython would cause issues in this case 
> right?
>

-- 
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/a805f787-0cb3-4166-ac01-b00b8dd718ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant start a new project ,just installed django

2016-10-04 Thread Marlysson Silva
Do you tryied unninstall and install django again?

Are you using a virtualenv?

Em segunda-feira, 3 de outubro de 2016 20:07:03 UTC-3, new user escreveu:
>
> followed the intro:
> https://docs.djangoproject.com/en/1.10/intro/tutorial01/
>
> when i run django-admin startproject mysite
>
> its prompt : "manage.py already exists, overlaying a project or app into 
> an existing directory won't replace conflicting files" not matter what name 
> i give to the project , its creating new dir wit the project name , and 
> manage.py and this error. google didnt helped me and i saw someone 
> complained it a bug. windows 10 
>
>
>
> anyone?
>

-- 
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/1487478f-361c-42bb-8746-1b8f786de55a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Composite pattern for models

2016-10-04 Thread Marlysson Silva
Try abstract base class ,  implement and you do the model works , make 
composite pattern fine, after use django to this:

https://docs.djangoproject.com/en/1.10/topics/db/models/#abstract-base-classes

The base it's: in the composite object you overwrite method of simple 
object.

Em segunda-feira, 3 de outubro de 2016 18:08:13 UTC-3, Sylvain Dégué 
escreveu:
>
> Hi, 
>
> I was wondering if it was possible to apply the Composite Pattern 
>  in the models. If 
> yes, how?
>

-- 
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/a77debe8-f6f5-416b-a8b9-49db5cdaa96d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant start a new project ,just installed django

2016-10-04 Thread Andromeda Yelton
When I copy-pasted the error message into Google I got some stackoverflow
posts saying that you can get this error if you have two different versions
of Django installed; are you certain that your 1.10.2 install is the only
one on your system?

On Mon, Oct 3, 2016 at 5:59 PM, new user  wrote:

> followed the intro:
> https://docs.djangoproject.com/en/1.10/intro/tutorial01/
>
> when i run django-admin startproject mysite
>
> its prompt : "manage.py already exists, overlaying a project or app into
> an existing directory won't replace conflicting files" not matter what name
> i give to the project , its creating new dir wit the project name , and
> manage.py and this error. google didnt helped me and i saw someone
> complained it a bug. windows 10
>
>
>
> anyone?
>
> --
> 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/f8aa3c2c-006b-4c01-b4b6-a93e3a33623e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology
Association: http://www.lita.org
http://andromedayelton.com
@ThatAndromeda 

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


Re: For loop for ModelForm in Django

2016-10-04 Thread Andromeda Yelton
https://docs.djangoproject.com/en/1.10/topics/forms/#looping-over-the-form-s-fields

That said, testing for Boolean vs. non-Boolean fields is really more logic
than belongs in a template. You can manually lay out the form in the
template, specifying where each field should go and surrounding them with
your desired HTML, or you can use crispy forms (
https://django-crispy-forms.readthedocs.io/en/latest/) on the back end if
you want to be manipulating a lot of logic (and then let crispy take care
of generating HTML and making it look nice).

On Sun, Oct 2, 2016 at 6:58 AM, Ali khan  wrote:

> I need to iterate the form to get Boolean values in a single line. Please
> help me to figure out a way to iterate through model forms.
> Also I generally need to understand how to iterate through modelforms.
>
> App Model:
>
> class ProjectDetails(models.Model):
>  type = models.CharField(max_length=120)
>  tools = models.CharFiled(max_length=120, choices=tools)
>  reporting = models.BooleanField(defautl=False)
>  weekly_meeting = BooleanField(default=True)
>  def __unicode__(self):
>   return self.project_tools
>
> App Form:
> def ProjectDetailForm(forms.ModelForm):
>  class Meta:
>  model = ProjectDetails
>  fields = ["project_type", "project_tools", "reporting", "weekly_meeting"]
>
> App view:
> def project_info(request):
> template = 'project.html'
> form = ProjectDetailForm(request.POST or None)
> if form.is_valid():
> form.save(commit=True)
> return render(request, template, context={'form':form})
>
>
> App html file:
> 
> {% csrf_token %}
> {{ form }}
> 
> 
>
>
> Ali
>
> --
> 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/CAAXvsY%3Df3QRBpuOvQMcyRQND8H_Ds8%2Bv-
> 3LREOJVhPzo_0qRPw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology
Association: http://www.lita.org
http://andromedayelton.com
@ThatAndromeda 

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


Re: How to debug oauth2 code?

2016-10-04 Thread Etienne Robillard
I've uploaded the development repository of django-hotsauce-oauthclient 
here:


https://bitbucket.org/tkadm30/django-hotsauce-oauthclient/

Regards,

Etienne


Le 2016-10-03 à 13:26, Etienne Robillard a écrit :
 I'm trying to build a custom Django app with OAuth 2.0 support 
through django-hotsauce-oauthclient, however


once I logged in all requests will share my username. I use gevent for 
handling thread-local


data (the request.environ object). Is there a proper way to debug 
OAuth 2.0 code ?


Thanks,

Etienne



--
Etienne Robillard
tkad...@yandex.com
http://www.isotopesoftware.ca/

--
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/70a6a484-79b4-0bf1-ea24-ea583d0f1678%40yandex.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading a django 1.2 Alpha site to 1.10 final site, passwords don't work

2016-10-04 Thread Evan Roberts
Thank you Tim,  the pointer was just I needed.

If anyone runs into this issue you will also need to update the auth_user 
table to allow NULLs in the last_login date. 
See this defect for details https://code.djangoproject.com/ticket/24679

-- 
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/0fbd26cc-2fd5-4cd9-ba11-bf8e8a2690ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant start a new project ,just installed django

2016-10-04 Thread new user
had seen those answer's tried to uninstall it twice through pip .
also reinstalled the python 
sure about the 1.10.2 version , the first step in the tutorial is to check 
version 

not using any virtualenv.




On Tuesday, October 4, 2016 at 5:02:12 PM UTC+3, Andromeda Yelton wrote:
>
> When I copy-pasted the error message into Google I got some stackoverflow 
> posts saying that you can get this error if you have two different versions 
> of Django installed; are you certain that your 1.10.2 install is the only 
> one on your system?
>
> On Mon, Oct 3, 2016 at 5:59 PM, new user 
> > wrote:
>
>> followed the intro:
>> https://docs.djangoproject.com/en/1.10/intro/tutorial01/
>>
>> when i run django-admin startproject mysite
>>
>> its prompt : "manage.py already exists, overlaying a project or app into 
>> an existing directory won't replace conflicting files" not matter what name 
>> i give to the project , its creating new dir wit the project name , and 
>> manage.py and this error. google didnt helped me and i saw someone 
>> complained it a bug. windows 10 
>>
>>
>>
>> anyone?
>>
>> -- 
>> 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/f8aa3c2c-006b-4c01-b4b6-a93e3a33623e%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Andromeda Yelton
> Vice President/President-Elect, Library & Information Technology 
> Association: http://www.lita.org
> http://andromedayelton.com
> @ThatAndromeda 
>

-- 
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/afadab8f-b7ec-424d-b3ef-ec19be2fbaba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django squash migrations bug

2016-10-04 Thread Tim Graham
It's a known issue: https://code.djangoproject.com/ticket/26760

On Tuesday, October 4, 2016 at 4:47:36 PM UTC-4, Kojedzinszky Richárd wrote:
>
> Dear Django users, 
>
> I was playing a bit with migration squashing, and found that, after 
> applying a 
> squashed migration (following the guide), stale records are left in the 
> migration history, which will prevent another migration to be applied with 
> the 
> same name. This effectively results in a different state when applying 
> migrations step-by-step, and when applying from the squashed migrations. 
>
> I've created a test project: 
> https://github.com/rkojedzinszky/django-squash-bug 
>
> First, one should migrate each commit step-by-step, and on another 
> installation, just at the last commit. I assume the result should be 
> identical, 
> but unfortunately the asd.Model1 tables remain different in the two test 
> cases. 
>
> Is this a bug, or feature? 
>
> Regards, 
>
> Kojedzinszky Richárd 
> Euronet Magyarorszag Informatika Zrt.

-- 
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/2167cef4-a910-4d30-9af9-181c2f8b838f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django squash migrations bug

2016-10-04 Thread Kojedzinszky Richárd

Dear Django users,

I was playing a bit with migration squashing, and found that, after applying a 
squashed migration (following the guide), stale records are left in the 
migration history, which will prevent another migration to be applied with the 
same name. This effectively results in a different state when applying 
migrations step-by-step, and when applying from the squashed migrations.


I've created a test project: https://github.com/rkojedzinszky/django-squash-bug

First, one should migrate each commit step-by-step, and on another 
installation, just at the last commit. I assume the result should be identical, 
but unfortunately the asd.Model1 tables remain different in the two test cases.


Is this a bug, or feature?

Regards,

Kojedzinszky Richárd
Euronet Magyarorszag Informatika Zrt.

Re: cant start a new project ,just installed django

2016-10-04 Thread saha.chandan94
Do you tried run that code after changing your directory in cmd?

On Tuesday, October 4, 2016 at 4:37:03 AM UTC+5:30, new user wrote:
>
> followed the intro:
> https://docs.djangoproject.com/en/1.10/intro/tutorial01/
>
> when i run django-admin startproject mysite
>
> its prompt : "manage.py already exists, overlaying a project or app into 
> an existing directory won't replace conflicting files" not matter what name 
> i give to the project , its creating new dir wit the project name , and 
> manage.py and this error. google didnt helped me and i saw someone 
> complained it a bug. windows 10 
>
>
>
> anyone?
>

-- 
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/399f0226-4d78-4dbf-884f-de2cce799336%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant start a new project ,just installed django

2016-10-04 Thread saha.chandan94
Did you try run that code (django-admin startproject mysite) after changing 
your system directory?

-- 
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/4b1a07d7-263f-4015-bead-22cf26bb76e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Add rows in migrations?

2016-10-04 Thread Victor Porton
After generating DB scheme, I need to add two rows with certain data to 
certain table.

How to do it?

Can it be handled with migrations?

A complication is that these two rows contain strings dependent on the 
user's language.

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/017c3db6-ae9f-48fa-ad81-2e0a1fccb459%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant start a new project ,just installed django

2016-10-04 Thread Ori Ohayon
I tried from many locations

-- 
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/CAGzSXpd-aT%3DpXR8Ce-PCsjD02hvm%2BPehmLp2VBh%3DywGbhJAaqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Add rows in migrations?

2016-10-04 Thread Avraham Serour
which user?

a user usually is known during a request, while running the migration there
are no users, you can access all users the same way you may access all the
database, but this is not a user requested operation like a view processing
a template.

In any case you still may add/remove/modify data running migration, this is
called data migration


On Wed, Oct 5, 2016 at 2:21 AM, Victor Porton  wrote:

> After generating DB scheme, I need to add two rows with certain data to
> certain table.
>
> How to do it?
>
> Can it be handled with migrations?
>
> A complication is that these two rows contain strings dependent on the
> user's language.
>
> 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/017c3db6-ae9f-48fa-ad81-2e0a1fccb459%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/CAFWa6tKVxb_5eAjY%2BS_Amc8_aX%2BAGNeC2SVN5tV9cNzz8EoxVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.