Re: Unable to install / build docx module

2020-03-05 Thread 'MH' via Django users
Thanks Kasper,

I will think about this. Yes, it is kind of intimidating. But it is also 
too early for me to give up. And given all the praise for such NAS devices 
I am really somewhat angry when I see that it seems to be a too difficult 
challenge just to get small webserver with a few python scripts running 
that includes serving a document.

Best regards
MH

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/58291f33-6b97-4833-a060-76252c60d8c2%40googlegroups.com.


Re: Unable to install / build docx module

2020-03-05 Thread Kasper Laudrup

Hi MH,

On 06/03/2020 06.41, 'MH' via Django users wrote:
I will google how I can do this cross compiling. Just recently a friend 
told me that this could not be done, because it would always have to be 
done on the same machine. I guess there is no way around that.




Your friend is wrong. If you do embedded development it is quite common 
to do your development on an x86 host and then cross compile for eg. an 
ARM target.


How to do that all depends on your build environment and the target 
host. There are projects specifically for that (eg. Yocto, buildroot) 
and build systems like CMake supports that through toolchain files.


All of that is most definitely out of scope for what you are trying to 
achieve.



How would an environment help?



The environment is basically telling your toolchain (compiler, linker 
etc.) where to find stuff like headers and libraries as well as telling 
your build system to pick up the correct cross compiler so it will 
generate code for your target system.


The "arm-unknown-linux-gnueabi-ccache-gcc" executable you mentioned 
earlier is almost certainly a custom compiled version of GCC for 
targeting the specific version of ARM on your target (your Synology 
Diskstation) and other stuff (eg. the gnuabi part) required for 
generating code that can execute on your target.


The environment (chroot, CMake toolchain file etc.) will then tell your 
build scripts to use that compiler. Most often something as simple as 
setting the CC environment variable to the path of that executable, but 
that's only a small part of what is required.


My main point is still that this is not an easy thing to do. Most often 
the vendor of the target (I guess that would be Synology in your case) 
will provide a build environment for you that you could use as a 
starting point.


Even when that is the case, in my experience there's often quite a lot 
of tweaking to be done to get it all to work for your specific requirements.


In short. I have the fullest respect and understanding if you try to do 
this. We all learn from trying out and experimenting with things we have 
no previous experience with, that's how we get the experience after all, 
but as someone who has worked professionally with embedded development I 
would probably give up on this before I even started ;-)


Anyway, I wish you the best of luck.

Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/169a4a8f-9e0c-eda3-c9be-15403b9b4c59%40stacktrace.dk.


issues deploying django project to cpanel

2020-03-05 Thread Tosin Ayoola
good morning guys,
i'm trying to deploy my project on cpanel but i'm encountering this err
msg, hoping anyone can help me out
i have the screen shot of the msg below tnks

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHLKn70KjXEbFJw%3Dy0A9RTmNitnymG5p4Y1Ja9NopYbWAPR2kw%40mail.gmail.com.


Re: Beginner needs help getting templates to work - is this the right group?

2020-03-05 Thread Jorge Gimeno
On Thu, Mar 5, 2020 at 8:01 PM Shishir Jha  wrote:

> Can you show the code that you have written until page 55?
>
>
> On Fri, 6 Mar 2020, 9:01 am Philip Means,  wrote:
>
>> Thank you for your response.  The book is Django for Beginners, by
>> William S. Vincent.  I will copy and send you the chapter I am having
>> trouble with.  My directory structure, as created by Django, doesn't seem
>> to be the same as his, so I will send you that as well.  The problem I am
>> having
>> is that after the changes to the files have been made, and I "runserver"
>> (on page 55) I get a huge error dialog that seems to say that django can't
>> find the app. I have deleted the project several times and re-entered it,
>> so I think it is unlikely that it is a typing error.
>>
>>
>> On Thu, Mar 5, 2020 at 8:27 PM Jorge Gimeno  wrote:
>>
>>>
>>> On Thu, Mar 5, 2020 at 6:04 PM Philip Means  wrote:
>>>
 I am new to web development.  Wanted to help my daughter with a simple
 website (she does pet portraits) and learn something that interests me.  I
 watched some you tube tutorials, then bought a book.  First couple simple
 projects went OK.  Then I got to templates and I have not been able to get
 the example project to work.  Been banging my head against the wall for
 about a week.  Part of the problem is my directory structure does not look
 like the authors and so I am not sure I am putting things in the right
 place. When I go searching for another explanation of how to set it up, I
 find that nobody seems to do it the same way.  Also, I find the jargon
 confusing.  At this point I just want to display a simple html page.  If
 this is in the wrong place, maybe someone can direct me to a better one.

 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/fe83a557-759d-460d-96ec-2c7fd18117bb%40googlegroups.com
 
 .

