Re: Import [python django module] could not be resolved from source Pylance (reportMissingModuleSource) -- even though Django is installed in my venv

2023-04-27 Thread Michael Starr
Thank you for the replies. I am overwhelmed right now but will check back 
on them later.

I think you two are right that it's the IDE. It's VSCode (I don't know what 
version). I was just suspicious b/c there were some strange bugs in my 
django project. I won't worry about it. If it annoys me I'll redirect the 
pointers.

Michael

On Thursday, April 27, 2023 at 3:27:31 PM UTC-7 Khaleel Ahmed H. M. Shariff 
wrote:

> Hi Michael 
>
> May Peace, Blessings & Mercy of Almighty God be on you!
>
> do you know how to modify the sys.path to add the directory where the 
> listed modules are installed?
>
> On Linux/UNIX
> Execute the find command to locate the directory where the modules are 
> installed and include the same in the path
>
> On windows 
> Execute the dir/s to locate the directory where the modules are installed 
> and include the same in the path
>
> Best of luck
>
> God Bless You!
> God Bless India!!
> --
>
> Love & Regards
> Dr. (h.c.) Khaleel Ahmed H. M.
>
> +91-9845007864 <+91%2098450%2007864>
>
> Taming Python
>
>
> https://www.amazon.in/Taming-Python-comfortable-writing-Scripts-ebook/dp/B08T6PQG7M
>
> ---
>
> Human Life is Precious
> Koran Surah Ma'idah Chapter 5 Verse 32:
> If anyone killed a person, not in retaliation of murder, or (and) to 
> spread mischief in the land - it would be as if he killed all mankind, & if 
> anyone saved a life, it would be as if he saved the life of all mankind.
>
> On Fri, 28 Apr 2023 at 2:54 AM, Reddy Tintaya  wrote:
>
>> Should I suppose that it appears like error only in your editor, but the 
>> app runs with no problem?
>> I guess the error is that your IDE is not pointing to the correct python 
>> interpreter
>>
>>
>> On 27 Apr 2023, at 16:05, Michael Starr  wrote:
>>
>> I did pip install django on my venv, which is activated, and it reported 
>> already installed. But the following modules are reporting the error in the 
>> subject line:
>> django.db
>> models
>> django.utils.crypto
>> django.urls
>> django.contrib
>> admin
>> django.shortcuts
>> django.views.generic
>>
>> I don't know what's wrong. My server runs in development mode (not in 
>> production yet), but there havev been some bugs that are hard to imagine 
>> are caused by this, but still (images not loading, CSS not loading).
>>
>> Thanks.
>>
>> Michael
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f7977c43-90ef-4423-bb36-07c550bfda52n%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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/2FFAC08F-0BC9-44B6-98B2-97A8978AB3DC%40momnt.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/52f5968e-2e0d-4f64-8fb3-5bbd2ef70bean%40googlegroups.com.


Re: Import [python django module] could not be resolved from source Pylance (reportMissingModuleSource) -- even though Django is installed in my venv

2023-04-27 Thread Khaleel Ahmed H. M. Shariff
Hi Michael

May Peace, Blessings & Mercy of Almighty God be on you!

do you know how to modify the sys.path to add the directory where the
listed modules are installed?

On Linux/UNIX
Execute the find command to locate the directory where the modules are
installed and include the same in the path

On windows
Execute the dir/s to locate the directory where the modules are installed
and include the same in the path

Best of luck

God Bless You!
God Bless India!!
--

Love & Regards
Dr. (h.c.) Khaleel Ahmed H. M.

+91-9845007864

Taming Python

https://www.amazon.in/Taming-Python-comfortable-writing-Scripts-ebook/dp/B08T6PQG7M

---

Human Life is Precious
Koran Surah Ma'idah Chapter 5 Verse 32:
If anyone killed a person, not in retaliation of murder, or (and) to spread
mischief in the land - it would be as if he killed all mankind, & if anyone
saved a life, it would be as if he saved the life of all mankind.

On Fri, 28 Apr 2023 at 2:54 AM, Reddy Tintaya  wrote:

> Should I suppose that it appears like error only in your editor, but the
> app runs with no problem?
> I guess the error is that your IDE is not pointing to the correct python
> interpreter
>
>
> On 27 Apr 2023, at 16:05, Michael Starr 
> wrote:
>
> I did pip install django on my venv, which is activated, and it reported
> already installed. But the following modules are reporting the error in the
> subject line:
> django.db
> models
> django.utils.crypto
> django.urls
> django.contrib
> admin
> django.shortcuts
> django.views.generic
>
> I don't know what's wrong. My server runs in development mode (not in
> production yet), but there havev been some bugs that are hard to imagine
> are caused by this, but still (images not loading, CSS not loading).
>
> Thanks.
>
> Michael
>
>
>
> --
> 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/f7977c43-90ef-4423-bb36-07c550bfda52n%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/2FFAC08F-0BC9-44B6-98B2-97A8978AB3DC%40momnt.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/CAMjBbiBJZcKp%2Be%3DXtRpzjQWoMddtsjbH3sOhg1GiAKhnEP%2BzDg%40mail.gmail.com.


