Connection pooling to MariaDB SQL database

2020-03-02 Thread Simen Russnes
Good morning list

What are the best strategies for implementing connection pooling for
connections to a MariaDB SQL database? Are there built in capabilities
in Django at the moment, or do I have to install something like
https://pypi.org/project/django-db-connection-pool/ ?

Simen

-- 
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/6e0e95ce-dbf0-ee07-3f50-3c3c2dcc604b%40bio-me.com.


Error while adding entries through django admin

2020-03-02 Thread Santhosh sridhar
Hi,
I have registered a model in my django admin page. When I click the Add 
link, it throws me this error, Invalid block tag: 
'change_list_object_tools', expected 'endblock'

*django.template.base.TemplateSyntaxError: . I could not get any solution. 
Appreciating someone's help.*


*Regards,*

*Santhosh*

-- 
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/82a9e589-680e-4abc-a7f5-844f2bc88b97%40googlegroups.com.


DjangoProject related queries: what is name(means unknown random number) after HTTP status code.

2020-03-02 Thread Lahu Chavan


when we run command on teminal python manage.py runserver after will get 
local server IP address click on immediately, one hand will open a 
webbrowser page of django project and another hand on terminal continue 
processing in format  [Date]  "HTTP method"  HTTP status code | unknown 
random number.

 

*my question is what is name(means *unknown random number)*  after HTTP 
status code.*

 

*Please share answer as soon as possible* 

 

System check identified no issues (0 silenced).
February 28, 2020 - 06:31:46
Django version 3.0.3, using settings 'pydjblog.settings'
Starting development server at http://127.0.0.1:8000/  
Quit the server with CTRL-BREAK.
[28/Feb/2020 06:31:52] "GET / HTTP/1.1" 200 3295
[28/Feb/2020 06:31:52] "GET /static/css/custom.css HTTP/1.1" 304 0
[28/Feb/2020 06:31:52] "GET /static/popper.min.js HTTP/1.1" 404 1665
[28/Feb/2020 06:31:52] "GET /static/bootstrap.min.js HTTP/1.1" 404 1674


thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bbdc4dec-e77d-46ba-ad5a-1c500e1539f4%40googlegroups.com.


can you make program from this algorithm

2020-03-02 Thread sagar ninave
-- 
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/ce08b818-69fa-4954-b645-36058c6212d1%40googlegroups.com.


Re: Python Django Training

2020-03-02 Thread shimaa
hello
I'm interested too. You can add me up on WhatsApp +02001016334768

بتاريخ السبت، 1 فبراير، 2020 3:42:52 م UTC+2، كتب Srikanth K:
>
> Hi,
>
> I am from Hyderabad. I am Python Developer by Profession. I am eager take 
> up any Python , Django Training (online Preferrable or Weekends). Members 
> who require can contact me or share me  there idea.
>
> Regards,
> Srikanth.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6341b180-e316-4f35-83d0-42d7dff3c75e%40googlegroups.com.


Re: new to django

2020-03-02 Thread Lokendra Chouhan
Django life cycle link -
https://www.reddit.com/r/webexpert/comments/dgp283/django_request_response_cycle/

On Mon, Mar 2, 2020 at 12:41 PM Aditya Khatwa 
wrote:

> Congratulations 1st step completed a 100 more to go.😅
>
> On Sun, 1 Mar 2020, 23:55 Omkar Parab,  wrote:
>
>> Here's the Perfect Django tutorial.
>> From development to production.
>> 
>> https://www.youtube.com/playlist?list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
>>
>> On Sun, Mar 1, 2020, 11:33 PM Gurjot Kawatra 
>> wrote:
>>
>>> hello everyone ...if anybody could help me out
>>> my django server is started and i'm able to see congratulation messege...
>>> now plz tell me the next step to create a project and run and watching
>>> output at the localhost:8000
>>>
>>> --
>>> 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/f336394b-8fff-4893-ac04-ee5049357d85%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/CAJY8mfz_etvYx68asZwps0Fqb67_arNW6ByC%3DzpFg62OEo8rgw%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/CAOnqjLwzM9iokN0VAmzxLv_yYhbpSN59BGrYaNc7NpQByu%2B%3DSA%40mail.gmail.com
> 
> .
>


-- 
Thanks & Regards,
*Lokendra Singh Chouhan*,
*Software Developer  | VulpineCode Technologies*,
http://www.vulpinecode.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/CAM55b4uQD7Y66f%3DkH33y-4HwFCZn6Zi75Y6sCO1LHy%3DFxbcR2w%40mail.gmail.com.


Re: Python Django Training