>>>
>>> Django is a framework that supports a lot of features, and that means
>>> there's a lot of moving parts.  However, similar to driving a car, you need
>>> to know a few things to get things working, rather than knowing the
>>> niceties of how everything works.
>>>
>>> To address your point about project structure, there's a lot of opinions
>>> on this (most of them are subjective). I have a structure I use and I'm
>>> comfortable with, but Django will support some variety in this.
>>>
>>> Without seeing what code you have and what happens that is not expected,
>>> we don't know where we can help.  So, to help us understand, we need to
>>> know a few things.
>>>
>>> 1.  What steps did you take to get here?
>>>
>>> 2..  What goes wrong?  If there's a traceback, copying and pasting it is
>>> invaluable.
>>>
>>> 3.  We may ask to see code.  Again, copying and pasting that will help
>>> us understand what is going on.
>>>
>>> You said that your project isn't working once you get to templates.  Is
>>> there a book or tutorial you are following?  That might help us know where
>>> to start.
>>>
>>> In addition to this list, there is a forum at forum.djangoproject.com
>>> (I follow posts in there as well).  That might be another resource for you,
>>> as sometimes the question you have has already been answered.
>>>
>>> -Jorge
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CANfN%3DK9POCHxkn8-OoU2Yoy3rj%3D%3D9%3DPVOZo0E07fOrPbqcV87w%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAM%3DzXYddr_TyXy43rhgtAAfJNJS%3D7D-EE6KngCcyYuhGQ9wXcw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails

Re: Unable to install / build docx module

2020-03-05 Thread 'MH' via Django users
Dear Kasper

I will google how I can do this cross compiling. Just recently a friend 
told me that this could not be done, because it would always have to be 
done on the same machine. I guess there is no way around that.

How would an environment help?

Best regards
MH

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55570611-0818-4116-af80-dda72cc0f082%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Reach out to me privately, I'll assist you further.

On Fri, Mar 6, 2020 at 12:32 AM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Omar
>
> Finally I figured out, which of my gunicorn versions belonged to the right
> python3 that I invoked earlier. Now it seems to start. I write seems
> because in the browser it now immediately gives me an error that it cannot
> find a certain module "docx". I will come back to that in a different post.
>
> But thanks for all so far!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/adbc08e4-4c83-405f-9042-d38ba2a5%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp1Z6bBJFp8nGQ8vWUqp%3DTcReMch-MCJoLfnwXf%2B75ZmTQ%40mail.gmail.com.


Re: Beginner needs help getting templates to work - is this the right group?

2020-03-05 Thread Shishir Jha
Can you show the code that you have written until page 55?


On Fri, 6 Mar 2020, 9:01 am Philip Means,  wrote:

> Thank you for your response.  The book is Django for Beginners, by William
> S. Vincent.  I will copy and send you the chapter I am having trouble
> with.  My directory structure, as created by Django, doesn't seem to be the
> same as his, so I will send you that as well.  The problem I am having
> is that after the changes to the files have been made, and I "runserver"
> (on page 55) I get a huge error dialog that seems to say that django can't
> find the app. I have deleted the project several times and re-entered it,
> so I think it is unlikely that it is a typing error.
>
>
> On Thu, Mar 5, 2020 at 8:27 PM Jorge Gimeno  wrote:
>
>>
>> On Thu, Mar 5, 2020 at 6:04 PM Philip Means  wrote:
>>
>>> I am new to web development.  Wanted to help my daughter with a simple
>>> website (she does pet portraits) and learn something that interests me.  I
>>> watched some you tube tutorials, then bought a book.  First couple simple
>>> projects went OK.  Then I got to templates and I have not been able to get
>>> the example project to work.  Been banging my head against the wall for
>>> about a week.  Part of the problem is my directory structure does not look
>>> like the authors and so I am not sure I am putting things in the right
>>> place. When I go searching for another explanation of how to set it up, I
>>> find that nobody seems to do it the same way.  Also, I find the jargon
>>> confusing.  At this point I just want to display a simple html page.  If
>>> this is in the wrong place, maybe someone can direct me to a better one.
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/fe83a557-759d-460d-96ec-2c7fd18117bb%40googlegroups.com
>>> 
>>> .
>>>
>>
>> Django is a framework that supports a lot of features, and that means
>> there's a lot of moving parts.  However, similar to driving a car, you need
>> to know a few things to get things working, rather than knowing the
>> niceties of how everything works.
>>
>> To address your point about project structure, there's a lot of opinions
>> on this (most of them are subjective). I have a structure I use and I'm
>> comfortable with, but Django will support some variety in this.
>>
>> Without seeing what code you have and what happens that is not expected,
>> we don't know where we can help.  So, to help us understand, we need to
>> know a few things.
>>
>> 1.  What steps did you take to get here?
>>
>> 2..  What goes wrong?  If there's a traceback, copying and pasting it is
>> invaluable.
>>
>> 3.  We may ask to see code.  Again, copying and pasting that will help us
>> understand what is going on.
>>
>> You said that your project isn't working once you get to templates.  Is
>> there a book or tutorial you are following?  That might help us know where
>> to start.
>>
>> In addition to this list, there is a forum at forum.djangoproject.com (I
>> follow posts in there as well).  That might be another resource for you, as
>> sometimes the question you have has already been answered.
>>
>> -Jorge
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CANfN%3DK9POCHxkn8-OoU2Yoy3rj%3D%3D9%3DPVOZo0E07fOrPbqcV87w%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAM%3DzXYddr_TyXy43rhgtAAfJNJS%3D7D-EE6KngCcyYuhGQ9wXcw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-us

