Saturday, August 31, 2024

Re: issue with static files deployement in Prod envirenment (new issu)

Hi Emmanuel
i tried the solution you provided , but sadly it doesn't work too- i add the my user and www.data user to the same group (i tried this with sudo in venv and outside venv) igave the permissions required to deal with the files - but no way. its still not working- . i am sure that's a permissions issue but what a kinf of issue is ? any other suggestion

Le dimanche 25 août 2024 à 18:27:56 UTC+1, Abulbanat Mosta (Abulila) a écrit :
Thank you a lot  EMMANUEL  for this hint- i'll try and return back to you with insghts

Le dimanche 25 août 2024 à 15:39:54 UTC+1, ASAMOAH EMMANUEL a écrit :
I understand how frustrating this can be. I also faced this same issue for months and this was how I solved it.

  sudo usermod -a -G your_user www-data

  sudo chown -R :www-data /path/to/your/static/folder


Let me know if it is still not solved and I will help you.
Swimmingly,
Simple_genius

On Sun, Aug 25, 2024 at 2:16 PM Abulbanat Mosta (Abulila) <dr.moste...@gmail.com> wrote:
Im getting crazy and very  frustrated about deploying static files of my django app since 1 month- all things are ok except static and media files  which cannot be served by the web server ( i tried apache and nginx)
Firstable- in dev mode my app is ok and the static file are correctly loaded.
switching to prod Env - all my attempts to get over  the issue are unsuccessful.
im using 
 - ubuntu Ubuntu 22.04.4 LTS  
 - Django==3.2.9  
 - gunicorn  (version 22.0.0) as app server  
 - nginx 1.18.0  as reverse proxy -  

 i set up the setting.py and nginx conf with the correct path to static folder as following 


STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]

STATICFILES_DIRS = []

STATIC_URL = '/static/'
STATIC_ROOT = '/var/www/html/bweb/staticfiles'

MEDIA_URL = '/media/'
MEDIA_ROOT = '/var/www/html/bweb/media'


LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'locale'),
    os.path.join(BASE_DIR, 'core', 'locale'),

----------------------

--------------------------
nginx

 location /static/ {
        alias /var/www/html/bweb/staticfiles/;
        access_log /var/log/nginx/static_access.log;
         error_log /var/log/nginx/static_error.log;
        expires 30d;
    }

    location /media/ {
        alias /var/www/html/bweb/media/;
        access_log off;
        expires 30d;
    }

------------------------



- i installed & set gunicorn to serv the app 

- i run the collectstatic command witch copied the files into the path i mentioned in settings.py (several times - django detects each time the presence of the files what means that the conf is ok)
-im using debug = false in prod mod 

=>> whats happening 
my app is running in prod mode (gunicorn seems to do the job) but i'm getting 404 errors for all my static files - 
==> Here what i tried 
- i gave permissions to data-www user  over the folder and all its components which are actually present inside with the folder with the correct permissions
- i run the server in a separate port which is unused in the system - with allowed permissions in firewall
-i cleared the cache and tried out several browsers
- i tried to put manually a test file in the folder  and try to access with curl -
the files still dont want to be served  even the test file.
Log files aren't showing any significant error .

all those attempts were tested with apache web server but  i encounter the same issue

-------

Any one have faced such issue? ubuntu problem ? Django version issue?

I'll be very thankful for 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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/450049e4-2fff-4700-a4da-286826bf1d95n%40googlegroups.com.


--
I don't stop when I'm tired, I only stop when the job is done.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dc5aeac5-8b2d-42e1-95d9-a41b6627cd42n%40googlegroups.com.

topics to master

Hey all i'm currently pursuing my btech i have started django last 2 weeks back i have learnt page redirecting models , models, and save some information from browser to my db and currently i don't know which topic to learn , guys suggest me some topics to learn in detail to ace django 

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5bfc1353-4029-46e7-8142-3d61b4ca8a28n%40googlegroups.com.

Thursday, August 29, 2024

Re: Django Static Files Not Loading After EC2 Deployment with Nginx

Did you set up your STATIC_ROOT and do collectstatic?  How to manage static files (e.g. images, JavaScript, CSS) | Django documentation | Django (djangoproject.com)

On Friday 30 August 2024 at 04:06:41 UTC+8 Kiran Barai wrote:

Hello everyone,

  1.  I'm having trouble with my Django project after deploying it on an EC2 instance. The issue is that my static files (CSS, JavaScript) are not loading correctly.
  2. second issues in URL: - 
    issue with a Django project where the URL generated using the {% url %} template tag is not rendering correctly. Instead of getting the proper URL, the rendered URL appears to be incorrectly encoded and includes the literal template tag.           When clicking a button or link that is supposed to navigate to a specific view, the URL appears as follows: 
    https://mydomain/%7B%%20url%20'save-file-history'%20%%7D


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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c3e59ba2-1575-47eb-b9a8-535cd57c7514n%40googlegroups.com.

Re: select widget on forms


Em qui., 29 de ago. de 2024 às 17:15, Eduardo Barbachan <eduardobarbachandb@gmail.com> escreveu:
I would recommend you to read articles in the following links (both from Django documentation):

Em qui., 29 de ago. de 2024 às 17:05, frank dilorenzo <frankdil92@gmail.com> escreveu:
I have a table listing the names of butterflies.  I would like to create a user custom form with a select field populated by the list of butterflies.  I can't find anything on the web to show me the proper syntax.  I would appreciate any 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b9bfdf53-8050-4bbb-bee8-8aa56a661bdbn%40googlegroups.com.


--

Att.

Eduardo  Barbachan



--

Att.

Eduardo  Barbachan

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGEDDz9jf4Xhz-Hv7RVhyetf%3Deifb3Q-SxQikM2_0ZdTBubkEw%40mail.gmail.com.

Re: select widget on forms

I would recommend you to read articles in the following links (both from Django documentation):

Em qui., 29 de ago. de 2024 às 17:05, frank dilorenzo <frankdil92@gmail.com> escreveu:
I have a table listing the names of butterflies.  I would like to create a user custom form with a select field populated by the list of butterflies.  I can't find anything on the web to show me the proper syntax.  I would appreciate any 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b9bfdf53-8050-4bbb-bee8-8aa56a661bdbn%40googlegroups.com.


--

Att.

Eduardo  Barbachan

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGEDDz_N5q8LKu8GjaygKerdYqzLkK_OvPfpwDcbCMxb-CxPQw%40mail.gmail.com.

Re: How to import UGETTEXT_LAZY ON DJANGO 4.0

please I change all my ugetext_lazy to gettext_lazy and am still getting the same error please how can you help me.

On Friday 10 December 2021 at 18:46:41 UTC+4 Jason wrote:

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3
On Friday, December 10, 2021 at 12:01:03 AM UTC-5 ngal...@gmail.com wrote:

Thanks hopefully the same to ugettext

 

Kind Regards

 

Ngallen Ramadhan

T: +255 765 889 960 | Emial: ngal...@gmail.com | Skype: ngallen2

 

From: django...@googlegroups.com <django...@googlegroups.com> On Behalf Of David Nugent
Sent: 10 December 2021 07:50
To: django...@googlegroups.com
Subject: Re: How to import UGETTEXT_LAZY ON DJANGO 4.0

 

Simply change it to gettext_lazy. You don't need the deprecated functions, they were for python 2.

 

Regards, David

 

On Fri, Dec 10, 2021 at 3:43 PM <ngal...@gmail.com> wrote:

It seems Django has removed 'ugettext_lazy`(from django.utils.translation import ugettext_lazy as _) from Django version 4.0.x

How can I handle translation on Django version 4.0.x?

 

--
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/009b01d7ed80%246da44d40%2448ece7c0%24%40gmail.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.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a7fc530c-31b3-4ece-931d-15979b1acdd2n%40googlegroups.com.

Monday, August 26, 2024

select widget on forms

I have a table listing the names of butterflies.  I would like to create a user custom form with a select field populated by the list of butterflies.  I can't find anything on the web to show me the proper syntax.  I would appreciate any 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b9bfdf53-8050-4bbb-bee8-8aa56a661bdbn%40googlegroups.com.

Re: Freelance Opportunity : Django Developer for building A Dialer

Hello, is the opportunity  still available?

On Mon, 29 Jul 2024, 15:49 yaamoussa-solution, <yaamoussa02diouf@gmail.com> wrote:
Je suis interesse

Le mar. 2 avr. 2024 à 17:20, Abhishek J <Abhishek@assureassistance.in> a écrit :
Dear Developers,

I need to build an android and IOS phone dialer similar to Truecaller.

We are seeking experienced and dedicated candidates who are proficient in Django and possess a keen interest in contributing to this impactful initiative.

We look forward to the opportunity to collaborate with talented individuals who are passionate about creating innovative solutions in the education sector.

Thank you for considering this opportunity.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKkngwDHBygGho4gkHRhNkpVJf_d2UOkHQ%3DemN3BtcFSVRU8sA%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPs4bqEmNH4fg6z2ue%3DWNT3az-Dk5u1N2DR_s5ofeEnkRix6eg%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMJdcY1f%2B0-10RwX3iVVHTaxXyQs1TN%2B2m6C8MU5rPnBxu2S6g%40mail.gmail.com.

Monday, August 19, 2024

Re: Django security releases issued: 5.0.8 and 4.2.15

Thanks 

On Tue, Aug 6, 2024, 3:35 PM Sarah Boyce <sarahboyce@djangoproject.com> wrote:
Details are available on the Django project weblog: 

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN%2BfQHw4mW%3Dvg6arF-bRCU_7Zu6bHMtr%2B8BJFhAgDb20Jt9DBQ%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAaa-ER3y%3DhDV%3D5M8k%2BCdksJXUrLd5adpAva7PVhhe0JUMym%2Bw%40mail.gmail.com.

Sunday, August 18, 2024

Spreading awareness of PEP 752

Hello team! I just wanted to bring to your attention a new PEP about package repository namespaces which I think would greatly benefit the Django community 🙂

We would love your feedback in the current discussion: https://discuss.python.org/t/pep-752-package-repository-namespaces/61227

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ffe56eb6-484d-4535-80c0-6309e66a9b18n%40googlegroups.com.

Re: Seeking Ideas for Enhancing Chat Implementation Similar to WhatsApp

Lemme know the state of your current implementations/project, I can suggest with tips what can be improved and even some other recent features I found in other chat platforms.


On Sun, Aug 18, 2024, 3:29 PM Pandiya rajan <pandiyarajaniosde@gmail.com> wrote:
  Hello everyone, I've been working on some of my own projects and have implemented a chat process similar to WhatsApp. I'm looking for ideas on how to improve or expand this implementation. If you have any suggestions or insights on enhancing chat functionality, scalability, or user experience, I'd greatly appreciate your input. Thank you all, and have a great day  

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05f9848c-1093-4223-9fef-e1acd8a01f33n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALrVfbu-4Qw_7H8ary8NNuQMTEuHpd5bBof4oZbc1s-MdjzSwQ%40mail.gmail.com.

Saturday, August 17, 2024

Re: Multiple Database problem

  To effectively use multiple databases within a single application, start by configuring multiple connection strings or configuration entries for each database. Next, implement a data access layer to handle interactions with the different databases through a unified interface. This layer abstracts the complexity of database operations and provides a consistent way to access data. Use routing logic to direct queries to the appropriate database based on the specific needs of your application. Finally, conduct thorough testing to ensure that all database interactions are functioning correctly and that data integrity is maintained. By following these steps, you can leverage different databases for various purposes while keeping your application organized and efficient  

On Wednesday, August 14, 2024 at 8:46:07 PM UTC+5:30 Dhanushpathi Prakash wrote:
Is there is possible to multiple database with a single app. How?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/00295995-5669-43a0-9c67-03890c583a54n%40googlegroups.com.

Wednesday, August 14, 2024

Re: Multiple Database problem