2020-03-02 Thread Lokendra Chouhan
Django life cycle link -
https://www.reddit.com/r/webexpert/comments/dgp283/django_request_response_cycle/

On Mon, Mar 2, 2020 at 12:16 PM amanda  wrote:

> I am interesting learn
>
> 在 2020年2月1日星期六 UTC+1下午2:42:52,Srikanth K写道:
>>
>> Hi,
>>
>> I am from Hyderabad. I am Python Developer by Profession. I am eager take
>> up any Python , Django Training (online Preferrable or Weekends). Members
>> who require can contact me or share me  there idea.
>>
>> Regards,
>> Srikanth.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/86f4f061-5500-45e1-aa16-e87090af41c9%40googlegroups.com
> 
> .
>


-- 
Thanks & Regards,
*Lokendra Singh Chouhan*,
*Software Developer  | VulpineCode Technologies*,
http://www.vulpinecode.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/CAM55b4s1TkxLN28s6oVJ1GBrFHvmFSKcFhhaGbTcVy2hO-qpDA%40mail.gmail.com.


Re: Python Django Training

2020-03-02 Thread MS V
Please add me too

On Mon, Mar 2, 2020 at 12:17 PM amanda  wrote:

> I am interesting learn
>
> 在 2020年2月1日星期六 UTC+1下午2:42:52,Srikanth K写道:
>>
>> Hi,
>>
>> I am from Hyderabad. I am Python Developer by Profession. I am eager take
>> up any Python , Django Training (online Preferrable or Weekends). Members
>> who require can contact me or share me  there idea.
>>
>> Regards,
>> Srikanth.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/86f4f061-5500-45e1-aa16-e87090af41c9%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/CA%2BDHP4ei4N4HwMz22NPCkHgcC2bdKLcbnciYQfqMpDf33pDPag%40mail.gmail.com.


How to create multipage forms with different models

2020-03-02 Thread victor awakan
I am a building a small project in Django. I am able to create two or more 
forms in a template but now, I want to split the form to separate templates 
with each form belong to different models. How can I achieve this? Here is 
a link to dpaste with the multiple forms in a template I created: 
http://dpaste.com/1WX0RC8

All help and suggestions will be appreciated.

PS. I have tried it with formtools and it worked. I am trying to learn how 
to do the same thing with function based views. Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/196be2b8-36e0-4565-b010-51595912c2cc%40googlegroups.com.


Re: new to django

2020-03-02 Thread victor awakan
You can first try the django official tutorial. This will give you a rough 
idea how things works. https://docs.djangoproject.com/en/3.0/

On Sunday, March 1, 2020 at 8:04:45 PM UTC+2, Gurjot Kawatra wrote:
>
> hello everyone ...if anybody could help me out
> my django server is started and i'm able to see congratulation messege...
> now plz tell me the next step to create a project and run and watching 
> output at the localhost:8000
>

-- 
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/c2432f2a-87d9-4065-b30c-406bf55eb2b9%40googlegroups.com.


mysqlclient for django

2020-03-02 Thread hajar Benjat
hello everyone ! hope you are fine !

I want to connect my database with django to do some reports on this data ( 
that's like business intelligence )

I have problems to install mysqlclient in my windows , can you advice me 
guys which command I should try ?

also I want to ask if someone have already experienced doing reports on 
database like that. 

thanks in advance for sharing the information!
 

-- 
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/9d4c6d50-1055-424f-8ec4-9bb76afd83f5%40googlegroups.com.


Re: can you make program from this algorithm

2020-03-02 Thread Kasper Laudrup

Hi Sagar,

I'm sure there are plenty places where you can pay people to do your 
homework for you.


The Django users mailing list is not one of them.

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/ebbb4e1b-a97d-657f-8834-618f3886c3e0%40stacktrace.dk.


Re: can you make program from this algorithm

2020-03-02 Thread sagar ninave
i just want help to know how i implement this algorithm only if anyone can
do this then they can guide me. i don't want to pay anyone

On Mon, Mar 2, 2020 at 4:41 AM Kasper Laudrup  wrote:

> Hi Sagar,
>
> I'm sure there are plenty places where you can pay people to do your
> homework for you.
>
> The Django users mailing list is not one of them.
>
> 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/ebbb4e1b-a97d-657f-8834-618f3886c3e0%40stacktrace.dk
> .
>


-- 

sagar ninave
about.me/sagarninave


-- 
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/CAA6pdZ-s8%2B4_3pG2H7-0pQp0TRB-mHLhVfhG96duNvHo%2BhMmjg%40mail.gmail.com.


AttributeError: 'NoneType' object has no attribute 'app_name'

2020-03-02 Thread Sencer Hamarat
Hello, 

The project I'm working on has it's custom template context_processor.
And when unavailable URL request arrives to Django (Eg. "/wp-login.php"), 
the context_processor is throwing AttributeError.

Which way should I use to prevent from context processor from throwing 
errors?
Is it ok to wrapping return with try block and returning empty dictionary 
if AttributeError raised?

def resolver_context_processor(request):
return {
'app_name': request.resolver_match.app_name,
'namespace': request.resolver_match.namespace,
'url_name': request.resolver_match.url_name
}



-- 
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/556e8f34-ecd4-45b8-bd39-21504459efc3%40googlegroups.com.


mysqlclient for django

2020-03-02 Thread shedd tutt
Use pip install mysqlclient

-- 
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/ced13221-c921-476f-9784-68de6630b516%40googlegroups.com.


Python and Django Internship

2020-03-02 Thread kamta singh


Hello Django Developers

We would like to provide you with opportunities to work in a live project 
on Django. This is an internship which requires you to collaborate 
effectively with other members of the team based in India.

Requirements:
Good Knowledge of Django
Good Knowledge of Python
Good Knowledge of HTML, CSS, BootStrap and JavaScript
Proficiency in Git

Interested developers can send their CV to the WhatsApp : 981890 or 
Email: kamta.si...@gmail.com.


Regards,
Kamta Prasad Singh
29/03/2019 

-- 
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/bfa87661-85e8-47dd-b755-2db37e841442%40googlegroups.com.


Re: mysqlclient for django

2020-03-02 Thread hajar Benjat
I already use this and it give me error message

On Mon, Mar 2, 2020, 2:03 PM shedd tutt  wrote:

> Use pip install mysqlclient
>
> --
> 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/ced13221-c921-476f-9784-68de6630b516%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/CAMcj6WeOxgag-zG%2BiDrvFj8%2BzV%3DUuPR_pc4Qbr6r-iz7p1pvwA%40mail.gmail.com.


Re: can you make program from this algorithm

2020-03-02 Thread Kasper Laudrup

Hi Sagar,

On 03/03/2020 03.19, sagar ninave wrote:
i just want help to know how i implement this algorithm only if anyone 
can do this then they can guide me. i don't want to pay anyone




Share the code you've written so far or explain what you are uncertain 
about.


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/111ea6fb-32c8-a8f0-4040-ae4c324104da%40stacktrace.dk.


Re: DjangoProject related queries: what is name(means unknown random number) after HTTP status code.

2020-03-02 Thread Integr@te System
Hi Lahu,

Check Django doc for your idea
https://github.com/django/django/blob/stable/2.2.x/django/utils/log.py


Nice.

On Mon, Mar 2, 2020, 19:37 Lahu Chavan  wrote:

> when we run command on teminal python manage.py runserver after will get
> local server IP address click on immediately, one hand will open a
> webbrowser page of django project and another hand on terminal continue
> processing in format  [Date]  "HTTP method"  HTTP status code | unknown
> random number.
>
>
>
> *my question is what is name(means *unknown random number)*  after HTTP
> status code.*
>
>
>
> *Please share answer as soon as possible*
>
>
>
> System check identified no issues (0 silenced).
> February 28, 2020 - 06:31:46
> Django version 3.0.3, using settings 'pydjblog.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> [28/Feb/2020 06:31:52] "GET / HTTP/1.1" 200 3295
> [28/Feb/2020 06:31:52] "GET /static/css/custom.css HTTP/1.1" 304 0
> [28/Feb/2020 06:31:52] "GET /static/popper.min.js HTTP/1.1" 404 1665
> [28/Feb/2020 06:31:52] "GET /static/bootstrap.min.js HTTP/1.1" 404 1674
>
>
> thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bbdc4dec-e77d-46ba-ad5a-1c500e1539f4%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/CAP5HUWpDUXYxgh8S7TaGjydUj6FDOKm8Dc37Qyq92nAYt3i6Hg%40mail.gmail.com.


Re: mysqlclient for django

2020-03-02 Thread hajar Benjat
C:\Users\lenovo ideapad\Desktop\django-chartit\django-project\my_chartit>pip
install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.4.6.tar.gz (85 kB)
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
 command: 'c:\users\lenovo 
ideapad\appdata\local\programs\python\python37-32\python.exe' -u -c 'import 
sys, setuptools, tokenize; sys.argv[0] = 
'"'"'C:\\Users\\LENOVO~1\\AppData\\Local\\Temp\\pip-install-rhuhg3tu\\mysqlclient\\setup.py'"'"';
 
__file__='"'"'C:\\Users\\LENOVO~1\\AppData\\Local\\Temp\\pip-install-rhuhg3tu\\mysqlclient\\setup.py'"'"';f=getattr(tokenize,
 
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
install --record 
'C:\Users\LENOVO~1\AppData\Local\Temp\pip-record-qkea_yh8\install-record.txt' 
--single-version-externally-managed --compile --install-headers 
'c:\users\lenovo 
ideapad\appdata\local\programs\python\python37-32\Include\mysqlclient'
 cwd: 
C:\Users\LENOVO~1\AppData\Local\Temp\pip-install-rhuhg3tu\mysqlclient\
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> 
build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> 
build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> 
build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> 
build\lib.win32-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe /c 
/nologo /Ox /W3 /GL /DNDEBUG /MT -Dversion_info=(1,4,6,'final',0) 
-D__version__=1.4.6 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 
6.1\include\mariadb" "-Ic:\users\lenovo 
ideapad\appdata\local\programs\python\python37-32\include" 
"-Ic:\users\lenovo 
ideapad\appdata\local\programs\python\python37-32\include" "-IC:\Program 
Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\ATLMFC\include" 
"-IC:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" "-IC:\Program 
Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files 
(x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files 
(x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files 
(x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files 
(x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files 
(x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /TcMySQLdb/_mysql.c 
/Fobuild\temp.win32-3.7\Release\MySQLdb/_mysql.obj /Zl 
/D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Impossible d'ouvrir le fichier 
includeÿ: 'mysql.h'ÿ: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual 
Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x86\\cl.exe'
 
failed with exit status 2

ERROR: Command errored out with exit status 1: 'c:\users\lenovo 
ideapad\appdata\local\programs\python\python37-32\python.exe' -u -c 'import 
sys, setuptools, tokenize; sys.argv[0] = 
'"'"'C:\\Users\\LENOVO~1\\AppData\\Local\\Temp\\pip-install-rhuhg3tu\\mysqlclient\\setup.py'"'"';
 
__file__='"'"'C:\\Users\\LENOVO~1\\AppData\\Local\\Temp\\pip-install-rhuhg3tu\\mysqlclient\\setup.py'"'"';f=getattr(tokenize,
 
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
install --record 
'C:\Users\LENOVO~1\AppData\Local\Temp\pip-record-qkea_yh8\install-record.txt' 
--single-version-externally-managed --compile --install-headers 
'c:\users\lenovo 
ideapad\appdata\local\programs\python\python37-32\Include\mysqlclient' 
Check the logs for full command output.

Le lundi 2 mars 2020 14:03:07 UTC+

Django Platform (not just Framework)

2020-03-02 Thread guettli
I know the terms "Platform" and "Framework" are not well-defined.

For me a platform allows you to install plugins without touching source 
code.

For example, Nextcloud is a platform (for me).

Is there already a third-party solution that provides a platform based on 
Django?

This would be very very cool.

Regards,
  Thomas Güttler

-- 
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/629ac503-97b6-48c3-90e2-f96a77aefc15%40googlegroups.com.


website using django

2020-03-02 Thread bijay subedi
i am simply not getting to the point what to keep in model.py  when 
creating a webpage for tourist guide website .what are the things i 
basiclly  need to put in database fields?
please help me out with 

-- 
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/7f98f436-5e63-4e37-8bc5-c1265c3994de%40googlegroups.com.


Re: Python Django Training

2020-03-02 Thread Hadisur Rahman
add me too
ᐧ

On Mon, Mar 2, 2020 at 6:38 PM MS V  wrote:

> Please add me too
>
> On Mon, Mar 2, 2020 at 12:17 PM amanda  wrote:
>
>> I am interesting learn
>>
>> 在 2020年2月1日星期六 UTC+1下午2:42:52,Srikanth K写道:
>>>
>>> Hi,
>>>
>>> I am from Hyderabad. I am Python Developer by Profession. I am eager
>>> take up any Python , Django Training (online Preferrable or Weekends).
>>> Members who require can contact me or share me  there idea.
>>>
>>> Regards,
>>> Srikanth.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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/86f4f061-5500-45e1-aa16-e87090af41c9%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/CA%2BDHP4ei4N4HwMz22NPCkHgcC2bdKLcbnciYQfqMpDf33pDPag%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/CAOd0vtVT5G9byOYhtxgR%2BoYa6yR0LDjHAGsEZGNe_RjE67Jukw%40mail.gmail.com.


Re: website using django

2020-03-02 Thread Omkar Parab
Destination_name
Image
Description
Ratings



On Mon, Mar 2, 2020, 11:06 PM bijay subedi  wrote:

> i am simply not getting to the point what to keep in model.py  when
> creating a webpage for tourist guide website .what are the things i
> basiclly  need to put in database fields?
> please help me out with
>
> --
> 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/7f98f436-5e63-4e37-8bc5-c1265c3994de%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/CAJY8mfzDuB7FmMfy1XwLoGSJcy_%3D775f5sJiTDzrFYmmRV_eBA%40mail.gmail.com.


Stuck with Django on a Synology Diskstation

2020-03-02 Thread 'MH' via Django users
Hi there

I am rather a newbie, but after some problems I got django installed on my 
Synology Diskstation. So, I ignored many other problems and am very happy 
that I built my very first, very simple app. And now I would like to move 
it from the development stage to the production stage. Obviously I should 
make a change to a distinct webserver. Synology offers nginx and apache 
2.4. I installed both. And now I do not really know how to proceed. Out 
there, there are many instructions to use something called mod-wsgi. But I 
cannot install this from the package center of the Diskstation.

I also tried to get opkg working. And this did not turn out so well, too. 
Most packages return an error, when I try to install something. Before this 
gets too elusive, I would ask you for guidance and then I can provide you 
with the following error messages.

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/3b30b913-c881-451d-a25e-3539eaefa035%40googlegroups.com.


The problem with saving the session without using a browser (using python.requests).

2020-03-02 Thread Владимир Пылев
Hello! In my situation, I need to communicate with the django application 
through python from the desktop application (using python.requests).

The logic is this:
1 - Transfer the username and password to the login() - get and save to 
file the *session_id*.
2 - Use *session_id* from file to identify user for *get()* and *post()* 
requests. In order not to transfer login and password every time.
3 - Before each *post()* request, I make a *get()* request to get a 
CSRF code.

What i get:
If you use a fresh *session_id* (without saving to a file) then everything 
works.
And if you use *session_id* from a file, then the user is identified only 
for *get()* requests. For *post()* requests, the user is not identified.

So the question is:
What am I doing wrong, or should it be so?

Code examples:

# In myApp/views.py

def db_login(request):
if request.method == 'POST':
user = authenticate(request, username=request.POST.get('username'), 
 password=request.POST.get('password'))
if user is not None:
login(request, user)
return HttpResponse(json.dumps([True, "Logged In", dict(request.
headers), request.user.username ]))
else:
return HttpResponse(json.dumps(False, "Not Logged In"))
else:
get_token(request) # adding csrftoken in cookies.
return HttpResponse(json.dumps([request.method, request.user.username 
]))


def studio_create(request):
if request.method == 'POST':
return HttpResponse(json.dumps((request.method, dict(request.headers
), request.user.is_authenticated, request.user.username )))

else:
get_token(request) # adding csrftoken in cookies.
return HttpResponse(json.dumps((request.method, dict(request.headers
), request.user.is_authenticated, request.user.username )))


The case when everything works, when the user was identified by *session_id* 
when 
executing a *post()* request:

# In Desktop app

import requests

def post_var1():
create_url=f'{HOST}db/studio/create/'
login_url=f'{HOST}db/login/'
cookie_path = '/tmp/cookie'


# (1.0) get to login()
sess = requests.Session()
r1=sess.get(login_url)
# (1.1) post to login()
csrf_token = r1.cookies.get('csrftoken')
r2 = sess.post(login_url, data=dict(username='vofka', password='1234', 
csrfmiddlewaretoken=csrf_token))
# (1.2) write cookie
with open(cookie_path, 'w') as f:
f.write(json.dumps(dict(r2.cookies)))

# (2.0) get to create()
sessionid = r2.cookies.get('sessionid')
r3=sess.get(create_url, cookies = dict(sessionid=sessionid))
# (2.1) post to create()
csrf_token = r3.cookies.get('csrftoken')
r4=sess.post(create_url, data=dict(csrfmiddlewaretoken=csrf_token, 
cookies=dict(sessionid=sessionid)))

print(r4.json())


>> ["POST", {"Content-Length": "102", "Content-Type": 
"application/x-www-form-urlencoded", "Host": "localhost:8000", "User-Agent": 
"python-requests/2.23.0", "Accept-Encoding": "gzip, deflate", "Accept": 
"*/*", "Connection": "keep-alive", "Cookie": 
"csrftoken=JXTlxGsCPzj6LbeOfJwYJ2A2OYnVEucEp1WhhCF6C4ML2gGs4kJrOQEuXgm9SFSJ; 
sessionid=vuhkhofnxeh485ar0rocfnotdttmfbp3"}, true, "vofka"]

The case when *session_id* from a file are used. And the user is identified 
only for *get()* requests.

# In Desktop app

import requests


def post_var2():
url=f'{HOST}db/studio/create/'
html = '/tmp/mtest.html'
cookie_path = '/tmp/cookie'

# (1) read cookie
with open(cookie_path, 'r') as f:
cookie=json.load(f)

# (2) get to create()
sess = requests.Session()
r3=sess.get(url, cookies = cookie)

# (3) post to create()
csrf_token = r3.cookies.get('csrftoken')
r4=sess.post(url, data=dict(csrfmiddlewaretoken=csrf_token, cookies=cookie 
))

>> print(r3.json())
>> ['GET', {'Content-Length': '', 'Content-Type': 'text/plain', 'Host': 
'localhost:8000', 'User-Agent': 'python-requests/2.23.0', 'Accept-Encoding': 
'gzip, 
deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Cookie': 
'csrftoken=JXTlxGsCPzj6LbeOfJwYJ2A2OYnVEucEp1WhhCF6C4ML2gGs4kJrOQEuXgm9SFSJ; 
sessionid=vuhkhofnxeh485ar0rocfnotdttmfbp3'}, True, 'vofka']

>> print (r4.json())
>> ['POST', {'Content-Length': '120', 'Content-Type': 
'application/x-www-form-urlencoded', 'Host': 'localhost:8000', 'User-Agent': 
'python-requests/2.23.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 
'*/*', 'Connection': 'keep-alive', 'Cookie': 
'csrftoken=JXTlxGsCPzj6LbeOfJwYJ2A2OYnVEucEp1WhhCF6C4ML2gGs4kJrOQEuXgm9SFSJ'
}, False, '']


Django version 3.0.3 Python version 3.7.6

*settings.MIDDLEWARE* did not change from the creation of the project with 
the *startproject* command:
# In settings.py

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.aut

Re: website using django

2020-03-02 Thread Take Fun
Bro... We are from the same ground... But can you tell me more clearly...
Ali buje na maile...

On Mon, Mar 2, 2020, 11:22 PM bijay subedi  wrote:

> i am simply not getting to the point what to keep in model.py  when
> creating a webpage for tourist guide website .what are the things i
> basiclly  need to put in database fields?
> please help me out with
>
> --
> 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/7f98f436-5e63-4e37-8bc5-c1265c3994de%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/CAA8Mfu31nVHnmh2AzNm0tpAffbGQXjBVXEWV1i12_NGGqEUDBA%40mail.gmail.com.


Django on Synoloy

2020-03-02 Thread 'MH' via Django users
Dear all

I have a problem to get my django app from development to production stage 
on a Synology Diskstation. I installed apache 2.4, but I do not know how to 
proceed and I am always running into errors. Please give some guidance and 
I will add specific error messages.

Best regards
MH

PS: I did not find my previous post, so I wrote this again. In case, sorry 
for double posting.

-- 
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/2989925f-c121-4fb2-803a-51743dce99b7%40googlegroups.com.


in python project using pycharm, im getting error, any help

2020-03-02 Thread Amr Hamed


--
Edit question 


in python project using pycharm, im getting error, any help:

models.py

from django.contrib.gis.db import models
from django.contrib.gis.db.models import PointField
from phone_field import PhoneField
 # Create your models here.
class Clinic1(models.Model):

name = models.CharField(max_length=100)
location = models.PointField()
address = models.CharField(max_length=100)
city = models.CharField(max_length=50)
date = models.DateTimeField(auto_now_add=True)


Establishment = models.CharField(max_length=100, default='SOME STRING' )
StreetNumber = models.CharField(max_length=100, default='SOME STRING' )
StreetName = models.CharField(max_length=100, default='SOME STRING')
suite = models.CharField(max_length=100, default='SOME STRING')
city = models.CharField("City", max_length=1024, default='SOME STRING')
state = models.CharField("State", max_length=100, default='SOME STRING')
zip_code = models.CharField("ZIP / Postal code", max_length=12, 
default='SOME STRING')
latitude = models.PointField(max_length=100, blank=True, null=True )
longitude = models.PointField(max_length=100, blank=True, null=True )
PhoneNumber = PhoneField(blank=True, help_text='Contact phone number')
licensenumber = models.CharField(max_length=100, default='SOME STRING')
district = models.CharField(max_length=100, default='SOME STRING')
Sector = models.CharField(max_length=100, default='SOME STRING')
CouncilDistrict = models.CharField(max_length=100, default='SOME STRING')
workzone = models.CharField(max_length=100, default='SOME STRING')
county = models.CharField(max_length=100, default='SOME STRING')
ApprovedDate = models.DateTimeField(auto_now_add=True, blank=True, 
null=True)
LicenseFeeSchedule = models.CharField(max_length=100, default='SOME STRING')



i get this error when i run>> python manage.py migrate


  raise ValueError('String input unrecognized as WKT EWKT, and HEXEWKB.')
ValueError: String input unrecognized as WKT EWKT, and HEXEWKB.

-- 
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/b35c627c-39f8-433b-9505-86e3a6f725a2%40googlegroups.com.


Class based views vs methods

2020-03-02 Thread guettli
The django tutorial starts with method based views.

What is the state of the art?

If I am unsure: Do you suggest to use class-based or method-based views?

Regards,
  Thomas

-- 
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/963bb6e7-d8e2-4987-b6c8-31cbcbfbc6a0%40googlegroups.com.


Re: Class based views vs methods

2020-03-02 Thread Ernest Thuku
first I can advice you to learn the function based views. They will give
you a good foundation of how views work and after that switch to Class
Based Views(they are magical and easy to use).

On Tue, Mar 3, 2020 at 12:59 AM guettli 
wrote:

> The django tutorial starts with method based views.
>
> What is the state of the art?
>
> If I am unsure: Do you suggest to use class-based or method-based views?
>
> Regards,
>   Thomas
>
> --
> 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/963bb6e7-d8e2-4987-b6c8-31cbcbfbc6a0%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/CAPsfuof77SLhx0nAyVJjSz42VFtC4CB%2BF77iahHyv0j5VE6v7g%40mail.gmail.com.


Re: Integrating Django Rest Framework with Microsoft Office 365

2020-03-02 Thread Nosa Omorodion
Oh!

I am actually done working on all my endpoints.

This part of the application is something new to me. Struggling with it.


On Sun, Mar 1, 2020, 3:07 PM Motaz Hejaze  wrote:

> This is a whole project you asking about
>
> On Sun, 1 Mar 2020, 2:56 pm Nosa Omorodion, 
> wrote:
>
>> I am currently trying to consume the Microsoft Office365 API and Expose
>> it via DRF to my frontend.
>>
>> I want to be able to:
>>
>>1.
>>
>>Give Role/Permissions to authenticated Users based off of Django
>>already existing roles and Permission
>>2.
>>
>>Expose the APIs to my Angular frontend for authentication.
>>
>> How do i save authenticated users to the Database and give them the
>> requisite permission so they authenticate having the given permission the
>> next time they login?
>>
>> --
>> 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/e9d9250a-d065-493b-ba58-6117db13a50c%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/CAHV4E-eexzQ_zjyFkZm9YiwORf2vLrrF6dpyiAjepqPUnasuMQ%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/CAMDZ7CzDqwTxLew07qPnJckAQm9qxiyHa%3DOiDad_Kp4hC%2BaAAQ%40mail.gmail.com.


Re: Integrating Django Rest Framework with Microsoft Office 365

2020-03-02 Thread DANIEL URBANO DE LA RUA
https://realpython.com/manage-users-in-django-admin/

-- 
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/CAO_yRT10xfNPvgeBTrrOC0kbQDLHGiCPu2jwa15cH85dByHr1A%40mail.gmail.com.


Re: How to debug Daphne CPU 100% issue

2020-03-02 Thread Fogmoon
Yes, the CPU return %80 ~ 100%.

I still check all the items, it just seems OK,  which have the similar 
value like that when CPU is normal.

One obvious difference is the strace command (*sudo strace -c -p 22549*) 
output:

When CPU is high, the output always show the right 64bit mode after the 
wrong x32 mode:
strace: Process 22549 attached
strace: [ Process PID=22549 runs in x32 mode. ]
strace: [ Process PID=22549 runs in 64 bit mode. ]
^Cstrace: Process 22549 detached

While CPU is low, the output just has the attach info:
strace: Process 22549 attached
^Cstrace: Process 22549 detached

Do not mind to misleading the inspection (I know strace may show two modes, 
check 
here. 
),
 
but until now, I just find the one different thing.

Thanks.

在 2020年3月2日星期一 UTC+8下午9:49:04,Fogmoon写道:
>
> Thanks very much for your reply.
>
> Which make me confused now the CPU of Daphne is normal, keep 8% ~20%. I 
> update the new info and new check here. I think it will return to 100% 
> because I have not found the reason and do nothing.
>
> Environment:
>
>- OS: Ubuntu 18.04.1 LTS x86_64 GNU/Linux
>- Python: 3.6.5
>- Django: 2.1.1
>- Daphne: 2.3.0
>- Channels: 2.2.0
>- channels-redis: 2.4.0
>
> *Check Info:*
>
>1. check the thread numbers with *ps -o thcount 22549*, which shows 45 ( 
>> 40)
>2. check the websocket connected numbers with redis cli: *ZCOUNT 
>asgi::group:USER_MESSAGE -inf +inf,* which shows 160  ( < 190)
>3. check the system call with *sudo strace -c -p 22549 *for a minute, 
>the result as the following:
>
> [image: daphne_trace.png]
> *New Check Info:*
>
>1. check the system files open limits with : *sudo sysctl -p | grep 
>file*, which shows: 65535
>2. check process files open limits with: *cat /proc/22549/limits | 
>grep -E 'files | Soft'*, which shows: 
>
> [image: files_limits.png]
>
>
>In fact, I set the system and process open files(with 
> supervisord conf) limit long long ago.
>3. check the process open files number with *ls -l /proc/22549/fd 
> |  wc -l:* 145
>4. check the cpu and io stat with *iostat -ctz:*
>
> [image: iostat.png]
>
>
>5. check the net stat with *netstat -ano | grep daphne.sock (*because 
> ubuntu do not support the* b *parameter): which show 133, 1 is listening 
> status, 132 is connected status.
>
>
>
> 在 2020年3月2日星期一 UTC+8下午7:40:11,Integr@te System写道:
>>
>> Hi Fogmoon,
>>
>> Plz show again your image file's result and addition check 
>> iostat -ctz
>> netstat -anob
>>
>> to see more root cause.
>>
>> Dont for get update python version.
>>
>> Nice.
>>
>>
>> On Mon, Mar 2, 2020, 13:32 Fogmoon  wrote:
>>
>>> Hi, 
>>>
>>> Could you please give some suggestions to inspect the high CPU (most 
>>> time above 90% and some time above 100%) consumed by Daphne. 
>>>
>>> Environment:
>>>
>>>- OS: Ubuntu 18.04.1 LTS x86_64 GNU/Linux
>>>- Django: 2.1.1
>>>- Daphne: 2.3.0
>>>- Channels: 2.2.0
>>>- channels-redis: 2.4.0
>>>
>>> Just use the Daphne as the websocket server with redis as the Channel 
>>> layer. 
>>>
>>> Now I do the following steps:
>>>
>>>1. top command show the daphne process consume high cpu
>>>2. check the thread numbers with *ps -o thcount 22549*, which shows 
>>>40. 
>>>3. check the websocket connected numbers with redis cli: *ZCOUNT 
>>>asgi::group:USER_MESSAGE -inf +inf,* which shows 190
>>>4. check the system call with *sudo strace -c -p 22549 *for a 
>>>minute, the result as the following:
>>>
>>> [image: daphne_cpu.png]
>>> Best Wishes.
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/913143a8-c8c8-47ce-a96d-6c9d349eac6a%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/f263e8b6-2728-4536-b0a8-b0ba0327bdbd%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-02 Thread nitish kumar
Hi MH,


what flavour of Linux you are using. if it is centos/redhat you can use 
below steps.

   $sudo yum install httpd24-devel.x86_64 gcc git
 $sudo python3.5 -m pip install  mod-wsgi


once installed you need to add site configuration and permissions to your 
Django code.

 $ cd ~/django_app
 $python manage.py makemigrations
 $python manage.py migrate
 Note: if you get any errors remove  "db.sqlite3" file and execute the above 2 
commands
 $python manage.py collectstatic
 $sudo chown :www-data db.sqlite3
 $sudo service apache2 restart


If packages are not available you have to try the offline installation. and 
you need to install dependencies manually.

ping me if you need more help(https://twitter.com/vullinitish)



On Tuesday, 3 March 2020 01:34:23 UTC+5:30, MH wrote:
>
> Hi there
>
> I am rather a newbie, but after some problems I got django installed on my 
> Synology Diskstation. So, I ignored many other problems and am very happy 
> that I built my very first, very simple app. And now I would like to move 
> it from the development stage to the production stage. Obviously I should 
> make a change to a distinct webserver. Synology offers nginx and apache 
> 2.4. I installed both. And now I do not really know how to proceed. Out 
> there, there are many instructions to use something called mod-wsgi. But I 
> cannot install this from the package center of the Diskstation.
>
> I also tried to get opkg working. And this did not turn out so well, too. 
> Most packages return an error, when I try to install something. Before this 
> gets too elusive, I would ask you for guidance and then I can provide you 
> with the following error messages.
>
> 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/073b40dd-1379-405e-8c44-b582b72173ac%40googlegroups.com.