Re: Beginner needs help getting templates to work - is this the right group?

2020-03-05 Thread Shishir Jha
Can you show the code that you have written upto page 55?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82205517-3178-41a8-bf51-1e5c16491099%40googlegroups.com.


Re: Beginner needs help getting templates to work - is this the right group?

2020-03-05 Thread Jorge Gimeno
On Thu, Mar 5, 2020 at 6:04 PM Philip Means  wrote:

> I am new to web development.  Wanted to help my daughter with a simple
> website (she does pet portraits) and learn something that interests me.  I
> watched some you tube tutorials, then bought a book.  First couple simple
> projects went OK.  Then I got to templates and I have not been able to get
> the example project to work.  Been banging my head against the wall for
> about a week.  Part of the problem is my directory structure does not look
> like the authors and so I am not sure I am putting things in the right
> place. When I go searching for another explanation of how to set it up, I
> find that nobody seems to do it the same way.  Also, I find the jargon
> confusing.  At this point I just want to display a simple html page.  If
> this is in the wrong place, maybe someone can direct me to a better one.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fe83a557-759d-460d-96ec-2c7fd18117bb%40googlegroups.com
> 
> .
>

Django is a framework that supports a lot of features, and that means
there's a lot of moving parts.  However, similar to driving a car, you need
to know a few things to get things working, rather than knowing the
niceties of how everything works.

To address your point about project structure, there's a lot of opinions on
this (most of them are subjective). I have a structure I use and I'm
comfortable with, but Django will support some variety in this.

Without seeing what code you have and what happens that is not expected, we
don't know where we can help.  So, to help us understand, we need to know a
few things.

1.  What steps did you take to get here?

2..  What goes wrong?  If there's a traceback, copying and pasting it is
invaluable.

3.  We may ask to see code.  Again, copying and pasting that will help us
understand what is going on.

You said that your project isn't working once you get to templates.  Is
there a book or tutorial you are following?  That might help us know where
to start.

In addition to this list, there is a forum at forum.djangoproject.com (I
follow posts in there as well).  That might be another resource for you, as
sometimes the question you have has already been answered.

-Jorge

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANfN%3DK9POCHxkn8-OoU2Yoy3rj%3D%3D9%3DPVOZo0E07fOrPbqcV87w%40mail.gmail.com.


Beginner needs help getting templates to work - is this the right group?

2020-03-05 Thread Philip Means
I am new to web development.  Wanted to help my daughter with a simple 
website (she does pet portraits) and learn something that interests me.  I 
watched some you tube tutorials, then bought a book.  First couple simple 
projects went OK.  Then I got to templates and I have not been able to get 
the example project to work.  Been banging my head against the wall for 
about a week.  Part of the problem is my directory structure does not look 
like the authors and so I am not sure I am putting things in the right 
place. When I go searching for another explanation of how to set it up, I 
find that nobody seems to do it the same way.  Also, I find the jargon 
confusing.  At this point I just want to display a simple html page.  If 
this is in the wrong place, maybe someone can direct me to a better one.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe83a557-759d-460d-96ec-2c7fd18117bb%40googlegroups.com.


Re: Unable to install / build docx module

2020-03-05 Thread Kasper Laudrup

Hi MH,

On 05/03/2020 23.48, 'MH' via Django users wrote:
So, even as someone who has not so much experience in these things I 
would say that I lack three things: libxml2, libxslt, and 
usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc



About the first two: I cannot do an apt-get. I am working on a synology 
diskstation.




You need a C compiler (eg. GCC as you suggested yourself). I have zero 
experience with a Synology Diskstation, but a quick search seems like 
it's far from trivial to get that to work.


You're most likely better of setting up an environment for cross 
compiling on some other host and then target whatever the Synology 
Diskstation is running.


While it's definitely possible, it's not an easy task if you have to 
setup everything from scratch (which it seems like you have to).


Not much help I know, but just thought you should know that what you are 
trying to achieve seems like it would require a lot of work.


Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/11ea53aa-fdf5-0ddd-abe1-3b9f5c1c9238%40stacktrace.dk.


Re: Documentation misspelling - Django 3 - maybe

2020-03-05 Thread Andréas Kühne
If you check the code for the PasswordChangeView, the default template is
'registration/password_change_form.html'. So you are incorrect.

Regards,

Andréas


Den ons 4 mars 2020 kl 18:19 skrev Norbert Rácz :

> Here:
> https://docs.djangoproject.com/en/3.0/topics/auth/default/#django.contrib.auth.views.PasswordChangeView
>
> This line: template_name: The full name of a template to use for
> displaying the password change form. Defaults to
> registration/password_change_form.html if not supplied.
>
> The "password_change_form.html" not workinkng for me, but
> "password_change.html" is ok, when I want to made a costum template. I
> think it was working at Django 2 with "_form". What you think? I'm right?
> And where can I report that?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fc1f10af-efd6-487c-9777-4cd486b5186a%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCfOdNDyJCbgZUGNBDVLKLj4Kq%3Dq%2BJtaQQaXE-v4Q7a8ZQ%40mail.gmail.com.


Re: Unable to install / build docx module

2020-03-05 Thread 'MH' via Django users
 

So, even as someone who has not so much experience in these things I would 
say that I lack three things: libxml2, libxslt, and 
usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc


About the first two: I cannot do an apt-get. I am working on a synology 
diskstation.


What should I do?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a9885c86-77d8-45d8-ad45-e2e3e4e30af0%40googlegroups.com.


Re: Unable to install / build docx module

2020-03-05 Thread 'MH' via Django users
I can also not install lxml via pip3. Here is a short part of the output:

 cc -I/usr/include/libxml2 -c /opt/tmp/xmlXPathInit80x1qqz_.c -o opt/tmp/
xmlXPathInit80x1qqz_.o
unable to execute 'cc': No such file or directory

*
Could not find function xmlCheckVersion in library libxml2. Is libxml2 
installed?



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f5fc3643-1b83-4b76-b311-d2ee2ffac113%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

Finally I figured out, which of my gunicorn versions belonged to the right 
python3 that I invoked earlier. Now it seems to start. I write seems 
because in the browser it now immediately gives me an error that it cannot 
find a certain module "docx". I will come back to that in a different post.

But thanks for all so far!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/adbc08e4-4c83-405f-9042-d38ba2a5%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread V. J
Zdravím vás, myslíme že přístup byl udělen jen pár lidem kteří odvádí dobrou práci, jelikož by bylo dost nebezpečné udělit přístup všem, tak pokud vas mohu poprosit obraťte se s žádostí na ně. A pokud uznaji za vhodné že je to potřeba, provedou opravu, nebo doplnění. Pokud se mýlím, tak mě kontaktujte a prenastavim pravidla přístupu. Přeji hezký den s pozdravem Vasek JachimOdesláno z mého telefonu Huawei Původní zpráva Předmět: Re: Stuck with Django on a Synology DiskstationOdesílatel: 'MH' via Django users Komu: Django users Kopie: Is there anything particular hat I have to write into that wsgi.py file?



-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com.




-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/-kdq1xj-ohu8uudyni2w-qp6yfm-r1fto6-uhymk84wh307-guno8r-c497jr9gy14j-8vrumlx66jke-aw50mvkek1qxdc72ifubmccbwl6u8u-idee96zjjyzg7gdypxqtaqh-jvqrulz2p1np-1icriq.1583442428804%40email.android.com.


Need help understanding how to use ForceRHR/ForcePolygonCW

2020-03-05 Thread Julianne Bielski
I have a model with a field called 'geom' that is a MultiPolygonField. When 
I query for instances of the model, I'd like the data in this field to 
follow the right hand rule. Because I am using PostGIS on the back end, I 
have support for ForceRHR (I am using Django 2.06), but I can't figure out 
how to use it.

In views.py, I get a URL request with name value pairs, and I convert that 
dictionary into a dictionary suitable for use in a filter:

def field_datasets(request):
client_name = 'MSFF'
grower = Growers.objects.filter(name__exact=client_name).get()

fields = serialize('geojson', 
Fields.objects.filter(grower__exact=grower.id).filter(
Q(*[(k,v)for k,vs in request.GET.lists() for v in vs], _connector=Q.OR)
))

