Re: What is the proper workflow before first migration?

2019-04-05 Thread jgibson
Hi,

Can you post the structure of your app, including project root?  Setting up 
a CustomUser Model is not a simple task, especially if you are new to the 
framework.

On Friday, April 5, 2019 at 11:06:43 AM UTC-4, silverst...@gmail.com wrote:
>
> Something odd is that when the Manager unavailable error comes up, the 
> path in the terminal is " "POST /accounts/accounts/templates/registration/ 
> HTTP/1.1"   Why does accounts come up twice
>

-- 
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/a40b4255-6aa1-4123-b843-f171e5c4cb48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What step am I missing?

2019-04-03 Thread jgibson
Sorry, I addressed this to Pedro when I meant jos.jwj.

On Wednesday, April 3, 2019 at 11:24:11 AM UTC-4, jgi...@caktusgroup.com 
wrote:
>
> Pedro,
>
> Can you provide us with the structure of your project?  For example:
>
> /home/pedro/intro_django/
> /home/pedro/intro_django/manage.py
> /home/pedro/intro_django/apps/
> /home/pedro/intro_django/apps/models.py
> /home/pedro/intro_django/apps/views.py
>
>
> Then let us know which where you are issuing the command "py manage.py 
> runserver"
>
> Thanks,
>
> Jeremy Gibson
> https://caktusgroup.com
>
> On Wednesday, April 3, 2019 at 10:33:45 AM UTC-4, jos.jwj wrote:
>>
>> Pedro, 
>> I apologize for the response delay. First thank you very much for 
>> recommending pycharm. I do still find myself getting stuck on the same 
>> line. when I've run the code >py manage.py runserver I still receive an 
>> error that ' manage.py does not exist'. I'm sure it is a basic step that 
>> I'm not seeing, and taking a month to complete a basic tutorial is 
>> certainly humbling. any advice would be greatly appreciated and if I'm not 
>> being descriptive enough please let me know and I will do my best to be as 
>> accurate as possible. Thank you,
>>
>> Joseph
>>
>> On Fri, Mar 15, 2019 at 6:45 AM Pedro Folch  wrote:
>>
>>> Also try using pycharm it will probably be easier for running django.  
>>> It helps.
>>>
>>> On Thu, Mar 14, 2019, 9:22 PM Pedro Folch  wrote:
>>>
 Your cms line should be in the same directory as the manage.py

 On Thu, Mar 14, 2019, 8:46 PM Joseph Jones  wrote:

> Hi, 
> yes Thank you so much those video tutorial helped me quite a bit. I 
> was able to create a new directory, as the "introduction to django" 
> tutorial suggested I've made sure its title is project specific. However, 
> I 
> seem to have run into a problem creating a path to my new directory. when 
> last I ran the command I received an Command error stating that my 
> project 
> name was not valid. Any thoughts on what detail I am overlooking would be 
> very appreciated,
> Thank you
>
> On Tue, Mar 12, 2019 at 8:30 AM Suresh Kannan  
> wrote:
>
>> Hi,
>>
>> You can watch these videos. I think this might help you.
>>
>> https://www.youtube.com/watch?v=FNQxxpM1yOs (windows)
>>
>>
>> https://www.youtube.com/watch?v=oT1A1KKf0SI=PLxxA5z-8B2xk4szCgFmgonNcCboyNneMD
>>  
>> (linux)
>>
>> On Mon, 11 Mar 2019 at 09:35, Joseph Jones  wrote:
>>
>>> Thank you so much, does one bring up the cd command in the python 
>>> terminal?
>>>
>>> On Mon, Mar 11, 2019 at 8:07 AM Kayode Oladipo  
>>> wrote:
>>>
 You have to be in the project level directory to access 'manage.py'.
 Use the 'cd' command in the terminal to do this.

 On Sun, Mar 10, 2019, 23:23 Joseph Jones >>>
> Hello all!
> I have been reading  
> https://www.packtpub.com/application-development/learn-python-programming-second-edition
>  Since 
> November, so I am very much new to the Python community. I am 
> currently on 
> chapter 14 "Web development" which suggests completing the tutorial 
> on  
> djangoproject.com after installing Django of course. When I've 
> run the first two commands in the cmd of my PC I get the output the 
> tutorial would indicate. However when I run the command .../> py 
> manage.py 
> runserver I receive a command error that no such file exists. My 
> question 
> is what mistake am I making? I'm hypothesizing one is to create a 
> file 
> entitled "manage.py' before beginning, however unless I'm misreading 
> the 
> text in the tutorial the command .../> django-admin startproject 
> runserver 
> auto-generates said file. Any suggestions on what I'm doing wrong 
> would be 
> immensely appreciated. Let me apologize in advance if I either, ask 
> for 
> clarification in any responses(again I am new), or mess up again 
> through 
> out the course of the tutorial and again reach out to the community. 
> Thank 
> you for any help,
> Joseph
>
> -- 
> 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...@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/CAJGsC5OzcyMwrW%3D-EmU%2B-3o8esQ2JeVQoJScq%3DHy_mtsxKRuKQ%40mail.gmail.com
>  
> 

Re: What step am I missing?

2019-04-03 Thread jgibson
Pedro,

Can you provide us with the structure of your project?  For example:

/home/pedro/intro_django/
/home/pedro/intro_django/manage.py
/home/pedro/intro_django/apps/
/home/pedro/intro_django/apps/models.py
/home/pedro/intro_django/apps/views.py


Then let us know which where you are issuing the command "py manage.py 
runserver"

Thanks,

Jeremy Gibson
https://caktusgroup.com

On Wednesday, April 3, 2019 at 10:33:45 AM UTC-4, jos.jwj wrote:
>
> Pedro, 
> I apologize for the response delay. First thank you very much for 
> recommending pycharm. I do still find myself getting stuck on the same 
> line. when I've run the code >py manage.py runserver I still receive an 
> error that ' manage.py does not exist'. I'm sure it is a basic step that 
> I'm not seeing, and taking a month to complete a basic tutorial is 
> certainly humbling. any advice would be greatly appreciated and if I'm not 
> being descriptive enough please let me know and I will do my best to be as 
> accurate as possible. Thank you,
>
> Joseph
>
> On Fri, Mar 15, 2019 at 6:45 AM Pedro Folch  > wrote:
>
>> Also try using pycharm it will probably be easier for running django.  It 
>> helps.
>>
>> On Thu, Mar 14, 2019, 9:22 PM Pedro Folch > > wrote:
>>
>>> Your cms line should be in the same directory as the manage.py
>>>
>>> On Thu, Mar 14, 2019, 8:46 PM Joseph Jones >> > wrote:
>>>
 Hi, 
 yes Thank you so much those video tutorial helped me quite a bit. I was 
 able to create a new directory, as the "introduction to django" tutorial 
 suggested I've made sure its title is project specific. However, I seem to 
 have run into a problem creating a path to my new directory. when last I 
 ran the command I received an Command error stating that my project name 
 was not valid. Any thoughts on what detail I am overlooking would be very 
 appreciated,
 Thank you

 On Tue, Mar 12, 2019 at 8:30 AM Suresh Kannan >>> > wrote:

> Hi,
>
> You can watch these videos. I think this might help you.
>
> https://www.youtube.com/watch?v=FNQxxpM1yOs (windows)
>
>
> https://www.youtube.com/watch?v=oT1A1KKf0SI=PLxxA5z-8B2xk4szCgFmgonNcCboyNneMD
>  
> (linux)
>
> On Mon, 11 Mar 2019 at 09:35, Joseph Jones  > wrote:
>
>> Thank you so much, does one bring up the cd command in the python 
>> terminal?
>>
>> On Mon, Mar 11, 2019 at 8:07 AM Kayode Oladipo > > wrote:
>>
>>> You have to be in the project level directory to access 'manage.py'.
>>> Use the 'cd' command in the terminal to do this.
>>>
>>> On Sun, Mar 10, 2019, 23:23 Joseph Jones >>  wrote:
>>>
 Hello all!
 I have been reading  
 https://www.packtpub.com/application-development/learn-python-programming-second-edition
  Since 
 November, so I am very much new to the Python community. I am 
 currently on 
 chapter 14 "Web development" which suggests completing the tutorial on 
  
 djangoproject.com after installing Django of course. When I've run 
 the first two commands in the cmd of my PC I get the output the 
 tutorial 
 would indicate. However when I run the command .../> py manage.py 
 runserver 
 I receive a command error that no such file exists. My question is 
 what 
 mistake am I making? I'm hypothesizing one is to create a file 
 entitled 
 "manage.py' before beginning, however unless I'm misreading the text 
 in the 
 tutorial the command .../> django-admin startproject runserver 
 auto-generates said file. Any suggestions on what I'm doing wrong 
 would be 
 immensely appreciated. Let me apologize in advance if I either, ask 
 for 
 clarification in any responses(again I am new), or mess up again 
 through 
 out the course of the tutorial and again reach out to the community. 
 Thank 
 you for any help,
 Joseph

 -- 
 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...@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/CAJGsC5OzcyMwrW%3D-EmU%2B-3o8esQ2JeVQoJScq%3DHy_mtsxKRuKQ%40mail.gmail.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>>> You received this 

