Re: Team project via Git repo

2015-10-13 Thread Ralph Castain
I’ll give these, and the suggestions from Jonathan, a try tomorrow when I 
arrive after travel and let you know how it goes.

Thanks!!!

> On Oct 13, 2015, at 7:01 PM, Aaron C. de Bruyn  wrote:
> 
> Oops--almost forgot.  Create a .gitignore in your ~/code/carsite file
> before you commit your changes and push them to GitHub.
> 
> https://www.gitignore.io
> 
> -A
> 
> On Tue, Oct 13, 2015 at 7:00 PM, Aaron C. de Bruyn  wrote:
>> Without knowing too much about your environment, I figured I'd tell
>> you how I do it on my Debian-derivative systems.
>> 
>> * Install python-virtualenv and virtualenvwrapper - These tools help
>> you create isolated python environments under your home folder under
>> '.virtualenv'.
>> * Create a virtualenv for the project.  If my project name is CarSite
>> I run 'mkvirtualenv carsite'.  (After the virtualenv is created it
>> should leave you *inside* the virtual environment)
>> * Install the latest version of Django into your virtual env by
>> running 'pip install django'
>> * Create your project by going in to your code folder (this is
>> different than your virtualenv) "cd ~/code" and then creating the
>> project "django-admin startproject carsite"
>> * Go in to the carsite directory "cd ~/code/carsite"
>> * Create a requirements.txt file for other developers ('pip freeze >
>> requirements.txt')
>> * Turn it into a git repo "git init ."
>> * Commit your new project (or make changes, then commit) "git commit
>> -m 'My first commit'"
>> * Connect it to github by following their directions (something like
>> 'git remote add origin g...@github.com:username/carsite.git' and then
>> 'git push -u origin master')
>> 
>> Now other developers should be able to start working on the project by
>> doing the following:
>> * cd ~/code
>> * git clone g...@github.com:username/carsite.git carsite
>> * cd ~/code/carsite
>> * mkvirtualenv -r requirements.txt
>> 
>> -A
>> 
>> 
>> 
>> On Tue, Oct 13, 2015 at 5:38 PM,   wrote:
>>> Just to update: we also tried simply copying the entire virtual environment
>>> across, correcting for any differences in path. Still go the same behavior.
>>> 
>>> We'd really welcome some advice on this one as otherwise we won't be able to
>>> use Django - we need a way to collaborate on implementation.
>>> 
>>> Thanks
>>> Ralph
>>> 
>>> 
>>> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
 
 Hi folks
 
 I'm a Django newbie (have found it very helpful!), so please excuse the
 naivete. I have a question regarding team work on a Django project via
 GitHub.
 
 I followed your excellent tutorial and have a virtual Python v2.7
 environment with Django 1.8.5 installed in it (FWIW: I thought I installed
 Django 1.11, but django-admin --version shows 1.8.5). I then created my app
 using "django-admin startproject foo" and got the project subdirectory as
 expected. A quick check of the server showed the "Welcome to Django" page.
 
 I then added a bunch of model definitions and customized the admin page. I
 verified that everything was okay by looking at the admin web page on my
 localhost - the customized page is there, and I was able to add some test
 data for one of the models. At this point, others want to pitch in to help,
 and so I bundled everything in my project subdirectory (including manage.py
 and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
 
 The other team members also setup a virtual environment with Django, using
 the same versions, and activated it. They then cloned the GitHub repo and
 got all the project files as expected, and the directory structure looks
 exactly the same.
 
 However, when they runserver in the project, they only get the "Welcome to
 Django" page. The project admin and login page doesn't show up. I've
 verified that all the model and settings info is correct, but we haven't
 been able to get the info to show on the web page.
 
 Any suggestions on what we are doing wrong? I'm assuming a team can share
 a Django project, but suspect we aren't collecting all the relevant files 
 or
 not getting the other team's environment set correctly.
 
 Thanks
 Ralph
 
>>> --
>>> 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 http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message 

Re: Team project via Git repo

2015-10-13 Thread Aaron C. de Bruyn
Oops--almost forgot.  Create a .gitignore in your ~/code/carsite file
before you commit your changes and push them to GitHub.

https://www.gitignore.io

-A

On Tue, Oct 13, 2015 at 7:00 PM, Aaron C. de Bruyn  wrote:
> Without knowing too much about your environment, I figured I'd tell
> you how I do it on my Debian-derivative systems.
>
> * Install python-virtualenv and virtualenvwrapper - These tools help
> you create isolated python environments under your home folder under
> '.virtualenv'.
> * Create a virtualenv for the project.  If my project name is CarSite
> I run 'mkvirtualenv carsite'.  (After the virtualenv is created it
> should leave you *inside* the virtual environment)
> * Install the latest version of Django into your virtual env by
> running 'pip install django'
> * Create your project by going in to your code folder (this is
> different than your virtualenv) "cd ~/code" and then creating the
> project "django-admin startproject carsite"
> * Go in to the carsite directory "cd ~/code/carsite"
> * Create a requirements.txt file for other developers ('pip freeze >
> requirements.txt')
> * Turn it into a git repo "git init ."
> * Commit your new project (or make changes, then commit) "git commit
> -m 'My first commit'"
> * Connect it to github by following their directions (something like
> 'git remote add origin g...@github.com:username/carsite.git' and then
> 'git push -u origin master')
>
> Now other developers should be able to start working on the project by
> doing the following:
> * cd ~/code
> * git clone g...@github.com:username/carsite.git carsite
> * cd ~/code/carsite
> * mkvirtualenv -r requirements.txt
>
> -A
>
>
>
> On Tue, Oct 13, 2015 at 5:38 PM,   wrote:
>> Just to update: we also tried simply copying the entire virtual environment
>> across, correcting for any differences in path. Still go the same behavior.
>>
>> We'd really welcome some advice on this one as otherwise we won't be able to
>> use Django - we need a way to collaborate on implementation.
>>
>> Thanks
>> Ralph
>>
>>
>> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
>>>
>>> Hi folks
>>>
>>> I'm a Django newbie (have found it very helpful!), so please excuse the
>>> naivete. I have a question regarding team work on a Django project via
>>> GitHub.
>>>
>>> I followed your excellent tutorial and have a virtual Python v2.7
>>> environment with Django 1.8.5 installed in it (FWIW: I thought I installed
>>> Django 1.11, but django-admin --version shows 1.8.5). I then created my app
>>> using "django-admin startproject foo" and got the project subdirectory as
>>> expected. A quick check of the server showed the "Welcome to Django" page.
>>>
>>> I then added a bunch of model definitions and customized the admin page. I
>>> verified that everything was okay by looking at the admin web page on my
>>> localhost - the customized page is there, and I was able to add some test
>>> data for one of the models. At this point, others want to pitch in to help,
>>> and so I bundled everything in my project subdirectory (including manage.py
>>> and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
>>>
>>> The other team members also setup a virtual environment with Django, using
>>> the same versions, and activated it. They then cloned the GitHub repo and
>>> got all the project files as expected, and the directory structure looks
>>> exactly the same.
>>>
>>> However, when they runserver in the project, they only get the "Welcome to
>>> Django" page. The project admin and login page doesn't show up. I've
>>> verified that all the model and settings info is correct, but we haven't
>>> been able to get the info to show on the web page.
>>>
>>> Any suggestions on what we are doing wrong? I'm assuming a team can share
>>> a Django project, but suspect we aren't collecting all the relevant files or
>>> not getting the other team's environment set correctly.
>>>
>>> Thanks
>>> Ralph
>>>
>> --
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%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 http://groups.google.com/group/django-users.
To view this discussion on 

Re: Team project via Git repo

2015-10-13 Thread Aaron C. de Bruyn
Without knowing too much about your environment, I figured I'd tell
you how I do it on my Debian-derivative systems.

* Install python-virtualenv and virtualenvwrapper - These tools help
you create isolated python environments under your home folder under
'.virtualenv'.
* Create a virtualenv for the project.  If my project name is CarSite
I run 'mkvirtualenv carsite'.  (After the virtualenv is created it
should leave you *inside* the virtual environment)
* Install the latest version of Django into your virtual env by
running 'pip install django'
* Create your project by going in to your code folder (this is
different than your virtualenv) "cd ~/code" and then creating the
project "django-admin startproject carsite"
* Go in to the carsite directory "cd ~/code/carsite"
* Create a requirements.txt file for other developers ('pip freeze >
requirements.txt')
* Turn it into a git repo "git init ."
* Commit your new project (or make changes, then commit) "git commit
-m 'My first commit'"
* Connect it to github by following their directions (something like
'git remote add origin g...@github.com:username/carsite.git' and then
'git push -u origin master')

Now other developers should be able to start working on the project by
doing the following:
* cd ~/code
* git clone g...@github.com:username/carsite.git carsite
* cd ~/code/carsite
* mkvirtualenv -r requirements.txt

-A



On Tue, Oct 13, 2015 at 5:38 PM,   wrote:
> Just to update: we also tried simply copying the entire virtual environment
> across, correcting for any differences in path. Still go the same behavior.
>
> We'd really welcome some advice on this one as otherwise we won't be able to
> use Django - we need a way to collaborate on implementation.
>
> Thanks
> Ralph
>
>
> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
>>
>> Hi folks
>>
>> I'm a Django newbie (have found it very helpful!), so please excuse the
>> naivete. I have a question regarding team work on a Django project via
>> GitHub.
>>
>> I followed your excellent tutorial and have a virtual Python v2.7
>> environment with Django 1.8.5 installed in it (FWIW: I thought I installed
>> Django 1.11, but django-admin --version shows 1.8.5). I then created my app
>> using "django-admin startproject foo" and got the project subdirectory as
>> expected. A quick check of the server showed the "Welcome to Django" page.
>>
>> I then added a bunch of model definitions and customized the admin page. I
>> verified that everything was okay by looking at the admin web page on my
>> localhost - the customized page is there, and I was able to add some test
>> data for one of the models. At this point, others want to pitch in to help,
>> and so I bundled everything in my project subdirectory (including manage.py
>> and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
>>
>> The other team members also setup a virtual environment with Django, using
>> the same versions, and activated it. They then cloned the GitHub repo and
>> got all the project files as expected, and the directory structure looks
>> exactly the same.
>>
>> However, when they runserver in the project, they only get the "Welcome to
>> Django" page. The project admin and login page doesn't show up. I've
>> verified that all the model and settings info is correct, but we haven't
>> been able to get the info to show on the web page.
>>
>> Any suggestions on what we are doing wrong? I'm assuming a team can share
>> a Django project, but suspect we aren't collecting all the relevant files or
>> not getting the other team's environment set correctly.
>>
>> Thanks
>> Ralph
>>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGriRkeB5hZCd713eGvn05BzFnKUG3ASYN8T8vhS0rMdYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django, Bootstrap Tags input, and Typeahead?

2015-10-13 Thread Mark London


What is the easiest way to implement a django field with bootstrap and 
typeahead?  I found a module calleddjango-bootstrap-typeahead 
 
that looks exactly 
what I want. The instructions say to simply use "TypeaheadField" or 
"MultipleTypeaheadField" in n the django form.   I'm interested in using 
the MultipleTypeheadField feature, so that I can have the classic 
feature of being able to input tags, with typeahead.

I installed this boostrap/typeahead module, and then tried the 
test_project demo. See images. When I enter 2 tags into the 
"MultipleTypeaheadField", and then click submit, the first tag 
disappears, and only the 2nd tag is displayed by the code in views.py:

|messages.success(request,'MultipleTypeahead: %s'  %  
form.cleaned_data['multi_typeahead']|

See this page for image of the output from the demo:
http://stackoverflow.com/questions/32739556/best-method-to-implement-twitter-bootstrap-with-typeahead-in-django

Either I don't understand how the module is supposed to work, or the 
demo was not properly designed to show the list of all the inputted tags.

Should I use a different method?   Has anyone used this module?  Thanks. 
- Mark


-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f582428d-b552-481f-b8cc-92f827377731%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Team project via Git repo

2015-10-13 Thread Jonathan Querubina
This is a long shot, but, do you have .pyc files on the repository? If yes, try 
removing *.pyc

Sent from my iPhone

> On Oct 13, 2015, at 22:05, Jonathan Querubina  wrote:
> 
> No, if debug is true, you do not have to worry about statics yet
> 
> Are you activating the env before the runserver command?
> 
> Sent from my iPhone
> 
>> On Oct 13, 2015, at 21:56, Ralph Castain  wrote:
>> 
>> 
>>> On Oct 13, 2015, at 5:42 PM, Jonathan Querubina  wrote:
>>> 
>>> Have you installed any dependencies via "pip” ?
>> 
>> Only Django itself was installed via “pip” - we went thru the binaries and 
>> edited the path. We also uninstalled Django and reinstalled it on the host 
>> using “pip”, but the behavior is the same.
>> 
>>> 
>>> If not and all the code has been done under your djando apps, the problem 
>>> could be on the git. Have you checked .gitignore ?
>> 
>> We don’t have a .gitignore at this time as we weren’t sure what should be 
>> ignored. We also tried just copying the environment (no Git involved), and 
>> had the same result. So my guess is that there is some static file or 
>> something that needs refreshing so Django recognizes the project.
>> 
>> The “welcome” page indicates that we have DEBUG=TRUE in our settings, but 
>> that we haven’t configured any URLs. Is the URL in a static file, perchance?
>> 
>> 
>>> 
>>> Sent from my iPhone
>>> 
 On Oct 13, 2015, at 21:38, rhc.open...@gmail.com wrote:
 
 Just to update: we also tried simply copying the entire virtual 
 environment across, correcting for any differences in path. Still go the 
 same behavior.
 
 We'd really welcome some advice on this one as otherwise we won't be able 
 to use Django - we need a way to collaborate on implementation.
 
 Thanks
 Ralph
 
 
> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com 
> wrote:
> Hi folks
> 
> I'm a Django newbie (have found it very helpful!), so please excuse the 
> naivete. I have a question regarding team work on a Django project via 
> GitHub.
> 
> I followed your excellent tutorial and have a virtual Python v2.7 
> environment with Django 1.8.5 installed in it (FWIW: I thought I 
> installed Django 1.11, but django-admin --version shows 1.8.5). I then 
> created my app using "django-admin startproject foo" and got the project 
> subdirectory as expected. A quick check of the server showed the "Welcome 
> to Django" page.
> 
> I then added a bunch of model definitions and customized the admin page. 
> I verified that everything was okay by looking at the admin web page on 
> my localhost - the customized page is there, and I was able to add some 
> test data for one of the models. At this point, others want to pitch in 
> to help, and so I bundled everything in my project subdirectory 
> (including manage.py and the initial sqlite3 db) into a git repo and 
> pushed it up to GitHub.
> 
> The other team members also setup a virtual environment with Django, 
> using the same versions, and activated it. They then cloned the GitHub 
> repo and got all the project files as expected, and the directory 
> structure looks exactly the same.
> 
> However, when they runserver in the project, they only get the "Welcome 
> to Django" page. The project admin and login page doesn't show up. I've 
> verified that all the model and settings info is correct, but we haven't 
> been able to get the info to show on the web page.
> 
> Any suggestions on what we are doing wrong? I'm assuming a team can share 
> a Django project, but suspect we aren't collecting all the relevant files 
> or not getting the other team's environment set correctly.
> 
> Thanks
> Ralph
 
 
 -- 
 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 http://groups.google.com/group/django-users.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
>>> 
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/django-users/MlbkfJcJo08/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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 

Re: Team project via Git repo

2015-10-13 Thread Jonathan Querubina
No, if debug is true, you do not have to worry about statics yet

Are you activating the env before the runserver command?

Sent from my iPhone

> On Oct 13, 2015, at 21:56, Ralph Castain  wrote:
> 
> 
>> On Oct 13, 2015, at 5:42 PM, Jonathan Querubina  wrote:
>> 
>> Have you installed any dependencies via "pip” ?
> 
> Only Django itself was installed via “pip” - we went thru the binaries and 
> edited the path. We also uninstalled Django and reinstalled it on the host 
> using “pip”, but the behavior is the same.
> 
>> 
>> If not and all the code has been done under your djando apps, the problem 
>> could be on the git. Have you checked .gitignore ?
> 
> We don’t have a .gitignore at this time as we weren’t sure what should be 
> ignored. We also tried just copying the environment (no Git involved), and 
> had the same result. So my guess is that there is some static file or 
> something that needs refreshing so Django recognizes the project.
> 
> The “welcome” page indicates that we have DEBUG=TRUE in our settings, but 
> that we haven’t configured any URLs. Is the URL in a static file, perchance?
> 
> 
>> 
>> Sent from my iPhone
>> 
>>> On Oct 13, 2015, at 21:38, rhc.open...@gmail.com wrote:
>>> 
>>> Just to update: we also tried simply copying the entire virtual environment 
>>> across, correcting for any differences in path. Still go the same behavior.
>>> 
>>> We'd really welcome some advice on this one as otherwise we won't be able 
>>> to use Django - we need a way to collaborate on implementation.
>>> 
>>> Thanks
>>> Ralph
>>> 
>>> 
 On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
 Hi folks
 
 I'm a Django newbie (have found it very helpful!), so please excuse the 
 naivete. I have a question regarding team work on a Django project via 
 GitHub.
 
 I followed your excellent tutorial and have a virtual Python v2.7 
 environment with Django 1.8.5 installed in it (FWIW: I thought I installed 
 Django 1.11, but django-admin --version shows 1.8.5). I then created my 
 app using "django-admin startproject foo" and got the project subdirectory 
 as expected. A quick check of the server showed the "Welcome to Django" 
 page.
 
 I then added a bunch of model definitions and customized the admin page. I 
 verified that everything was okay by looking at the admin web page on my 
 localhost - the customized page is there, and I was able to add some test 
 data for one of the models. At this point, others want to pitch in to 
 help, and so I bundled everything in my project subdirectory (including 
 manage.py and the initial sqlite3 db) into a git repo and pushed it up to 
 GitHub.
 
 The other team members also setup a virtual environment with Django, using 
 the same versions, and activated it. They then cloned the GitHub repo and 
 got all the project files as expected, and the directory structure looks 
 exactly the same.
 
 However, when they runserver in the project, they only get the "Welcome to 
 Django" page. The project admin and login page doesn't show up. I've 
 verified that all the model and settings info is correct, but we haven't 
 been able to get the info to show on the web page.
 
 Any suggestions on what we are doing wrong? I'm assuming a team can share 
 a Django project, but suspect we aren't collecting all the relevant files 
 or not getting the other team's environment set correctly.
 
 Thanks
 Ralph
 
>>> 
>>> 
>>> -- 
>>> 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 http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/MlbkfJcJo08/unsubscribe.
>> To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3A0F673C-020E-4EEA-BDE1-AAB35BBFBCD2%40me.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the 

Re: Team project via Git repo

2015-10-13 Thread Ralph Castain

> On Oct 13, 2015, at 5:42 PM, Jonathan Querubina  wrote:
> 
> Have you installed any dependencies via "pip” ?

Only Django itself was installed via “pip” - we went thru the binaries and 
edited the path. We also uninstalled Django and reinstalled it on the host 
using “pip”, but the behavior is the same.

> 
> If not and all the code has been done under your djando apps, the problem 
> could be on the git. Have you checked .gitignore ?

We don’t have a .gitignore at this time as we weren’t sure what should be 
ignored. We also tried just copying the environment (no Git involved), and had 
the same result. So my guess is that there is some static file or something 
that needs refreshing so Django recognizes the project.

The “welcome” page indicates that we have DEBUG=TRUE in our settings, but that 
we haven’t configured any URLs. Is the URL in a static file, perchance?


> 
> Sent from my iPhone
> 
> On Oct 13, 2015, at 21:38, rhc.open...@gmail.com 
>  wrote:
> 
>> Just to update: we also tried simply copying the entire virtual environment 
>> across, correcting for any differences in path. Still go the same behavior.
>> 
>> We'd really welcome some advice on this one as otherwise we won't be able to 
>> use Django - we need a way to collaborate on implementation.
>> 
>> Thanks
>> Ralph
>> 
>> 
>> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com 
>>  wrote:
>> Hi folks
>> 
>> I'm a Django newbie (have found it very helpful!), so please excuse the 
>> naivete. I have a question regarding team work on a Django project via 
>> GitHub.
>> 
>> I followed your excellent tutorial and have a virtual Python v2.7 
>> environment with Django 1.8.5 installed in it (FWIW: I thought I installed 
>> Django 1.11, but django-admin --version shows 1.8.5). I then created my app 
>> using "django-admin startproject foo" and got the project subdirectory as 
>> expected. A quick check of the server showed the "Welcome to Django" page.
>> 
>> I then added a bunch of model definitions and customized the admin page. I 
>> verified that everything was okay by looking at the admin web page on my 
>> localhost - the customized page is there, and I was able to add some test 
>> data for one of the models. At this point, others want to pitch in to help, 
>> and so I bundled everything in my project subdirectory (including manage.py 
>> and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
>> 
>> The other team members also setup a virtual environment with Django, using 
>> the same versions, and activated it. They then cloned the GitHub repo and 
>> got all the project files as expected, and the directory structure looks 
>> exactly the same.
>> 
>> However, when they runserver in the project, they only get the "Welcome to 
>> Django" page. The project admin and login page doesn't show up. I've 
>> verified that all the model and settings info is correct, but we haven't 
>> been able to get the info to show on the web page.
>> 
>> Any suggestions on what we are doing wrong? I'm assuming a team can share a 
>> Django project, but suspect we aren't collecting all the relevant files or 
>> not getting the other team's environment set correctly.
>> 
>> Thanks
>> Ralph
>> 
>> 
>> -- 
>> 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 http://groups.google.com/group/django-users 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%40googlegroups.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Django users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/django-users/MlbkfJcJo08/unsubscribe 
> .
> To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> 

Re: Team project via Git repo

2015-10-13 Thread Jonathan Querubina
Have you installed any dependencies via "pip" ?

If not and all the code has been done under your djando apps, the problem could 
be on the git. Have you checked .gitignore ?

Sent from my iPhone

> On Oct 13, 2015, at 21:38, rhc.open...@gmail.com wrote:
> 
> Just to update: we also tried simply copying the entire virtual environment 
> across, correcting for any differences in path. Still go the same behavior.
> 
> We'd really welcome some advice on this one as otherwise we won't be able to 
> use Django - we need a way to collaborate on implementation.
> 
> Thanks
> Ralph
> 
> 
>> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
>> Hi folks
>> 
>> I'm a Django newbie (have found it very helpful!), so please excuse the 
>> naivete. I have a question regarding team work on a Django project via 
>> GitHub.
>> 
>> I followed your excellent tutorial and have a virtual Python v2.7 
>> environment with Django 1.8.5 installed in it (FWIW: I thought I installed 
>> Django 1.11, but django-admin --version shows 1.8.5). I then created my app 
>> using "django-admin startproject foo" and got the project subdirectory as 
>> expected. A quick check of the server showed the "Welcome to Django" page.
>> 
>> I then added a bunch of model definitions and customized the admin page. I 
>> verified that everything was okay by looking at the admin web page on my 
>> localhost - the customized page is there, and I was able to add some test 
>> data for one of the models. At this point, others want to pitch in to help, 
>> and so I bundled everything in my project subdirectory (including manage.py 
>> and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
>> 
>> The other team members also setup a virtual environment with Django, using 
>> the same versions, and activated it. They then cloned the GitHub repo and 
>> got all the project files as expected, and the directory structure looks 
>> exactly the same.
>> 
>> However, when they runserver in the project, they only get the "Welcome to 
>> Django" page. The project admin and login page doesn't show up. I've 
>> verified that all the model and settings info is correct, but we haven't 
>> been able to get the info to show on the web page.
>> 
>> Any suggestions on what we are doing wrong? I'm assuming a team can share a 
>> Django project, but suspect we aren't collecting all the relevant files or 
>> not getting the other team's environment set correctly.
>> 
>> Thanks
>> Ralph
> 
> -- 
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3A0F673C-020E-4EEA-BDE1-AAB35BBFBCD2%40me.com.
For more options, visit https://groups.google.com/d/optout.


Re: Team project via Git repo

2015-10-13 Thread rhc . openmpi
Just to update: we also tried simply copying the entire virtual environment 
across, correcting for any differences in path. Still go the same behavior.

We'd really welcome some advice on this one as otherwise we won't be able 
to use Django - we need a way to collaborate on implementation.

Thanks
Ralph


On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
>
> Hi folks
>
> I'm a Django newbie (have found it very helpful!), so please excuse the 
> naivete. I have a question regarding team work on a Django project via 
> GitHub.
>
> I followed your excellent tutorial and have a virtual Python v2.7 
> environment with Django 1.8.5 installed in it (FWIW: I thought I installed 
> Django 1.11, but django-admin --version shows 1.8.5). I then created my app 
> using "django-admin startproject foo" and got the project subdirectory as 
> expected. A quick check of the server showed the "Welcome to Django" page.
>
> I then added a bunch of model definitions and customized the admin page. I 
> verified that everything was okay by looking at the admin web page on my 
> localhost - the customized page is there, and I was able to add some test 
> data for one of the models. At this point, others want to pitch in to help, 
> and so I bundled everything in my project subdirectory (including manage.py 
> and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
>
> The other team members also setup a virtual environment with Django, using 
> the same versions, and activated it. They then cloned the GitHub repo and 
> got all the project files as expected, and the directory structure looks 
> exactly the same.
>
> However, when they runserver in the project, they only get the "Welcome to 
> Django" page. The project admin and login page doesn't show up. I've 
> verified that all the model and settings info is correct, but we haven't 
> been able to get the info to show on the web page.
>
> Any suggestions on what we are doing wrong? I'm assuming a team can share 
> a Django project, but suspect we aren't collecting all the relevant files 
> or not getting the other team's environment set correctly.
>
> Thanks
> Ralph
>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: inlineformset_factory with multiple foreignKeys

2015-10-13 Thread Nkansah Rexford
With multiple inlineformset_factory, Ive not tried, but perhaps this could 
help: 
http://stackoverflow.com/questions/3945435/adding-multiple-models-to-inlineformset-factory

Mine was just one inlineform

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b0dd43c0-ba4f-4fe8-9aca-493202fc8bd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


inlineformset_factory with multiple foreignKeys

2015-10-13 Thread jupiter
Hi,

How can the inlineformset_factory be used for multiple following
foreignKeys at following an example?

class Recipe(models.Model):
pub_date = models.DateTimeField('Date Published', auto_now_add = True)
title = models.CharField(max_length=200)
instructions = models.TextField()

class Ingredients(models.Model):
pub_date = models.DateTimeField('Date Published', auto_now_add = True)
title = models.CharField(max_length=200)
instructions = models.TextField()

class RecipeIngredient(models.Model):
recipe = models.ForeignKey(Recipe)
ingredient = models.ForeignKey(Ingredients)


ingredientFormSet = inlineformset_factory(Recipe, Ingredients,
RecipeIngredient) doesn't seem work.

Thank you.

- jup

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3DhcWSsR%2B1j1aL0n_XUMEEmWm%2BJRXFPuPX9FGNjkZpJsNr7Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Team project via Git repo

2015-10-13 Thread rhc . openmpi
Hi folks

I'm a Django newbie (have found it very helpful!), so please excuse the 
naivete. I have a question regarding team work on a Django project via 
GitHub.

I followed your excellent tutorial and have a virtual Python v2.7 
environment with Django 1.8.5 installed in it (FWIW: I thought I installed 
Django 1.11, but django-admin --version shows 1.8.5). I then created my app 
using "django-admin startproject foo" and got the project subdirectory as 
expected. A quick check of the server showed the "Welcome to Django" page.

I then added a bunch of model definitions and customized the admin page. I 
verified that everything was okay by looking at the admin web page on my 
localhost - the customized page is there, and I was able to add some test 
data for one of the models. At this point, others want to pitch in to help, 
and so I bundled everything in my project subdirectory (including manage.py 
and the initial sqlite3 db) into a git repo and pushed it up to GitHub.

The other team members also setup a virtual environment with Django, using 
the same versions, and activated it. They then cloned the GitHub repo and 
got all the project files as expected, and the directory structure looks 
exactly the same.

However, when they runserver in the project, they only get the "Welcome to 
Django" page. The project admin and login page doesn't show up. I've 
verified that all the model and settings info is correct, but we haven't 
been able to get the info to show on the web page.

Any suggestions on what we are doing wrong? I'm assuming a team can share a 
Django project, but suspect we aren't collecting all the relevant files or 
not getting the other team's environment set correctly.

Thanks
Ralph

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/714a9f8e-9ff6-4681-aa97-8881e177a746%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.8: subclass AbstractUser, App 'auth' doesn't have a 'myuser' model.

2015-10-13 Thread Tim Graham
Do you want to use the custom user model or not? What extra tables are 
created?

On Tuesday, October 13, 2015 at 1:31:03 PM UTC-7, Norberto Bensa wrote:
>
> Hello, 
>
> I'm re-posting this. 
>
> Note that I already tried AUTH_USER_MODEL = "myauth.MyUser', and while 
> that makes the problem disappear, the change also creates new tables 
> in the database. 
>
> What are my options? AFAIK 1.6 is deprecated for security reasons and 
> I want to upgrade to 1.8.x. 
>
> Thanks. 
> Norberto 
>
>
>
> -- Forwarded message -- 
> From: 술욱  
> Date: 2015-10-06 22:37 GMT-03:00 
> Subject: Django 1.8: subclass AbstractUser, App 'auth' doesn't have a 
> 'myuser' model. 
> To: 'Tom  
>
>
> Hello, 
>
> I'm trying to upgrade an app from Django 1.6 to 1.8 but I can't solve 
> a problem apparently related to a custom user model. 
>
> The project has an 'auth' app with its corresponding models.py and 
> apps.py. The snippet pasted bellow reproduces the problem which I 
> don't know how to fix. 
>
> Many TIA, 
> Norberto 
>
>
> # auth/models.py 
> from django.contrib.auth.models import AbstractUser 
> from django.db import models 
>
> class MyUser(AbstractUser): 
> pass 
>
>
> # auth/apps.py 
> from django.apps import AppConfig 
>
> class MyAuth(AppConfig): 
> name = 'auth' 
> label = 'myauth' 
>
>
> # project/setting.py 
>
> INSTALLED_APPS = ( 
> ... 
> 'auth.apps.MyAuth', 
> ... 
> ) 
>
> AUTH_USER_MODEL = 'auth.MyUser' 
>
>
> Note apps.py is there just because 'auth' collides with 
> django.contrib.auth. 
>
>
> $ ./manage.py makemigrations 
> Traceback (most recent call last): 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/apps/config.py",
>  
>
> line 159, in get_model 
> return self.models[model_name.lower()] 
> KeyError: 'myuser' 
>
> During handling of the above exception, another exception occurred: 
>
> Traceback (most recent call last): 
>   File "./manage.py", line 10, in  
> execute_from_command_line(sys.argv) 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/__init__.py",
>  
>
> line 351, in execute_from_command_line 
> utility.execute() 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/__init__.py",
>  
>
> line 343, in execute 
> self.fetch_command(subcommand).run_from_argv(self.argv) 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/base.py",
>  
>
> line 394, in run_from_argv 
> self.execute(*args, **cmd_options) 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/base.py",
>  
>
> line 444, in execute 
> self.check() 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/base.py",
>  
>
> line 482, in check 
> include_deployment_checks=include_deployment_checks, 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/checks/registry.py",
>  
>
> line 72, in run_checks 
> new_errors = check(app_configs=app_configs) 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/contrib/auth/checks.py",
>  
>
> line 12, in check_user_model 
> cls = apps.get_model(settings.AUTH_USER_MODEL) 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/apps/registry.py",
>  
>
> line 202, in get_model 
> return self.get_app_config(app_label).get_model(model_name.lower()) 
>   File 
> "/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/apps/config.py",
>  
>
> line 162, in get_model 
> "App '%s' doesn't have a '%s' model." % (self.label, model_name)) 
> LookupError: App 'auth' doesn't have a 'myuser' model. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7f285c9a-6088-4615-8b68-342322ad89c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: Django 1.8: subclass AbstractUser, App 'auth' doesn't have a 'myuser' model.

2015-10-13 Thread 술욱
Hello,

I'm re-posting this.

Note that I already tried AUTH_USER_MODEL = "myauth.MyUser', and while
that makes the problem disappear, the change also creates new tables
in the database.

What are my options? AFAIK 1.6 is deprecated for security reasons and
I want to upgrade to 1.8.x.

Thanks.
Norberto



-- Forwarded message --
From: 술욱 
Date: 2015-10-06 22:37 GMT-03:00
Subject: Django 1.8: subclass AbstractUser, App 'auth' doesn't have a
'myuser' model.
To: 'Tom 


Hello,

I'm trying to upgrade an app from Django 1.6 to 1.8 but I can't solve
a problem apparently related to a custom user model.

The project has an 'auth' app with its corresponding models.py and
apps.py. The snippet pasted bellow reproduces the problem which I
don't know how to fix.

Many TIA,
Norberto


# auth/models.py
from django.contrib.auth.models import AbstractUser
from django.db import models

class MyUser(AbstractUser):
pass


# auth/apps.py
from django.apps import AppConfig

class MyAuth(AppConfig):
name = 'auth'
label = 'myauth'


# project/setting.py

INSTALLED_APPS = (
...
'auth.apps.MyAuth',
...
)

AUTH_USER_MODEL = 'auth.MyUser'


Note apps.py is there just because 'auth' collides with django.contrib.auth.


$ ./manage.py makemigrations
Traceback (most recent call last):
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/apps/config.py",
line 159, in get_model
return self.models[model_name.lower()]
KeyError: 'myuser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/__init__.py",
line 351, in execute_from_command_line
utility.execute()
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/__init__.py",
line 343, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/base.py",
line 394, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/base.py",
line 444, in execute
self.check()
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/management/base.py",
line 482, in check
include_deployment_checks=include_deployment_checks,
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/core/checks/registry.py",
line 72, in run_checks
new_errors = check(app_configs=app_configs)
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/contrib/auth/checks.py",
line 12, in check_user_model
cls = apps.get_model(settings.AUTH_USER_MODEL)
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/apps/registry.py",
line 202, in get_model
return self.get_app_config(app_label).get_model(model_name.lower())
  File 
"/home/ubuntu/.virtualenvs/testauth/lib/python3.4/site-packages/django/apps/config.py",
line 162, in get_model
"App '%s' doesn't have a '%s' model." % (self.label, model_name))
LookupError: App 'auth' doesn't have a 'myuser' model.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADut3oAOHQDU1eazukzbN62r5tpDkBXZz143C5tMMMaZwuh71A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


GenericForeignKey and Proxy Models

2015-10-13 Thread Fermin Arellano
I am using proxy models (Student, Teacher, Parent) from a base class 
Person. 

I also have a class called BoardMember which uses the content type 
framework. In Boardmember I declared a GenericForeignKey(content_type, 
object_id, for_concrete_model=False).

In my proxy model (Teacher) I declared a generic relation   board = 
GenericRelation(Boardmember)  .

In my admin I have a model called Board and BoardMember is a TabularInline 
of Board. 

So, whenever I add a new Teacher as a Boardmember, the content_type_id 
being saved is the one of Teacher. This is the normal behavior, since I set 
for_concrete_model to False so it can reference Proxy models. So everything 
great. The problem is when I am trying to make a reverse relationship. When 
I do the following the relationship doesnt work. 

>>>Teacher.objects.filter(board__isnull=True)
[]

This instruction should return all the Teacher objects who are related as a 
BoardMember. 

Now if I do the following changes I can get it to work.

- First I remove for_concrete_model = False from my GenericForeignKey. This 
will default it to true. 
- Now whenever I associate a Teacher as a BoardMember in my admin, the 
content_type_id being saved is the one of Person, the base class. 

Now I can do the following:

>>>Teacher.objects.filter(board__isnull=True)
[ ]

So now it does work, funny things is that the GenericRelation is set on 
Teacher and not Person. The content type saved was the one of Person and 
yet I can use the GenericRelation from Teacher object. This is really weird 
behavior. Can someone explain. I get the feeling very often that I have to 
be hacking solutions in Django Framework when things should be straight 
forward solutions. 

Thanks a lot!

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1482300c-0c59-4974-9b23-8357f769bd5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ManyToMany doesn't support validators?

2015-10-13 Thread Tim Graham
The rationale is described in https://code.djangoproject.com/ticket/19671.

On Tuesday, October 13, 2015 at 7:06:16 AM UTC-7, Mike Herring wrote:
>
> Doc here:
>
> https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.ManyToManyField
>
> ManyToManyField does not support validators.
>
>
> Is there a particular reason that ManyToManyField doesn't support 
> validators? I would like to add a validator to require the user to select 
> at least 3 options, but it seems the field simply doesn't run validators. I 
> attempted to add one in like this:
>
> from django.core.exceptions import ValidationError
>
> def validate_three(value):
>
> if len(value) < 3:
>
> raise ValidationError("Must choose three related posts")
>
>
> BlogPost._meta.get_field('related_posts').validators.append(validate_three)
>
> But when it validates the field later, it says that self.validators == []
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f4a3970a-d432-4140-a897-3ee9885ab0e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ManyToMany doesn't support validators?

2015-10-13 Thread Mike Herring
Doc here:
https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.ManyToManyField

ManyToManyField does not support validators.


Is there a particular reason that ManyToManyField doesn't support 
validators? I would like to add a validator to require the user to select 
at least 3 options, but it seems the field simply doesn't run validators. I 
attempted to add one in like this:

from django.core.exceptions import ValidationError

def validate_three(value):

if len(value) < 3:

raise ValidationError("Must choose three related posts")


BlogPost._meta.get_field('related_posts').validators.append(validate_three)

But when it validates the field later, it says that self.validators == []

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6c99c5cc-a163-4731-8b0d-00fa6beda989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: is Django right choice for a financial app

2015-10-13 Thread Avraham Serour
well if you have online reviews stating or showing that sqlalchemy is
faster than django ORM, than this is exactly what I'm asking you to post,
it would be an interesting read

On Tue, Oct 13, 2015 at 5:24 AM, kk  wrote:

> hello,
>
>
> On Tuesday 13 October 2015 04:09 AM, Avraham Serour wrote:
>
> Sqlalchemy is more performant? In what way? Do you have any reference or
> this was from personal experience?
>
> Personal experience and some online reviews.
>
> On Oct 13, 2015 1:11 AM, "kk" < krm...@gmail.com> wrote:
>
>>
>>
>> On Tuesday 13 October 2015 01:27 AM, bobhaugen wrote:
>>
>> krmane, google is misbehaving and will not allow me to reply to your
>> reply to me, so I'll fake it and do some cutnpasting.
>>
>> You wrote:
>> >  I did not get the react concept.
>> https://facebook.github.io/react/
>>
>> I wrote:
>>
>> We use the django ORM, not sqlalchemy, but that would probably just make
>> it all better.
>>
>> And you replied: Oh is that so?
>>
>> And now I am stuck in a box. But anyway, I think my comment
>> miscommunicated. I meant sqlalchemy would probably make it better.
>> --
>>
>> I see, I am sorry I could not read it properly.
>> I use a screen reader because I am totally blind.
>> I guess it did not read things properly in a way that associated lines
>> correctly.
>> I know for sure sqlalchemy is more performant so was thinking.
>> happy hacking.
>> Krishnakant.
>> --
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> 
>> https://groups.google.com/d/msgid/django-users/561C2FEF.8030800%40gmail.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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/django-users/CAFWa6tLcxawEHaSAvGsaUBpKDEq2O%2BWHZ-KoTPqtVsbuhUZs7w%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/561C6B73.4090301%40gmail.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tJSmGZjFAbRf9bsQ9ax7ViZEaxTQwDxScYBUT-AtSnNSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django

2015-10-13 Thread François Schiettecatte
This does not really make sense? What do you mean?

> On Oct 13, 2015, at 8:06 AM, Anagha R  wrote:
> 
> what is the first steps in fixing an identified web?
> 
> -- 
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/eba006c4-3aaa-416c-a58d-7a525d14b2f8%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4C9A980F-D570-49F5-920E-5EE8FB3F738F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


django

2015-10-13 Thread Anagha R
what is the first steps in fixing an identified web?

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eba006c4-3aaa-416c-a58d-7a525d14b2f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can I display assigned group to users with list_display in admin.py?

2015-10-13 Thread Dropd
I created this question on StackExchange but no answer that helped me 
understand what is needed to be done. Can anyone help me understand what I 
need to build and what it does? 

*Question:*
 
http://stackoverflow.com/questions/33088666/how-to-display-assigned-group-with-list-display-in-django-admin

*Summary:* How can I display assigned group to users with list_display in 
admin.py?

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7083cfd-38af-4cfd-b944-0e949585f81c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HTMLDOC as a python view

2015-10-13 Thread MikeKJ
The shell command worker may be at fault as the files in media/pdf are 
0byte but having said that of course if the varaibles being sent to it are 
erroneous that would have the same effect wood trees

I'll have a look at easy_pdf, I have the context dict available so should 
be a relatively quick shoe in to test, thanks



On Monday, October 12, 2015 at 9:54:33 PM UTC+1, James Schneider wrote:
>
> > Please excuse if this is the wrong forum and if a mod wants to move it 
> please feel free, just please let me know where it went.
> >
> > I'm attempting to convert html to pdf on the fly with HTMLDOC.
> >
> > The fly in the ointment appears to be that the generated pdf is not 
> viewable in that it opens Adobe Reader and gives a warning This PDF 
> document might not be displayed correctly.
> >
>
> Sounds like an issue with the shell application you are using to generate 
> it. Have you tried manually grabbing the generated file from the server 
> (not through the web) and opening it with the same result?
>
> > worker = subprocess.Popen( """htmldoc --webpage "%s" --linkstyle 
> plain --footer ... --no-compression -t pdf14 > %s_tmp""" % ( url, 
> outputfile ), shell = True, stdout = subprocess.PIPE, stderr = 
> subprocess.STDOUT )
>
> Have you tried running the command manually in the shell and then trying 
> to open the PDF? That would eliminate Django as a culprit.
>
> -James
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c5ef8275-f0f7-4307-b1d2-923672e9a197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.