return HttpResponse(fields, content_type='json'

I've tried this:
...
test = Fields.objects.filter(grower__exact=grower.id).filter(
Q(*[(k,v)for k,vs in request.GET.lists() for v in vs], _connector=Q.OR)
)

test.update(geom = ForceRHR('geom'))
fields = serialize('geojson', test)
...

and I've tried this:
...
test = Fields.objects.filter(grower__exact=grower.id).filter(
Q(*[(k,v)for k,vs in request.GET.lists() for v in vs], _connector=Q.OR)
)

for item in test:
rhr_geom = ForceRHR(item.geom)
test[item].geom = rhr_geom

fields = serialize('geojson', test)
...

The documentation says: 
Accepts a single geographic field or expression and returns a modified 
version of the polygon/multipolygon in which all exterior rings are 
oriented clockwise and all interior rings are oriented counterclockwise. 
Non-polygonal geometries are returned unchanged.

So how else do you pass a geographic field?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38ae5491-9774-445c-a7bf-83d71d10c79c%40googlegroups.com.


Re: Running into a "Cannot assign... must be a ...instance" error

2020-03-05 Thread Sachin Ranadive
Or ignore the form username field;

author=request.user

Sachin Ranadive

On Thu, Mar 5, 2020, 8:17 PM Sachin Ranadive 
wrote:

> Change view code, assign User object instead.
>
> author = User.objects.get(username=request.POST["username"])
>
> Sachin
>
> On Thu, Mar 5, 2020, 4:00 AM Joey Jo Jo Jr  wrote:
>
>> New to Django.
>>
>> I'm trying to set up a simple comment form where I can add a title for
>> the comment, content of the comment, and attach the username of the user
>> that is currently signed in and posting it.
>>
>> I run into the following error when running it:
>>
>> Cannot assign "'john'": "Entry.author" must be a "User" instance.
>>
>>
>>  I think I understand what's happening here, however I'm having a hard time 
>> figuring out how to implement it properly.
>>
>>
>> *Here's my model code:*
>>
>>
>> class Entry(models.Model):
>>
>> title = models.CharField(max_length=60)
>>
>> content = models.TextField(max_length=500)
>>
>> author = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
>>
>>
>>
>> def __str__(self):
>>
>> return f"{self.id}"
>>
>>
>> *Here's my view code:*
>>
>>
>> @login_required
>>
>> def add(request):
>>
>> if request.method == "POST":
>>
>> entry = Entry(
>>
>> title = request.POST["title"],
>>
>> content = request.POST["content"],
>>
>> author = request.POST["username"]
>>
>> )
>>
>>
>> entry.save()
>>
>>
>> return render(request, "articles/index.html", {
>>
>> "entries": Entry.objects.all()
>>
>> })
>>
>>
>> else:
>>
>> return render(request, "articles/add.html", {
>>
>> "username": request.user
>>
>> })
>>
>>
>> *And here's my form code in my template:*
>>
>>
>> {% block body %}
>>
>> New Entry
>>
>> 
>>
>> {% csrf_token %}
>>
>> 
>>
>>
>> Title:
>>
>> 
>>
>> 
>>
>>
>>
>> Content:
>>
>> 
>>
>> Content goes here
>>
>> 
>>
>> 
>>
>>
>> 
>>
>> 
>>
>> {% endblock %}
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e0bb05c3-ecee-4f75-97ca-a659cb7e6181%40googlegroups.com
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADjLj1ospeEke8hLFiDz6rbuXaHogrN2Fp_eRvE1myVB_0y03Q%40mail.gmail.com.


django unittest with option --keepdb

2020-03-05 Thread 麻吉柯省


I'm trying to use Django to create unit test cases.(I use PyMySQL==0.9.3) 
When I run

python manage.py test -k

Then I got an exception:

Got an error creating the test database: (1064, "You have an error in your SQL 
syntax; check the manual that corresponds to your MySQL server version for the 
right syntax to use near 'CREATE DATABASE IF NOT EXISTS `test_t` ;\n
SET sql_no' at line 2")

I found Django use this code to avoid "database exists" warning: 
(django/backends/mysql/creation.py)

if keepdb:
# If the database should be kept, add "IF NOT EXISTS" to avoid
# "database exists" error, also temporarily disable "database
# exists" warning.
cursor.execute('''
SET @_tmp_sql_notes := @@sql_notes, sql_notes = 0;
CREATE DATABASE IF NOT EXISTS %(dbname)s %(suffix)s;
SET sql_notes = @_tmp_sql_notes;
''' % parameters)

PyMySQL doesn't support those SQL,but when I use mysqlclient, it works 
well.What should I do?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/400012ad-d0ae-4da9-a787-094e8530075d%40googlegroups.com.


Re: Running into a "Cannot assign... must be a ...instance" error

2020-03-05 Thread Sachin Ranadive
Change view code, assign User object instead.

author = User.objects.get(username=request.POST["username"])

Sachin

On Thu, Mar 5, 2020, 4:00 AM Joey Jo Jo Jr  wrote:

> New to Django.
>
> I'm trying to set up a simple comment form where I can add a title for the
> comment, content of the comment, and attach the username of the user that
> is currently signed in and posting it.
>
> I run into the following error when running it:
>
> Cannot assign "'john'": "Entry.author" must be a "User" instance.
>
>
>  I think I understand what's happening here, however I'm having a hard time 
> figuring out how to implement it properly.
>
>
> *Here's my model code:*
>
>
> class Entry(models.Model):
>
> title = models.CharField(max_length=60)
>
> content = models.TextField(max_length=500)
>
> author = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
>
>
>
> def __str__(self):
>
> return f"{self.id}"
>
>
> *Here's my view code:*
>
>
> @login_required
>
> def add(request):
>
> if request.method == "POST":
>
> entry = Entry(
>
> title = request.POST["title"],
>
> content = request.POST["content"],
>
> author = request.POST["username"]
>
> )
>
>
> entry.save()
>
>
> return render(request, "articles/index.html", {
>
> "entries": Entry.objects.all()
>
> })
>
>
> else:
>
> return render(request, "articles/add.html", {
>
> "username": request.user
>
> })
>
>
> *And here's my form code in my template:*
>
>
> {% block body %}
>
> New Entry
>
> 
>
> {% csrf_token %}
>
> 
>
>
> Title:
>
> 
>
> 
>
>
>
> Content:
>
> 
>
> Content goes here
>
> 
>
> 
>
>
> 
>
> 
>
> {% endblock %}
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e0bb05c3-ecee-4f75-97ca-a659cb7e6181%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADjLj1pSq9v7Ar-3vx2WnmO8v2iwC7gdHCcfZzosnjpkaqNGWA%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
If I am not totally mistaken it could be that gunicorn wants to work with 
python2.7 while I did everything with python3. But how could I direct 
gunicorn to take python3?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f355d8d1-fe22-4adb-9915-8f16f52f5c8b%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Make sure you're in the root of the project and run:

gunicorn -w 4 project.wsgi:application

you dont need to change anything.

On Thu, Mar 5, 2020, 10:51 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Is there anything particular hat I have to write into that wsgi.py file?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp3H3izqTPSrKXcUWsf2vk_ZSBTOjBeSuFJ66dirDu-crA%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Is there anything particular hat I have to write into that wsgi.py file?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

but would that help me right now? Besides the problem of finding the right 
pip, I mean? As you can see, even now my gunicorn won't work :(



On Thursday, March 5, 2020 at 4:04:46 PM UTC+1, Omar Abou Mrad wrote:
>
> As of Python 3.3 virtual environments are builtin, it would be wise to get 
> used to them.
>
> https://docs.python.org/3/library/venv.html
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6c3a2e5f-a496-47e4-b216-94d8e651e029%40googlegroups.com.


help on how to pass a many to many field to form template

2020-03-05 Thread Tosin Ayoola
good day,
I have to models, using a many to many relationship, I want to access the
fields in they model in my form template, how do i achieve this?
i attached my view, model and template code screenshot, hopping anyone can
help

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHLKn73RQSEYi%3D2C_9VpQ9YoKq11PXYHaHGoMuh5OJDk1nOXDg%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
 gunicorn -w 4 wsgi:application
[2020-03-05 15:55:51 +] [4472] [INFO] Starting gunicorn 19.9.0
[2020-03-05 15:55:51 +] [4472] [INFO] Listening at: http://127.0.0.1:8000 
(4472)
[2020-03-05 15:55:51 +] [4472] [INFO] Using worker: sync
[2020-03-05 15:55:51 +] [4483] [INFO] Booting worker with pid: 4483
[2020-03-05 15:55:51 +] [4483] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4483] [INFO] Worker exiting (pid: 4483)
[2020-03-05 15:55:51 +] [4484] [INFO] Booting worker with pid: 4484
[2020-03-05 15:55:51 +] [4484] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4484] [INFO] Worker exiting (pid: 4484)
[2020-03-05 15:55:51 +] [4486] [INFO] Booting worker with pid: 4486
[2020-03-05 15:55:51 +] [4486] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4486] [INFO] Worker exiting (pid: 4486)
[2020-03-05 15:55:51 +] [4487] [INFO] Booting worker with pid: 4487
[2020-03-05 15:55:51 +] [4487] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4487] [INFO] Worker exiting (pid: 4487)
[2020-03-05 15:55:51 +] [4472] [INFO] Shutting down: Master
[2020-03-05 15:55:51 +] [4472] [INFO] Reason: Worker failed to boot.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/32ff3661-129e-49df-8061-3ad51493951e%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
As of Python 3.3 virtual environments are builtin, it would be wise to get
used to them.

https://docs.python.org/3/library/venv.html

On Thu, Mar 5, 2020 at 4:57 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> /volume1/@appstore/py3k/usr/local/bin$ ./pip install gunicorn
> Defaulting to user installation because normal site-packages is not
> writeable
> Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib
> /python3.5/site-packages (20.0.4)
> Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
> usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)
>
> The output for this folder is identical for pip3 and pip 3.5.
>
> /usr/bin$ ./pip install gunicorn
> /usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning:
> 'point_conversion_form_t' has no values explicitly defined; next version
> will refuse to guess which integer type it is meant to be (unsigned/signed
> , int/long)
>   % self._get_c_name())
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. A
> future version of pip will drop support for Python 2.7. More details
> about Python 2 support in pip, can be found at https://
> pip.pypa.io/en/latest/development/release-process/#python-2-support
> Defaulting to user installation because normal site-packages is not
> writeable
> Collecting gunicorn
>   Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
>  || 113 kB 1.4 MB/s
> Installing collected packages: gunicorn
> ERROR: Could not install packages due to an EnvironmentError: [Errno 13]
> Permission denied:
> '/usr/local/lib/python2.7/site-packages/gunicorn-19.10.0.dist-info'
> Check the permissions.
>
> and as root:
> /usr/bin# ./pip install gunicorn
> /usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning:
> 'point_conversion_form_t' has no values explicitly defined; next version
> will refuse to guess which integer type it is meant to be (unsigned/signed
> , int/long)
>   % self._get_c_name())
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. A
> future version of pip will drop support for Python 2.7. More details
> about Python 2 support in pip, can be found at https://
> pip.pypa.io/en/latest/development/release-process/#python-2-support
> Collecting gunicorn
>   Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
>  || 113 kB 1.4 MB/s
> Installing collected packages: gunicorn
> Successfully installed gunicorn-19.10.0
>
> I will now try it again.
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/30b9b540-6224-4906-98f1-f0a3ff0ebb01%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp352iNvORHWxm1WJPdpL6dtJqkmS4aACbGtRJpUqByi8g%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
/volume1/@appstore/py3k/usr/local/bin$ ./pip install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.5/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)

The output for this folder is identical for pip3 and pip 3.5.

/usr/bin$ ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 
'point_conversion_form_t' has no values explicitly defined; next version 
will refuse to guess which integer type it is meant to be (unsigned/signed, 
int/long)
  % self._get_c_name())
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. A future 
version of pip will drop support for Python 2.7. More details about Python 2 
support in pip, can be found at https:
//pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not 
writeable
Collecting gunicorn
  Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
 || 113 kB 1.4 MB/s 
Installing collected packages: gunicorn
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] 
Permission denied: 
'/usr/local/lib/python2.7/site-packages/gunicorn-19.10.0.dist-info'
Check the permissions.

and as root:
/usr/bin# ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 
'point_conversion_form_t' has no values explicitly defined; next version 
will refuse to guess which integer type it is meant to be (unsigned/signed, 
int/long)
  % self._get_c_name())
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. A future 
version of pip will drop support for Python 2.7. More details about Python 2 
support in pip, can be found at https:
//pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting gunicorn
  Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
 || 113 kB 1.4 MB/s 
Installing collected packages: gunicorn
Successfully installed gunicorn-19.10.0

I will now try it again.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/30b9b540-6224-4906-98f1-f0a3ff0ebb01%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users

To be quite honest, this is really challenging for me, because the synology 
OS drove me nuts. I am under the impression that I have multiple 
installations of python and pip running now.

In order to get an overview, I will now try to find every pip on my system 
and to install gunicorn everywhere. (I would wish I just had one central 
apt-get command here)...

~/.local/bin$ ./pip3 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

~/.local/bin$ ./pip3.5 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Collecting gunicorn
  Using cached gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)
Installing collected packages: gunicorn
  WARNING: The script gunicorn is installed in 
'/var/services/homes/admin/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this 
warning, use --no-warn-script-location.
Successfully installed gunicorn-20.0.4

and

./pip3.8 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

./pip install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

These were all from the same directory. Next post with more infos from 
other folders.




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d9a4564c-08f7-48d8-ae5b-822656dc32b4%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
gunicorn is yielding the same error as the standard python command I gave
you,
whereas you use python3 to fire up the django development server. I'll
venture
a guess and say the problem is due to the environment.

Are you using any virtual environment or installing system wide?
How did you install django?
How did you install gunicorn?
Did you use pip?
Do you have a pip3?
Does "pip --version" and "pip3 --version" yield different results?

If you answered yes to the last 3 questions, try removing gunicorn using pip
and installing it using pip3.

On Thu, Mar 5, 2020 at 3:59 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Omar
>
> python -c "import django.core.wsgi" && echo "Yup, works!"
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named django.core.wsgi
>
>
> but
> python3 manage.py runserver 0:8000
> Watching for file changes with StatReloader
> Performing system checks...
>
> System check identified no issues (0 silenced).
> March 05, 2020 - 14:42:06
> Django version 3.0.3, using settings 'project.settings'
> Starting development server at http://0:8000/
> Quit the server with CONTROL-C.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/645cfdfa-1861-4ac8-97bf-c3be4c273196%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp29duqw%2BzCRZR9Ts-kEtTfF-_jgJNqv_42h%2BDZaTOG6Pg%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

python -c "import django.core.wsgi" && echo "Yup, works!"
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named django.core.wsgi


but
python3 manage.py runserver 0:8000
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 05, 2020 - 14:42:06
Django version 3.0.3, using settings 'project.settings'
Starting development server at http://0:8000/
Quit the server with CONTROL-C.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/645cfdfa-1861-4ac8-97bf-c3be4c273196%40googlegroups.com.


Custom User