Re: Newbie question : running the makemigrations command in the terminal

2019-03-28 Thread jgibson
>From your settings file:
 

> munichliving_app.apps.MunichLivingConfig
>
>
That makes me think that the structure of your project looks something like 
this:

\munichliving_app\manage.py
\munichliving_app\apps\MunichLivingConfig\
\munichliving_app\apps\MunichLivingConfig\models.py
\munichliving_app\apps\MunichLivingConfig\views.py
\munichliving_app\apps\MunichLivingConfig\admin.py





And `OffererProfile` is defined inside models. Is that correct?

On Thursday, March 28, 2019 at 11:35:46 AM UTC-4, kamiba...@gmail.com wrote:
>
> Hello,
>
> (Newbie here): I am trying to run the makemigrations icommand in my 
> terminal. You will find here below the three relevant files, the third one 
> showing the errors displayed in 
> the terminal. 
>
> My settings.py file:
>
>
> https://pastebin.com/raw/xLpX0Zfg
>
>
> My models.py file: 
>
> https://pastebin.com/raw/wYfSy8ET
>
>
> The terminal entry (with the errors)
>
>
> https://pastebin.com/raw/Pmpnepf1
>
>
> Thank you for your time and your help.
>
>
> K.
>

-- 
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/9d5f73c3-0335-4003-8162-5c72aa07f723%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I create schemas while writing creating table models.

2019-03-26 Thread jgibson
Hi Sushen,

https://www.amvtek.com/blog/posts/2014/Jun/13/accessing-multiple-postgres-schemas-from-django/

This seems to be a rare use case, but that link has some options.  

Good Luck!


On Friday, March 22, 2019 at 8:58:20 PM UTC-4, Sushen Jamwal wrote:
>
> Hi all, 
>
> I am finding it difficult to create tables in different schemas under one 
> database. 
>
> For ex. mydatabase.myschemaone.school (DB.SCHEMA.TABLE) 
>
> and mydatabase.myschematwo.school 
>
> Thanks, 
> Sushen

-- 
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/f618114e-9a03-437f-bb52-2fb44533a116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to inherit the user model in two apps in django rest,

2019-03-26 Thread jgibson
I'm not exactly sure what is happening with your models but a few places to 
investigate are these:

Since you are using `AbstractBaseUser` rather than `AbstractUser`:

* Looking at your code it seems like you missed assigning the 
*`USERNAME_FIELD`*
* You did not set your identifier (which I assume would be your username) 
to be *`unique=True`*

*https://docs.djangoproject.com/en/1.11/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD
 
*


Good Luck,

Jeremy Gibson
email:  jgib...@caktusgroup.com
website:  http://www.caktusgroup.com/


On Tuesday, March 26, 2019 at 7:25:58 AM UTC-4, Shubham Joshi wrote:
>
> I want to create 2 separate signup form 1 for teacher and 1 for a student 
> for that I created 2 apps and its respective models but it gives an error 
>
>
> https://github.com/shubham1507/school
>
> ==
> ERRORS:
> auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes 
> with reverse accessor for 'studentRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.groups' or 'studentRegistration.groups'.
> auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes 
> with reverse accessor for 'teacherRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.groups' or 'teacherRegistration.groups'.
> auth.User.user_permissions: (fields.E304) Reverse accessor for 
> 'User.user_permissions' clashes with reverse accessor for 
> 'studentRegistration.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.user_permissions' or 'studentRegistration.user_permissions'.
> auth.User.user_permissions: (fields.E304) Reverse accessor for 
> 'User.user_permissions' clashes with reverse accessor for 
> 'teacherRegistration.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.user_permissions' or 'teacherRegistration.user_permissions'.
> student.studentRegistration.groups: (fields.E304) Reverse accessor for 
> 'studentRegistration.groups' clashes with reverse accessor for 
> 'User.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.groups' or 'User.groups'.
> student.studentRegistration.groups: (fields.E304) Reverse accessor for 
> 'studentRegistration.groups' clashes with reverse accessor for 
> 'teacherRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.groups' or 'teacherRegistration.groups'.
> student.studentRegistration.image: (fields.E210) Cannot use ImageField 
> because Pillow is not installed.
> HINT: Get Pillow at https://pypi.org/project/Pillow/ or run 
> command "pip install Pillow".
> student.studentRegistration.parents_name: (fields.E120) CharFields must 
> define a 'max_length' attribute.
> student.studentRegistration.user_permissions: (fields.E304) Reverse 
> accessor for 'studentRegistration.user_permissions' clashes with reverse 
> accessor for 'User.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.user_permissions' or 'User.user_permissions'.
> student.studentRegistration.user_permissions: (fields.E304) Reverse 
> accessor for 'studentRegistration.user_permissions' clashes with reverse 
> accessor for 'teacherRegistration.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.user_permissions' or 
> 'teacherRegistration.user_permissions'.
> teacher.teacherRegistration.groups: (fields.E304) Reverse accessor for 
> 'teacherRegistration.groups' clashes with reverse accessor for 
> 'User.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'teacherRegistration.groups' or 'User.groups'.
> teacher.teacherRegistration.groups: (fields.E304) Reverse accessor for 
> 'teacherRegistration.groups' clashes with reverse accessor for 
> 'studentRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'teacherRegistration.groups' or 'studentRegistration.groups'.
> teacher.teacherRegistration.qualification: (fields.E120) CharFields must 
> define a 'max_length' attribute.
> teacher.teacherRegistration.subjectExperty: (fields.E120) CharFields must 
> define a 'max_length' attribute.
> teacher.teacherRegistration.user_permissions: (fields.E304) Reverse 
> accessor for 'teacherRegistration.user_permissions' clashes with reverse 
> accessor for 'User.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'teacherRegistration.user_permissions' or 'User.user_permissions'.
> teacher.teacherRegistration.user_permissions: (fields.E304) Reverse 
> 