This is the first Google result for "django multiple databases":


On Wed, 14 Aug 2024 at 23:15, Dhanushpathi Prakash <dhanushpathiprakash@gmail.com> wrote:
Is there is possible to multiple database with a single app. How?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0a3e1f45-e0c0-42f1-a3df-76b50f7675a4n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFKhtoRgWC0NiPxfAkCMJXxqea7Hu5d2wQ52ueoqm2%3D-vorrXw%40mail.gmail.com.

Re: Multiple Database problem



On August 12, 2024 12:06:17 PM CDT, Dhanushpathi Prakash <dhanushpathiprakash@gmail.com> wrote:
Is there is possible to multiple database with a single app. How?

Re: Multiple Database problem

Yes, Its possible.
Please follow this - https://docs.djangoproject.com/en/5.0/topics/db/multi-db/

Thanks
Suraj

On Wed, Aug 14, 2024 at 8:45 PM Dhanushpathi Prakash <dhanushpathiprakash@gmail.com> wrote:
Is there is possible to multiple database with a single app. How?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0a3e1f45-e0c0-42f1-a3df-76b50f7675a4n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAUoqBEKZVLYLC4drqYFMEvrqn0MFyvx%3DT3XPWJcQyVXDCAJzg%40mail.gmail.com.

Monday, August 12, 2024

Multiple Database problem

Is there is possible to multiple database with a single app. How?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0a3e1f45-e0c0-42f1-a3df-76b50f7675a4n%40googlegroups.com.

Friday, August 9, 2024

Re: Django Channels: best way to launch multiple workers

Is there any update on this? Do we have any recommendations now on how many workers can run on a server?

On Tue, Oct 10, 2017 at 5:00 AM Andrew Godwin <andrew@aeracode.org> wrote:
I don't have enough hard data to give a recommendation, unfortunately.

Andrew

On Mon, Oct 9, 2017 at 7:14 PM, Piet van Leeuwen <livandpiet@gmail.com> wrote:
On a server is there a recommendation for how many workers to have running?

With Gunicorn we would run...

def max_workers():      return cpu_count() * 2 + 1



On Thursday, February 9, 2017 at 11:38:07 AM UTC+13, Andrew Godwin wrote:
The difference is mostly in Python performance - threading in Python tends to perform worse than using multiple processes, which is why we recommend using multiple processes in the docs. However, you can save a bit of memory usage with threading, so you can use that if you want.

I would not, however, recommend running more than 2 - 4 threads per process, as otherwise you'll likely see performance take a slide due to the GIL.

Andrew

On Wed, Feb 8, 2017 at 11:53 AM, Charlie DeTar <cha...@gmail.com> wrote:
What's the best way to launch multiple Django channels workers on a production server to take advantage of extra cores?


Each server is single-threaded, so it's recommended you run around one or two per core on each machine; it's safe to run as many concurrent workers on the same machine as you like, as they don't open any ports (all they do is talk to the channel backend).

However, `python manage.py help runworker` lists a "--threads" option, which seems to imply that a single invocation of runworker can launch multiple workers.

Is there a functional difference between `./manage.py runworker --threads 4` and launching `./manage.py runworker` process 4 times?

best,
Charlie

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8097b8f7-3f89-49a6-b189-58a0713972ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/96819d5d-cb83-4e11-af79-3c69b16f8b3b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPuMScqLwABtPFChbzKdG-LydF0XxtDjU-%2B4cZvZuVxCk5LMNw%40mail.gmail.com.

Wednesday, August 7, 2024

Django 5.1 released

Details are available on the Django project weblog:


--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJVoTUtCU-X9dMYJzcKCisNiGdLB6moBR%3D1phwf4LORGT2kb1Q%40mail.gmail.com.

Tuesday, August 6, 2024

Django security releases issued: 5.0.8 and 4.2.15

Details are available on the Django project weblog: 

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN%2BfQHw4mW%3Dvg6arF-bRCU_7Zu6bHMtr%2B8BJFhAgDb20Jt9DBQ%40mail.gmail.com.