2020-03-05 Thread Kushal Neupane
I am trying to build a resturant management system. I made a super user. 
Now, i am trying to make cashier and finance users which must be assign by 
the super admin. Can i do it?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59fed919-bf3b-40aa-8cd8-00f6cf7335a9%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Is django installed properly?
Are you still able to use runserver?
What happens when you run the following?

python -c "import django.core.wsgi" && echo "Yup, works!"

also, looking further into your error log, make sure you're in the proper
directory.
(i may have given you the wrong one earlier, run the below and see if it
works)

cd /var/services/homes/admin/DjangoProject/project/
gunicorn -w 4 project.wsgi:application

On Thu, Mar 5, 2020 at 2:34 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Somehow I cannot write everything into one post that I wanted to reply.
> Here comes the rest of my original post.
>
>
> gunicorn -w 4 wsgi:application
> [... continued ...]
> Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>  Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52
> , in load
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41
> , in load_wsgiapp
>   File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in
> import_app
>   File
> "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py",
> line 12, in 
> from django.core.wsgi import get_wsgi_application
> ImportError: No module named django.core.wsgi
> [2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
> [2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
> Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52
> , in load
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41
> , in load_wsgiapp
>   File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in
> import_app
>   File
> "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py",
> line 12, in 
> from django.core.wsgi import get_wsgi_application
> ImportError: No module named django.core.wsgi
> [2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
> [2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
> [2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.
>
> The wsgi filee only consists of:
>
> import os
>
> from django.core.wsgi import get_wsgi_application
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
>
> application = get_wsgi_application()
>
>
> What should I do differently?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6ab1255-5fc0-4800-b618-555b34848422%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp29ynfVBdOx%2BptFHrZercMLTPy4Y7o85Oae_3sCEA4VOw%40mail.gmail.com.


Re: Cumulative Sum per month

2020-03-05 Thread krnrrr
what do you mean by "cumulative"? if we have aggregate sums like

jan = 100
feb = 150
mar = 120

you want to have output as

jan = 100
feb = 250
mar = 370

?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eecdf740-b22f-4260-887b-2def2074461a%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Somehow I cannot write everything into one post that I wanted to reply. 
Here comes the rest of my original post.


gunicorn -w 4 wsgi:application
[... continued ...]
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
 Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6ab1255-5fc0-4800-b618-555b34848422%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Thanks Omar,

but do I have to write something into that wsgi file?

gunicorn -w 4 wsgi:application
[2020-03-05 12:55:09 +] [29297] [INFO] Starting gunicorn 19.9.0
[2020-03-05 12:55:09 +] [29297] [INFO] Listening at: http://127.0.0.1:8000 
(29297)
[2020-03-05 12:55:09 +] [29297] [INFO] Using worker: sync
[2020-03-05 12:55:09 +] [29307] [INFO] Booting worker with pid: 29307
[2020-03-05 12:55:09 +] [29307] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29307] [INFO] Worker exiting (pid: 29307)
[2020-03-05 12:55:09 +] [29308] [INFO] Booting worker with pid: 29308
[2020-03-05 12:55:09 +] [29308] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Booting worker with pid: 29309
[2020-03-05 12:55:09 +] [29308] [INFO] Worker exiting (pid: 29308)
[2020-03-05 12:55:09 +] [29310] [INFO] Booting worker with pid: 29310
[2020-03-05 12:55:09 +] [29309] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
You received this message because you ar

Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Thanks Omar,

but do I have to write something into that wsgi file?

gunicorn -w 4 wsgi:application
[2020-03-05 12:55:09 +] [29297] [INFO] Starting gunicorn 19.9.0
[2020-03-05 12:55:09 +] [29297] [INFO] Listening at: http://127.0.0.1:8000 
(29297)
[2020-03-05 12:55:09 +] [29297] [INFO] Using worker: sync
[2020-03-05 12:55:09 +] [29307] [INFO] Booting worker with pid: 29307
[2020-03-05 12:55:09 +] [29307] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29307] [INFO] Worker exiting (pid: 29307)
[2020-03-05 12:55:09 +] [29308] [INFO] Booting worker with pid: 29308
[2020-03-05 12:55:09 +] [29308] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Booting worker with pid: 29309
[2020-03-05 12:55:09 +] [29308] [INFO] Worker exiting (pid: 29308)
[2020-03-05 12:55:09 +] [29310] [INFO] Booting worker with pid: 29310
[2020-03-05 12:55:09 +] [29309] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
You received this message because you ar

Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Change your working directory to "project" (the directory containing
wsgi.py) and use:

 gunicorn -w 4 wsgi:application

It should work.

On Thu, Mar 5, 2020 at 10:14 AM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Could anyone tell me how to start correctly the unicorn (integration)?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e4404c7e-e6d1-460d-9c22-e4571f1b7528%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp0UjVBWMSiW8v-CBn1ZQfwAwg23Fdwr8TEutXQNvZh3xw%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Could anyone tell me how to start correctly the unicorn (integration)?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4404c7e-e6d1-460d-9c22-e4571f1b7528%40googlegroups.com.