Re: test if model object fits into QuerySet without executing SQL?

2019-03-18 Thread jgibson
result = qs1.difference(qs2)

if Result is length 0 then all of 1 is in 2.

On Monday, March 18, 2019 at 8:15:19 AM UTC-4, Thomas Klopf wrote:
>
> Hello,
>   Yes exactly that, if mo1 is in qs2. BUT without running the SQL on the 
> database, if possible.
>
> Thanks!
> Tom
>
>
> On Friday, March 15, 2019 at 1:34:34 PM UTC+1, jgi...@caktusgroup.com 
> wrote:
>>
>> Tom,
>>
>> Could you clarify "fits into"?
>>
>> qs1 = Table.objects.all()
>> qs2 = Table.objects.filter(color='blue')
>>
>>
>> mo1 = qs1[0]
>>
>>
>> Are you trying to determine if mo1 is in qs2?
>>
>> Best
>>
>> On Friday, March 15, 2019 at 7:46:14 AM UTC-4, Thomas Klopf wrote:
>>>
>>> Hi all,
>>>   Please I have a question, couldn't find any answer for it..
>>>
>>>   Let's say I have 2 QuerySets:
>>>   1) Select all records from table
>>>   2) Select all records from table where color = "blue"
>>>
>>> So QuerySet #2 is more restricted than QuerySet #1
>>>
>>> So question is - if I get a model object from QuerySet #1, is it 
>>> possible to check if the model object is 'filtered'  or fits into QuerySet 
>>> #2, without actually executing the SQL for QuerySet #2 to find the record 
>>> again?
>>>
>>> I'm asking because running the SQL for QuerySet #2 is expensive, ideally 
>>> would test if the record fits into the QuerySet in purely python/django.
>>>
>>> Thanks in advance!
>>> Tom
>>>
>>>

-- 
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/c5314fff-37cf-4763-9ab8-2c055add3901%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: test if model object fits into QuerySet without executing SQL?

2019-03-15 Thread jgibson
Tom,

Could you clarify "fits into"?

qs1 = Table.objects.all()
qs2 = Table.objects.filter(color='blue')


mo1 = qs1[0]


Are you trying to determine if mo1 is in qs2?

Best

On Friday, March 15, 2019 at 7:46:14 AM UTC-4, Thomas Klopf wrote:
>
> Hi all,
>   Please I have a question, couldn't find any answer for it..
>
>   Let's say I have 2 QuerySets:
>   1) Select all records from table
>   2) Select all records from table where color = "blue"
>
> So QuerySet #2 is more restricted than QuerySet #1
>
> So question is - if I get a model object from QuerySet #1, is it possible 
> to check if the model object is 'filtered'  or fits into QuerySet #2, 
> without actually executing the SQL for QuerySet #2 to find the record again?
>
> I'm asking because running the SQL for QuerySet #2 is expensive, ideally 
> would test if the record fits into the QuerySet in purely python/django.
>
> Thanks in advance!
> Tom
>
>

-- 
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/26c692ef-6e97-4fa2-b5ef-6ebb24e408cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.