Re: Import [python django module] could not be resolved from source Pylance (reportMissingModuleSource) -- even though Django is installed in my venv

2023-04-27 Thread Reddy Tintaya
Should I suppose that it appears like error only in your editor, but the app 
runs with no problem?
I guess the error is that your IDE is not pointing to the correct python 
interpreter


> On 27 Apr 2023, at 16:05, Michael Starr  wrote:
> 
> I did pip install django on my venv, which is activated, and it reported 
> already installed. But the following modules are reporting the error in the 
> subject line:
> django.db
> models
> django.utils.crypto
> django.urls
> django.contrib
> admin
> django.shortcuts
> django.views.generic
> 
> I don't know what's wrong. My server runs in development mode (not in 
> production yet), but there havev been some bugs that are hard to imagine are 
> caused by this, but still (images not loading, CSS not loading).
> 
> Thanks.
> 
> Michael
> 
> -- 
> 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/f7977c43-90ef-4423-bb36-07c550bfda52n%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/2FFAC08F-0BC9-44B6-98B2-97A8978AB3DC%40momnt.com.


Import [python django module] could not be resolved from source Pylance (reportMissingModuleSource) -- even though Django is installed in my venv

2023-04-27 Thread Michael Starr
I did pip install django on my venv, which is activated, and it reported 
already installed. But the following modules are reporting the error in the 
subject line:
django.db
models
django.utils.crypto
django.urls
django.contrib
admin
django.shortcuts
django.views.generic

I don't know what's wrong. My server runs in development mode (not in 
production yet), but there havev been some bugs that are hard to imagine 
are caused by this, but still (images not loading, CSS not loading).

Thanks.

Michael

-- 
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/f7977c43-90ef-4423-bb36-07c550bfda52n%40googlegroups.com.


Re: Machine learning mailing group

2023-04-27 Thread Gobi Dasu
+1 I would like to learn about more skill and startup focused mailing
groups like these, if anyone has suggestions.

*Regards,*
*Gobi Dasu*  (calendar
)
*Stanford CS **·* *Northwestern HCI*
*LD Talent  *(demo
)


On Mon, Apr 24, 2023 at 11:28 AM sunday honesty 
wrote:

> Hi Django Devs,
>
> Please can anyone recommend me a Data Science mailing group like this one?
>
> Sincerely,
>
> --
> 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/CALcuGNuF1Vb9W8Q-3hLSvy%3Dnicb73r1HgqGmOCN9droUORPEMQ%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/CAMk8evmj0cBZnovq21TTqsW_6FOHcFK0ZtRhKpMUjqzZkquFCw%40mail.gmail.com.


Re: Is programming in Django intellectually satisfactory

2023-04-27 Thread Sebastian Jung
Yeah but it exists frustrating things. For example left outer join is not
easy to make this with django ORM... But for most things you found good and
easy solutions... I love django

Alec Delaney <96alecpatr...@gmail.com> schrieb am Do., 27. Apr. 2023, 05:28:

> I love it
>
> On Wed, Apr 26, 2023, 11:08 PM Mike Dewhirst 
> wrote:
>
>> On 26/04/2023 10:18 am, Julius Chesoni wrote:
>>
>>  Hi guys, I find programming in the abstract very interesting and full of
>> intellectual benefits similar to those acquired from Mathematics. However,
>> when it comes to programming languages I find the practice of programming
>> very tiresome since there are very many functions in the documentations. I
>> am not able to enjoy reading the documentations even though I am eager to
>> know how to master the particular language. How do you guys manage to be
>> masters in languages like Django since I see some great people contributing
>> to every question. This amazes me.
>>
>>
>> Django could be thought of as a language. In fact it is a "framework" - a
>> jargon word which probably needs decoding but I don't have time.
>>
>> Django is written in Python. Python started as a teaching language for
>> primary school kids but it has sufficient sophistication for masters of
>> Python to build almost anything.
>>
>> The two main benefits of Python are:
>>
>>  * ease of learning for beginners and
>>  *  powerful enough for complex projects to be built faster than most
>> other languages.
>>
>> Python was chosen by Django's original authors for a web project and they
>> built libraries of useful routines which they eventually open-sourced as
>> Django to make website development much more satisfying for other
>> developers.
>>
>> The intellectual satisfaction - and therefore main attraction of Django -
>> comes from being able to do anything. There are plenty of guidelines and
>> "best practices" but absolutely no frustrating restrictions. If you find a
>> web problem you want to solve, I would be very surprised if it couldn't be
>> solved with Django.
>>
>> Many would argue front-end problems cannot be solved with a back-end
>> server architecture like Django but nowadays, with htmx, that argument is
>> lost.
>>
>> So, to answer your question in the abstract, Django is used as the
>> interface "language" between a database and the user with a web browser. It
>> contains an "Object Relational Mapper" (ORM). The mathematics of relational
>> database management systems (RDBMS) should pique your interest. The
>> language of RDBMS is Structured Query Language (SQL) but because Django has
>> its ORM you no longer need to learn SQL. The Django library of queries
>> comes to the rescue.
>>
>> Django, HTML+htmx and CSS therefore is all you really need to build a
>> completely fuctional and intellectually satisfying website.
>>
>> My advice to you is to find a small project you really want to do and get
>> started one step at a time.
>>
>> Someone else said practice practice practice. That is completely correct.
>> You need to start somewhere if you are really interested.
>>
>> With practice you can tackle ever more interesting projects.
>>
>> Good luck.
>>
>>
>> Kind regards
>> Julius
>> --
>> 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/CANOu6a8axU1sL6GXveq7CufyTm1JWX-6aZ7FU4fJVqLq9M0GAQ%40mail.gmail.com
>> 
>> .
>>
>>
>>
>> --
>> Signed email is an absolute defence against phishing. This email has
>> been signed with my private key. If you import my public key you can
>> automatically decrypt my signature and be sure it came from me. Your
>> email software can handle signing.
>>
>> --
>> 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/17f6b06b-546f-069b-4487-d740b5bd7267%40dewhirst.com.au
>> 
>> .
>>
> --
> 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/CAFGN%3DGhuquB47d%3DgJUPUh%2BZAk5mPBCuXUz_FLBQ89AvW0O9-iw%40mail.gmail.com
> 

Re: Serving static files in production

2023-04-27 Thread David Nugent
Don't think I ever used alias for this.

You could try something like this (works for me - this is a cut and paste
of an existing working config) though you may be a little more constrained
with names of directories:

server {
[... elided]

location / {

location ~ /static/ {
sendfileon;
tcp_nopush  on;
root/srv/approot;
}

location / {
proxy_set_headerHost $http_host;
proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_headerX-Forwarded-Proto $scheme;
proxy_redirect  off;
proxy_pass  http://;
}
}
[... elided]
}

Note that files being served are contained in the actual directory
/srv/approot/static, and you can serve media here also from the "media" dir
using

location ~ /(media|static)/ { ...

HTH, David

On Thu, Apr 27, 2023 at 3:42 PM Brian Odhiambo 
wrote:

> Thanks for your response @David.
> Here is my nginx configuration.[image:
> 1c9b64ec-c74f-4004-8b8d-9a6e7a3d8069.png]
> Pointed it to staticfiles after running collectstatic files command.
>
> On Thu, Apr 27, 2023 at 8:11 AM Prosper Lekia 
> wrote:
>
>> Is whitenoise installed and added to MiddleWare?
>>
>> On Thu, Apr 27, 2023, 00:37 David Nugent  wrote:
>>
>>> Ensure that nginx is correctly configured, since from what you have
>>> provided the django configuration looks correct (although I generally use
>>> /static/ as STATIC_URL - with the leading / but should work as you have
>>> it). Check the nginx error log to try to discover the cause of the 404s. I
>>> suspect that the location blocks are defined in the wrong order or the
>>> directory pointing to the incorrect location.
>>>
>>> In any case, whitenoise is not a bad solution tbh, and very flexible
>>> besides. I would solve the above - which should work - before investigating
>>> that further.
>>>
>>> Regards,
>>> David
>>>
>>> On Thu, Apr 27, 2023 at 1:01 AM Brian Odhiambo <
>>> brianodhiambo...@gmail.com> wrote:
>>>
 Hello everyone,
 I am deploying a django project to a dedicated server.
 I have set nginx to find static files in this file "staticfiles".

 This is the setting in settings.py file:

 STATIC_ROOT = BASE_DIR / 'staticfiles'
 STATIC_URL = 'static/'

 After running collectstatic command, my project can't still load the
 static files.
 Could I get a general way of going about this, without having to rely
 on a third party library like whitenoise?

 My appreciation in advance.

 --
 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/eefed174-efad-4101-80c1-b0a589c64507n%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/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%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/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%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/CAPjQKqZcbd8nPu-2cLAER_nGZnPtm%2BBbEXRDvFTtb-ZG40Bo5w%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe