Serving static files with whitenoise

2024-05-13 Thread Richlue King
Hi, I'm trying to upload my project to render.com and I need to set up the 
static files with whitenoise. However, when I run collectstatic, I keep 
encountering this error:

Post-processing 'assets\css\bootstrap.min.css' failed!

raise ValueError(
ValueError: The file 'assets/css/bootstrap.min.css.map' could not be found 
with 
Could somebody please help me with this?

-- 
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/75882c41-d554-462a-96f5-d853bc3125a1n%40googlegroups.com.


Re: can someone help me why my static files is not being rendered?

2023-06-17 Thread Mohammad Sadegh
> Yes send message to my account

-- 
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/CALa2QEPLXnwn6bRDWgjYsEC_3kV0qVYh3htN9iyzs%2Brie2XaTA%40mail.gmail.com.


Re: can someone help me why my static files is not being rendered?

2023-06-16 Thread Aspersh Upadhyay
Thanks a lot to Makan Dianka and everyone who replied to my question. Your 
help was greatly appreciated. I was able to solve the problem using Makan 
Dianka's solution. 
On Friday, June 16, 2023 at 9:00:20 AM UTC+5:30 Makan Dianka wrote:

> It is :
>
> STATICFILES_DIRS=[
>  .
> ]
>
> Not :
>
> STATICFILES_DIR=[
>  .
> ]
>
> Just add S in the end of DIR like DIRS and make sur u create static folder 
> in your project root.
>
>
> Le jeu. 15 juin 2023 à 16:52, Ngaga Dancan  a 
> écrit :
>
>> Use load static first before you use extends 
>>
>>
>> On Thu, Jun 15, 2023, 16:52 Prosper Lekia  wrote:
>>
>>> Where is the Python.png located?
>>>
>>> From your code, it should be directly in your static folder not a 
>>> subfolder. So verify your file structure first. If every is in order, 
>>> confirm if whitenoise is installed, and been added to your MiddleWare.
>>>
>>> On Thu, Jun 15, 2023, 14:33 Aspersh Upadhyay  
>>> wrote:
>>>
>>>> my settings.py 
>>>>
>>>> STATIC_URL = 'static/'
>>>>
>>>> STATICFILES_DIR = [
>>>> BASE_DIR / "static"
>>>> ]
>>>>
>>>> Template where I am trying to load static files
>>>>
>>>> {% extends 'base.html' %} 
>>>> {% load static %}
>>>>
>>>> {% block title %} 
>>>>   Issue With Django static files
>>>> {%endblock title %} 
>>>> {% block body %}
>>>> 
>>>>   
>>>> >>> src="{% static 'Python.png' %}">
>>>>   
>>>> 
>>>>
>>>> terminal throwing me 404 see this 
>>>>
>>>> "GET /static/Python.png HTTP/1.1" 404 1789
>>>>
>>>> I hope here I will get my solution for this.
>>>>
>>>> -- 
>>>> 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/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>>> 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/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> -- 
>> 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/CAAzh8pK%3DxH0GTm2MdLi1bwD%3DU8u%3D9z5MEf3os1qBNyVzWKCtvg%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAAzh8pK%3DxH0GTm2MdLi1bwD%3DU8u%3D9z5MEf3os1qBNyVzWKCtvg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/f566de2b-7eca-425a-899d-1615bba77eafn%40googlegroups.com.


Re: can someone help me why my static files is not being rendered?

2023-06-15 Thread Makan Dianka
It is :

STATICFILES_DIRS=[
 .
]

Not :

STATICFILES_DIR=[
 .
]

Just add S in the end of DIR like DIRS and make sur u create static folder
in your project root.


Le jeu. 15 juin 2023 à 16:52, Ngaga Dancan  a
écrit :

> Use load static first before you use extends
>
>
> On Thu, Jun 15, 2023, 16:52 Prosper Lekia  wrote:
>
>> Where is the Python.png located?
>>
>> From your code, it should be directly in your static folder not a
>> subfolder. So verify your file structure first. If every is in order,
>> confirm if whitenoise is installed, and been added to your MiddleWare.
>>
>> On Thu, Jun 15, 2023, 14:33 Aspersh Upadhyay <
>> aspershupadhyay.deityr...@gmail.com> wrote:
>>
>>> my settings.py
>>>
>>> STATIC_URL = 'static/'
>>>
>>> STATICFILES_DIR = [
>>> BASE_DIR / "static"
>>> ]
>>>
>>> Template where I am trying to load static files
>>>
>>> {% extends 'base.html' %}
>>> {% load static %}
>>>
>>> {% block title %}
>>>   Issue With Django static files
>>> {%endblock title %}
>>> {% block body %}
>>> 
>>>   
>>> >> src="{% static 'Python.png' %}">
>>>   
>>> 
>>>
>>> terminal throwing me 404 see this 
>>>
>>> "GET /static/Python.png HTTP/1.1" 404 1789
>>>
>>> I hope here I will get my solution for this.
>>>
>>> --
>>> 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/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAAzh8pK%3DxH0GTm2MdLi1bwD%3DU8u%3D9z5MEf3os1qBNyVzWKCtvg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAzh8pK%3DxH0GTm2MdLi1bwD%3DU8u%3D9z5MEf3os1qBNyVzWKCtvg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CABePkdaZWAUt6hoM2LBD2mGSvO%3D-gLQ77DK2Cf1fSFNzNvzkBw%40mail.gmail.com.


Re: can someone help me why my static files is not being rendered?

2023-06-15 Thread Ngaga Dancan
Use load static first before you use extends


On Thu, Jun 15, 2023, 16:52 Prosper Lekia  wrote:

> Where is the Python.png located?
>
> From your code, it should be directly in your static folder not a
> subfolder. So verify your file structure first. If every is in order,
> confirm if whitenoise is installed, and been added to your MiddleWare.
>
> On Thu, Jun 15, 2023, 14:33 Aspersh Upadhyay <
> aspershupadhyay.deityr...@gmail.com> wrote:
>
>> my settings.py
>>
>> STATIC_URL = 'static/'
>>
>> STATICFILES_DIR = [
>>     BASE_DIR / "static"
>> ]
>>
>> Template where I am trying to load static files
>>
>> {% extends 'base.html' %}
>> {% load static %}
>>
>> {% block title %}
>>   Issue With Django static files
>> {%endblock title %}
>> {% block body %}
>> 
>>   
>> > src="{% static 'Python.png' %}">
>>   
>> 
>>
>> terminal throwing me 404 see this 
>>
>> "GET /static/Python.png HTTP/1.1" 404 1789
>>
>> I hope here I will get my solution for this.
>>
>> --
>> 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/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAAzh8pK%3DxH0GTm2MdLi1bwD%3DU8u%3D9z5MEf3os1qBNyVzWKCtvg%40mail.gmail.com.


Re: can someone help me why my static files is not being rendered?

2023-06-15 Thread ALBERT ASHABA AHEEBWA
According to your settings, the `Python.png` file should be inside `static`
on the same level as `manage.py`.

|---static /
 |-- Python.png
|--manage.py
|--

The file structure of almost that kind. If you're in development and this
is a practice thing, you don't need `whitenoise` just yet.

On Thu, Jun 15, 2023 at 4:53 PM Prosper Lekia 
wrote:

> Where is the Python.png located?
>
> From your code, it should be directly in your static folder not a
> subfolder. So verify your file structure first. If every is in order,
> confirm if whitenoise is installed, and been added to your MiddleWare.
>
> On Thu, Jun 15, 2023, 14:33 Aspersh Upadhyay <
> aspershupadhyay.deityr...@gmail.com> wrote:
>
>> my settings.py
>>
>> STATIC_URL = 'static/'
>>
>> STATICFILES_DIR = [
>>     BASE_DIR / "static"
>> ]
>>
>> Template where I am trying to load static files
>>
>> {% extends 'base.html' %}
>> {% load static %}
>>
>> {% block title %}
>>   Issue With Django static files
>> {%endblock title %}
>> {% block body %}
>> 
>>   
>> > src="{% static 'Python.png' %}">
>>   
>> 
>>
>> terminal throwing me 404 see this 
>>
>> "GET /static/Python.png HTTP/1.1" 404 1789
>>
>> I hope here I will get my solution for this.
>>
>> --
>> 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/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAAQecPcVVGArR8Dq4hE%3DzOStN-itUT9WRGkwfbnsoEhxEfGPJQ%40mail.gmail.com.


Re: can someone help me why my static files is not being rendered?

2023-06-15 Thread Prosper Lekia
Where is the Python.png located?

>From your code, it should be directly in your static folder not a
subfolder. So verify your file structure first. If every is in order,
confirm if whitenoise is installed, and been added to your MiddleWare.

On Thu, Jun 15, 2023, 14:33 Aspersh Upadhyay <
aspershupadhyay.deityr...@gmail.com> wrote:

> my settings.py
>
> STATIC_URL = 'static/'
>
> STATICFILES_DIR = [
> BASE_DIR / "static"
> ]
>
> Template where I am trying to load static files
>
> {% extends 'base.html' %}
> {% load static %}
>
> {% block title %}
>   Issue With Django static files
> {%endblock title %}
> {% block body %}
> 
>   
>  src="{% static 'Python.png' %}">
>   
> 
>
> terminal throwing me 404 see this 
>
> "GET /static/Python.png HTTP/1.1" 404 1789
>
> I hope here I will get my solution for this.
>
> --
> 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/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


can someone help me why my static files is not being rendered?

2023-06-15 Thread Aspersh Upadhyay
my settings.py 

STATIC_URL = 'static/'

STATICFILES_DIR = [
BASE_DIR / "static"
]

Template where I am trying to load static files

{% extends 'base.html' %} 
{% load static %}

{% block title %} 
  Issue With Django static files
{%endblock title %} 
{% block body %}

  

  


terminal throwing me 404 see this 

"GET /static/Python.png HTTP/1.1" 404 1789

I hope here I will get my solution for this.

-- 
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/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com.


Re: UPLOAD STATIC FILES

2023-05-30 Thread Colin Ado
1. Create a folder called static, and inside the static folder create
another folder
2. Go to settings.py AND add this:
STATIC_URL = 'static/'

STATICFILES_DIRS = [
BASE_DIR / 'static'
]
3. Go to your .html file and like the .css file using:


On Mon, 29 May 2023 at 18:31, Obiorah Callistus  wrote:

> please how can i display .css and .js files in my template
>
> --
> 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/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%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/CAKHUQ0TB%2BO4NkzgXTzopa%3DNUrYGTAa7g6vw6aW3%3DSvpi9UGZBg%40mail.gmail.com.


Re: UPLOAD STATIC FILES

2023-05-30 Thread DieHardMan 300
settings.py
- add following line if not exist
--
STATIC_URL = 'static/'

in your static folder ---> project_name/app_name/static/app_name/
* I recommend create another folder in your static folder with your app 
name to avoid duplicate static file name with other apps
* Also I recommend create "new folder" name "css" and "js"
--> project_name/app_name/static/app_name/css
--> project_name/app_name/static/app_name/js

now on top of your "template" html file add following line:
* note that you must add this line for every template you using static 
or "extends" from template that use static

{% load static %}


how to import css


or
hello, world


how to import javascript




in django tutorial --> 
https://docs.djangoproject.com/en/4.2/intro/tutorial06/
and documentation for this --> 
https://docs.djangoproject.com/en/4.2/howto/static-files/

ในวันที่ วันจันทร์ที่ 29 พฤษภาคม ค.ศ. 2023 เวลา 22 นาฬิกา 31 นาที 33 วินาที 
UTC+7 Obiorah Callistus เขียนว่า:

> please how can i display .css and .js files in my template

-- 
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/b8de72ab-fc82-4a44-9354-84d3f3890e73n%40googlegroups.com.


Re: UPLOAD STATIC FILES

2023-05-30 Thread DieHardMan 300
settings.py
- add following line if not exist
--
STATIC_URL = 'static/'

in your static folder ---> project_name/app_name/static/app_name/
* I recommend create another folder in your static folder with your app 
name to avoid duplicate static file name with other apps
* Also I recommend create "new folder" name "css" and "js"
--> project_name/app_name/static/app_name/css
--> project_name/app_name/static/app_name/js

now on top of your "template" html file add following line:
* note that you must add this line for every template you using static 
or "extends" from template that use static

{% load static %}


how to import css


or
hello, world


how to import javascript




in django tutorial --> 
https://docs.djangoproject.com/en/4.2/intro/tutorial06/
and documentation for this 
--> https://docs.djangoproject.com/en/4.2/howto/static-files/

ในวันที่ วันจันทร์ที่ 29 พฤษภาคม ค.ศ. 2023 เวลา 22 นาฬิกา 31 นาที 33 วินาที 
UTC+7 Obiorah Callistus เขียนว่า:

please how can i display .css and .js files in my template 

-- 
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/16f24801-c43d-4381-9d96-3ee1885a07b5n%40googlegroups.com.


Re: UPLOAD STATIC FILES

2023-05-29 Thread Music Fm
Not necessary again

On Tue, May 30, 2023, 5:05 AM SHUBHAM KUMAR 
wrote:

> you should add STATIC_DIR =[
>
> 'BASE'/ 'static'
>
> ]
> to your project settings
>
> On Mon, 29 May, 2023, 9:21 pm Music Fm,  wrote:
>
>> Load static
>>
>> Open a folder call it static then open another file within the static
>> forder.
>>
>> Now type {load static/custom.css }on the html file it will see the static
>> that has the css and javascript file
>>
>> On Mon, May 29, 2023, 4:31 PM Obiorah Callistus 
>> wrote:
>>
>>> please how can i display .css and .js files in my template
>>>
>>> --
>>> 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/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%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/CAEXS5w%2B5m5ASCFR0YL%3Dt7CPWk%3DM__UVtTtHfLyJ1xcBZzFaEXw%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/CAA8iRFd7-sv1c4oPmP9Xt99aRzUVSUw4p8Via8nBN4wOLwoHbw%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/CAEXS5wKe0o5JdGT2YDwy4DnDXAhZ%3DYq6HQ6Adk%2Bv3MecoyzNiw%40mail.gmail.com.


Re: UPLOAD STATIC FILES

2023-05-29 Thread sum abiut
in your setting make sure you have
STATIC_URL = '/static/'

then in your template
you load static at the top of your htmi file like this.
{% load static %}
to load any static files like css. do something like this
{% static './cssfile.css'%}

Then run the command. python manage.py collectstatic


On Tue, May 30, 2023 at 3:05 PM SHUBHAM KUMAR 
wrote:

> you should add STATIC_DIR =[
>
> 'BASE'/ 'static'
>
> ]
> to your project settings
>
> On Mon, 29 May, 2023, 9:21 pm Music Fm,  wrote:
>
>> Load static
>>
>> Open a folder call it static then open another file within the static
>> forder.
>>
>> Now type {load static/custom.css }on the html file it will see the static
>> that has the css and javascript file
>>
>> On Mon, May 29, 2023, 4:31 PM Obiorah Callistus 
>> wrote:
>>
>>> please how can i display .css and .js files in my template
>>>
>>> --
>>> 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/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CAEXS5w%2B5m5ASCFR0YL%3Dt7CPWk%3DM__UVtTtHfLyJ1xcBZzFaEXw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAEXS5w%2B5m5ASCFR0YL%3Dt7CPWk%3DM__UVtTtHfLyJ1xcBZzFaEXw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAA8iRFd7-sv1c4oPmP9Xt99aRzUVSUw4p8Via8nBN4wOLwoHbw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA8iRFd7-sv1c4oPmP9Xt99aRzUVSUw4p8Via8nBN4wOLwoHbw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAPCf-y5z2HzLXNn6BJZf%2BeDDBJvrDRmyjQweEFkhFEcrDH%3D3fg%40mail.gmail.com.


Re: UPLOAD STATIC FILES

2023-05-29 Thread SHUBHAM KUMAR
you should add STATIC_DIR =[

'BASE'/ 'static'

]
to your project settings

On Mon, 29 May, 2023, 9:21 pm Music Fm,  wrote:

> Load static
>
> Open a folder call it static then open another file within the static
> forder.
>
> Now type {load static/custom.css }on the html file it will see the static
> that has the css and javascript file
>
> On Mon, May 29, 2023, 4:31 PM Obiorah Callistus 
> wrote:
>
>> please how can i display .css and .js files in my template
>>
>> --
>> 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/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%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/CAEXS5w%2B5m5ASCFR0YL%3Dt7CPWk%3DM__UVtTtHfLyJ1xcBZzFaEXw%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/CAA8iRFd7-sv1c4oPmP9Xt99aRzUVSUw4p8Via8nBN4wOLwoHbw%40mail.gmail.com.


Re: UPLOAD STATIC FILES

2023-05-29 Thread 'Kasper Laudrup' via Django users

On 29/05/2023 04.24, Obiorah Callistus wrote:

please how can i display .css and .js files in my template



Have you considered reading the documentation?

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/ce267e59-2518-f897-d1b4-be148feaef98%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: UPLOAD STATIC FILES

2023-05-29 Thread Music Fm
Load static

Open a folder call it static then open another file within the static
forder.

Now type {load static/custom.css }on the html file it will see the static
that has the css and javascript file

On Mon, May 29, 2023, 4:31 PM Obiorah Callistus  wrote:

> please how can i display .css and .js files in my template
>
> --
> 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/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%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/CAEXS5w%2B5m5ASCFR0YL%3Dt7CPWk%3DM__UVtTtHfLyJ1xcBZzFaEXw%40mail.gmail.com.


UPLOAD STATIC FILES

2023-05-29 Thread Obiorah Callistus
please how can i display .css and .js files in my template

-- 
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/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%40googlegroups.com.


Re: How to show image(static) files.

2023-05-02 Thread Byansi Samuel
Your code is not wrong but just add "url" after static. Then it will work

On Tue, May 2, 2023, 5:44 PM William Nash (Bill)  wrote:

> Try this.  I'm still learning myself
>
> In your HTML file, you can use the img tag to display the image.
>
> 
>
> To check if the QR code is true or false, you can use Django's views.py
> file. In your views.py file, write a function that will check the validity
> of the QR code. The function should redirect the user to the next page if
> the QR code is valid. The function should return an error message if the QR
> code is invalid.
>
> from django.shortcuts import render, redirect
>
> def scan_qr_code(request):
> if qr_code_is_valid:
> return redirect('next_page')
> else:
> error_message = 'Invalid QR code'
> return render(request, 'error.html', {'error_message':
> error_message})
> On Tuesday, May 2, 2023 at 9:19:15 AM UTC-5 Edit Sensei wrote:
>
>> How to show image(static) files in django HTML
>> Actually i was created scan QRcode . I want to show QRcode. If it code is
>> true then next page..
>> Else code false then error...
>>
> --
> 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/7ad0255d-34d4-466c-aef2-2eb73f98186dn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7ad0255d-34d4-466c-aef2-2eb73f98186dn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAGQoQ3zZKbt%2BXCsN%3Dg-HkfQz_A6uxeswVua8EGZWxvQ-04-ttg%40mail.gmail.com.


Re: How to show image(static) files.

2023-05-02 Thread William Nash (Bill)
Try this.  I'm still learning myself

In your HTML file, you can use the img tag to display the image. 



To check if the QR code is true or false, you can use Django's views.py 
file. In your views.py file, write a function that will check the validity 
of the QR code. The function should redirect the user to the next page if 
the QR code is valid. The function should return an error message if the QR 
code is invalid. 

from django.shortcuts import render, redirect

def scan_qr_code(request):
if qr_code_is_valid:
return redirect('next_page')
else:
error_message = 'Invalid QR code'
return render(request, 'error.html', {'error_message': 
error_message})
On Tuesday, May 2, 2023 at 9:19:15 AM UTC-5 Edit Sensei wrote:

> How to show image(static) files in django HTML 
> Actually i was created scan QRcode . I want to show QRcode. If it code is 
> true then next page..
> Else code false then error...
>

-- 
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/7ad0255d-34d4-466c-aef2-2eb73f98186dn%40googlegroups.com.


How to show image(static) files.

2023-05-02 Thread Edit Sensei
How to show image(static) files in django HTML
Actually i was created scan QRcode . I want to show QRcode. If it code is
true then next page..
Else code false then error...

-- 
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/CANep68tVT3E%3DoRikKR1-fKaiRAVYzJ5HWsKSoL6xVL%2BjoYhG4Q%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
>>>> <https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> 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
>>> <https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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
>> <https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.g

Re: Serving static files in production

2023-04-26 Thread Brian Odhiambo
@Prosper,
I installed whitenoise at some point, but later removed its configuration.

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
>>> <https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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
>> <https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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
> <https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAPjQKqaN8dHhw7OoYsBCXxycKo7qgAFkAWHT0o%3DRYMvauPL%3DtA%40mail.gmail.com.


Re: Serving static files in production

2023-04-26 Thread Brian Odhiambo
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
>>> <https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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
>> <https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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
> <https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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.


Re: Serving static files in production

2023-04-26 Thread Prosper Lekia
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 
> 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
>> <https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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
> <https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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.


Re: Serving static files in production

2023-04-26 Thread David Nugent
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 
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
> <https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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.


Serving static files in production

2023-04-26 Thread Brian Odhiambo
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.


Re: static files

2023-03-12 Thread Sandip Bhattacharya
Static files outside apps are not served by default. Have you added the main 
directory static directory to settings yet?

https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-STATICFILES_DIRS

Something like this is typically done in project settings:

STATICFILES_DIRS = [BASE_DIR / "static"]

- Sandip

> On Mar 10, 2023, at 1:29 PM, Usra Saeed  wrote:
> 
> Hi,  I am uing django 3.2. My template and static folder are in the main 
> directory.  But my static files are not loading.
> I have one app. In this I have one template name "signin.html". I am using 
> {% extends "base.html" %}
> {% load static %}
> {% block content %}
>  Hello World 
> 
> {% endblock  %}
> 
> In main directory template folder I have base.html . 
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/759ee88b-13f6-457b-8abf-1212b30b6628n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/759ee88b-13f6-457b-8abf-1212b30b6628n%40googlegroups.com?utm_medium=email_source=footer>.
> 

-- 
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/7E012138-5A5A-41D2-A82F-E20D302C50B2%40showmethesource.org.


Re: static files

2023-03-10 Thread André Hangalo
Show your settings file configuration!

On Fri, 10/03/2023 at 22:14 Usra Saeed  wrote:

> Hi,  I am uing django 3.2. My template and static folder are in the main
> directory.  But my static files are not loading.
> I have one app. In this I have one template name "signin.html". I am using
> {% extends "base.html" %}
> {% load static %}
> {% block content %}
>  Hello World 
>
> {% endblock %}
>
> In main directory template folder I have base.html .
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/759ee88b-13f6-457b-8abf-1212b30b6628n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/759ee88b-13f6-457b-8abf-1212b30b6628n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
-- 
RICK DEU

-- 
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/CACQ9QcF-AfLAV1ZoMDXWyuT2-WYjtWShc0U8quw84NSUKbRg%3Dw%40mail.gmail.com.


Re: Serving Media and Static files on Shared Hosting

2023-01-13 Thread Namanya Daniel
Have you done it before? You can share knowledge

On Fri, 13 Jan 2023 at 15:25, Jeff Kingsley 
wrote:

> Why
>
> On Fri, Jan 13, 2023 at 11:56 AM Namanya Daniel 
> wrote:
>
>> Hello members,
>>
>> Has anyone ever used Namecheap shared hosting to serve static and media
>> files? Apparently nginx can't be used, i only have WhiteNoise which serves
>> static files only.
>>
>> kindly  share you've done it before.. thanks 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/44a6e29d-65f1-443f-94d4-c9d119abbf77n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/44a6e29d-65f1-443f-94d4-c9d119abbf77n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAA9WjmFd%3DC-eOv%3DeKw5%3DKg7JMCPLiFs%3DwNv0zU07_vDMw59woQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA9WjmFd%3DC-eOv%3DeKw5%3DKg7JMCPLiFs%3DwNv0zU07_vDMw59woQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAP4VW2V%2BWjeyakDn%2BSrpywpJ7BnQi5WwWVwfHQ32_dyEsM9qhA%40mail.gmail.com.


Re: Serving Media and Static files on Shared Hosting

2023-01-13 Thread Jeff Kingsley
Why

On Fri, Jan 13, 2023 at 11:56 AM Namanya Daniel 
wrote:

> Hello members,
>
> Has anyone ever used Namecheap shared hosting to serve static and media
> files? Apparently nginx can't be used, i only have WhiteNoise which serves
> static files only.
>
> kindly  share you've done it before.. thanks 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/44a6e29d-65f1-443f-94d4-c9d119abbf77n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/44a6e29d-65f1-443f-94d4-c9d119abbf77n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAA9WjmFd%3DC-eOv%3DeKw5%3DKg7JMCPLiFs%3DwNv0zU07_vDMw59woQ%40mail.gmail.com.


Serving Media and Static files on Shared Hosting

2023-01-13 Thread Namanya Daniel
Hello members, 

Has anyone ever used Namecheap shared hosting to serve static and media 
files? Apparently nginx can't be used, i only have WhiteNoise which serves 
static files only.

kindly  share you've done it before.. thanks 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/44a6e29d-65f1-443f-94d4-c9d119abbf77n%40googlegroups.com.


Re: Static files is not loading while deploying the project to AWS ec2

2022-11-08 Thread Nishant Sagar
Thank you everyone for the help, it solved the issue

On Sun, 6 Nov 2022 at 8:43 AM, Malcolm MacKinnon 
wrote:

> Using elastic beanstalk, I run the command manage.py collectstatic in a
> .config file during deployment. The config file is located in the  
> .ebextensions
> folder.
>
> In settings.py
> STATIC_URL = '/static/' STATIC_ROOT = 'static'
>
>
> https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
>
>
>
>
> On Sat, Nov 5, 2022 at 7:15 PM David Nugent  wrote:
>
>> An article I wrote on this topic last year for fellow developers at work
>> who were similarly confused.
>>
>> HTH!
>>
>> *Django - Statically Confusing*
>>
>> I started learning Django several years ago (and am still doing so
>> today!), and for some time had a real sense of confusion as to how static
>> files worked.  Sure, I learned the easy aspects of this pretty quickly,
>> that the collectstatic management command¹ would magically pull all of
>> the static files out of my project and dump them into some other place,
>> where - in the theoretical production model - they would be served by
>> something other than Django. Indeed, I understood this and routinely served
>> static and media content via Nginx or apache directly.
>>
>>
>> What was often a source of confusion was the magic that made it all
>> happen in Django's settings module. Early in my days with Django, I
>> wondered why files weren't being served as I thought they should - do I
>> need to collectstatic in development or not? The confusion increased
>> when third-party apps produced or processed static content, and there were
>> times when you absolutely did have to run collectstatic to make these
>> files available to the runserver during development. Most other static
>> files did not seem to require this.
>>
>> *Settings*
>>
>> The handling of static content is controlled by a handful of settings,
>> and it is important to be clear about what each setting does. Any confusion
>> simply boils down to not completely understanding these settings and their
>> effect.
>>
>>
>> The following table details each one and is followed by a brief summary
>> of how they interact and under which circumstances they are important.
>>
>>
>> *STATICFILES_FINDERS*
>>
>>
>>- This is a list of fully qualified classes implementing the Finder
>>pattern (see below).
>>
>> *STATICFILES_DIRS*
>>
>>
>>- This is a list of paths searched for static files (only) by the
>>FilesystemFinder.
>>
>> *STATIC_URL*
>>
>>
>>- This is the url prefix that causes - if enabled - routing of
>>requests to the static files handler, and it only becomes active if
>>configured in your urls.py.
>>That's all it does. Really.
>>Please don't* confuse this with anything else*.
>>
>> *STATIC_ROOT*
>>
>>
>>- This setting determines the target of the collectstatic command.
>>It is (usually) not useful during development, only at deployment.
>>
>>
>> *Static Files Finders*
>>
>> Static file *Finders* are the core of Django's static file handling. By
>> default, the STATICFILES_FINDERS list consists of the FilesystemFinder
>> and AppDirectoriesFinder.  The first handles static content from paths
>> defined in the STATICFILES_DIRS list (which is empty by default), and
>> the second serves static content from installed apps that contain a
>> static directory.
>>
>>
>> During development, these Finders handle (or should, some third-party
>> ones do not!) serving static content via Django. In production, they are
>> only used to gather the static content and place it into the STATIC_ROOT
>> where it may be served by your front end of choice (Nginx, Apache etc.).
>>
>>
>> The Finder pattern supports two primary methods.
>>
>>
>> • The find() method returns one or more matches against a provided path.
>> This is what the static files handler uses to match url paths requested
>> after stripping the STATIC_URL prefix. If a Finder returns an empty list,
>> no match was found. In this scenario, the all parameter is False, and
>> the function - if successful - returns a single absolute path.
>>
>> • The list() method returns a list of all static files it knows about,
>> along with the storage associated with each file. The FilesystemFinder
>> associates one storage for each path in STATICFILES_DIRS and the
>> AppDirectoriesFinder allocate

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-07 Thread James
It sounds like nginx doesn't know where your static files are being served 
from. If you don't want to bother with NGINX you can use Whitenoise.

Django doesn't serve staticfiles in production; something that isn't overly 
apparent. You still need something like apache or nginx or whitenoise to 
serve static files in production.

On Saturday, November 5, 2022 at 1:35:31 AM UTC-6 nishan...@gmail.com wrote:

> Hi all,
>
> I deployed the django project to AWS ec2 instance using nginx and gunicorn 
> but the static file is not loading at all.
>
> Can someone suggest where did I do wrong?
>
> Note - I've not created Profile before deploying 
>
> Here is my settings.py file
> STATIC_URL = 'static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
> STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
>
> Project URl - http://54.242.38.208/
> Github- https://github.com/Nishant-Sagar/BaskinSolar
>
> Thank you for your help,
> Nishant
>
>
>
>
>
>
>
>

-- 
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/b2af5c41-3202-4bd4-b195-777a80f144e1n%40googlegroups.com.


Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Malcolm MacKinnon
Using elastic beanstalk, I run the command manage.py collectstatic in a
.config file during deployment. The config file is located in the
.ebextensions
folder.

In settings.py
STATIC_URL = '/static/' STATIC_ROOT = 'static'

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html




On Sat, Nov 5, 2022 at 7:15 PM David Nugent  wrote:

> An article I wrote on this topic last year for fellow developers at work
> who were similarly confused.
>
> HTH!
>
> *Django - Statically Confusing*
>
> I started learning Django several years ago (and am still doing so
> today!), and for some time had a real sense of confusion as to how static
> files worked.  Sure, I learned the easy aspects of this pretty quickly,
> that the collectstatic management command¹ would magically pull all of
> the static files out of my project and dump them into some other place,
> where - in the theoretical production model - they would be served by
> something other than Django. Indeed, I understood this and routinely served
> static and media content via Nginx or apache directly.
>
>
> What was often a source of confusion was the magic that made it all happen
> in Django's settings module. Early in my days with Django, I wondered why
> files weren't being served as I thought they should - do I need to
> collectstatic in development or not? The confusion increased when
> third-party apps produced or processed static content, and there were times
> when you absolutely did have to run collectstatic to make these files
> available to the runserver during development. Most other static files did
> not seem to require this.
>
> *Settings*
>
> The handling of static content is controlled by a handful of settings, and
> it is important to be clear about what each setting does. Any confusion
> simply boils down to not completely understanding these settings and their
> effect.
>
>
> The following table details each one and is followed by a brief summary of
> how they interact and under which circumstances they are important.
>
>
> *STATICFILES_FINDERS*
>
>
>- This is a list of fully qualified classes implementing the Finder
>pattern (see below).
>
> *STATICFILES_DIRS*
>
>
>- This is a list of paths searched for static files (only) by the
>FilesystemFinder.
>
> *STATIC_URL*
>
>
>- This is the url prefix that causes - if enabled - routing of
>requests to the static files handler, and it only becomes active if
>configured in your urls.py.
>That's all it does. Really.
>Please don't* confuse this with anything else*.
>
> *STATIC_ROOT*
>
>
>- This setting determines the target of the collectstatic command.
>It is (usually) not useful during development, only at deployment.
>
>
> *Static Files Finders*
>
> Static file *Finders* are the core of Django's static file handling. By
> default, the STATICFILES_FINDERS list consists of the FilesystemFinder
> and AppDirectoriesFinder.  The first handles static content from paths
> defined in the STATICFILES_DIRS list (which is empty by default), and the
> second serves static content from installed apps that contain a static
> directory.
>
>
> During development, these Finders handle (or should, some third-party
> ones do not!) serving static content via Django. In production, they are
> only used to gather the static content and place it into the STATIC_ROOT
> where it may be served by your front end of choice (Nginx, Apache etc.).
>
>
> The Finder pattern supports two primary methods.
>
>
> • The find() method returns one or more matches against a provided path.
> This is what the static files handler uses to match url paths requested
> after stripping the STATIC_URL prefix. If a Finder returns an empty list,
> no match was found. In this scenario, the all parameter is False, and the
> function - if successful - returns a single absolute path.
>
> • The list() method returns a list of all static files it knows about,
> along with the storage associated with each file. The FilesystemFinder
> associates one storage for each path in STATICFILES_DIRS and the
> AppDirectoriesFinder allocates one storage for each app with a static
> folder.
>
> • Access to the files returned is done via the storage object which
> contains all of the methods required to access static files within its
> domain.
>
>
> ¹ a management command in Django is issued after invoking the ./manage.py
> script from the application root directory.
>
> On Sun, Nov 6, 2022 at 11:03 AM led zee  wrote:
>
>> As a recent Django new user I was having a lot of trouble with static
>> files as well. Basically couldn't get Admin CSS to work.
>>
>

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread David Nugent
An article I wrote on this topic last year for fellow developers at work
who were similarly confused.

HTH!

*Django - Statically Confusing*

I started learning Django several years ago (and am still doing so today!),
and for some time had a real sense of confusion as to how static files
worked.  Sure, I learned the easy aspects of this pretty quickly, that the
collectstatic management command¹ would magically pull all of the static
files out of my project and dump them into some other place, where - in the
theoretical production model - they would be served by something other than
Django. Indeed, I understood this and routinely served static and media
content via Nginx or apache directly.


What was often a source of confusion was the magic that made it all happen
in Django's settings module. Early in my days with Django, I wondered why
files weren't being served as I thought they should - do I need to
collectstatic in development or not? The confusion increased when
third-party apps produced or processed static content, and there were times
when you absolutely did have to run collectstatic to make these files
available to the runserver during development. Most other static files did
not seem to require this.

*Settings*

The handling of static content is controlled by a handful of settings, and
it is important to be clear about what each setting does. Any confusion
simply boils down to not completely understanding these settings and their
effect.


The following table details each one and is followed by a brief summary of
how they interact and under which circumstances they are important.


*STATICFILES_FINDERS*


   - This is a list of fully qualified classes implementing the Finder
   pattern (see below).

*STATICFILES_DIRS*


   - This is a list of paths searched for static files (only) by the
   FilesystemFinder.

*STATIC_URL*


   - This is the url prefix that causes - if enabled - routing of requests
   to the static files handler, and it only becomes active if configured in
   your urls.py.
   That's all it does. Really.
   Please don't* confuse this with anything else*.

*STATIC_ROOT*


   - This setting determines the target of the collectstatic command.
   It is (usually) not useful during development, only at deployment.


*Static Files Finders*

Static file *Finders* are the core of Django's static file handling. By
default, the STATICFILES_FINDERS list consists of the FilesystemFinder and
AppDirectoriesFinder.  The first handles static content from paths defined
in the STATICFILES_DIRS list (which is empty by default), and the second
serves static content from installed apps that contain a static directory.


During development, these Finders handle (or should, some third-party ones
do not!) serving static content via Django. In production, they are only
used to gather the static content and place it into the STATIC_ROOT where
it may be served by your front end of choice (Nginx, Apache etc.).


The Finder pattern supports two primary methods.


• The find() method returns one or more matches against a provided path.
This is what the static files handler uses to match url paths requested
after stripping the STATIC_URL prefix. If a Finder returns an empty list,
no match was found. In this scenario, the all parameter is False, and the
function - if successful - returns a single absolute path.

• The list() method returns a list of all static files it knows about,
along with the storage associated with each file. The FilesystemFinder
associates one storage for each path in STATICFILES_DIRS and the
AppDirectoriesFinder allocates one storage for each app with a static
folder.

• Access to the files returned is done via the storage object which
contains all of the methods required to access static files within its
domain.


¹ a management command in Django is issued after invoking the ./manage.py
script from the application root directory.

On Sun, Nov 6, 2022 at 11:03 AM led zee  wrote:

> As a recent Django new user I was having a lot of trouble with static
> files as well. Basically couldn't get Admin CSS to work.
>
> We are using whitenoise now. Apparently that is helping solve the problem.
>
> On Saturday, November 5, 2022 at 12:35:31 AM UTC-7 nishan...@gmail.com
> wrote:
>
>> Hi all,
>>
>> I deployed the django project to AWS ec2 instance using nginx and
>> gunicorn but the static file is not loading at all.
>>
>> Can someone suggest where did I do wrong?
>>
>> Note - I've not created Profile before deploying
>>
>> Here is my settings.py file
>> STATIC_URL = 'static/'
>> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
>> STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
>>
>> Project URl - http://54.242.38.208/
>> Github- https://github.com/Nishant-Sagar/BaskinSolar
>>
>> Thank you for your help,
>> Nishant
>>
>>
>>
>>
>

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread led zee
As a recent Django new user I was having a lot of trouble with static files 
as well. Basically couldn't get Admin CSS to work.

We are using whitenoise now. Apparently that is helping solve the problem.

On Saturday, November 5, 2022 at 12:35:31 AM UTC-7 nishan...@gmail.com 
wrote:

> Hi all,
>
> I deployed the django project to AWS ec2 instance using nginx and gunicorn 
> but the static file is not loading at all.
>
> Can someone suggest where did I do wrong?
>
> Note - I've not created Profile before deploying 
>
> Here is my settings.py file
> STATIC_URL = 'static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
> STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
>
> Project URl - http://54.242.38.208/
> Github- https://github.com/Nishant-Sagar/BaskinSolar
>
> Thank you for your help,
> Nishant
>
>
>
>
>
>
>
>

-- 
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/899a8d1e-8c21-444b-9c9f-215c2a6cd6e8n%40googlegroups.com.


Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Lakshyaraj Dash
You can use sebuckets to store your static files...

On Sat, Nov 5, 2022, 13:04 Nishant Sagar  wrote:

> Hi all,
>
> I deployed the django project to AWS ec2 instance using nginx and gunicorn
> but the static file is not loading at all.
>
> Can someone suggest where did I do wrong?
>
> Note - I've not created Profile before deploying
>
> Here is my settings.py file
> STATIC_URL = 'static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
> STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
>
> Project URl - http://54.242.38.208/
> Github- https://github.com/Nishant-Sagar/BaskinSolar
>
> Thank you for your help,
> Nishant
>
>
>
>
>
>
>
> --
> 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/CANNtL-K_ntgKNAYUd8DHe8wa4bGwHO5da%3DypJfAVN%3DJHj9uCmQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANNtL-K_ntgKNAYUd8DHe8wa4bGwHO5da%3DypJfAVN%3DJHj9uCmQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAF7qQgBT4hWxcQOdpL61c7yhEMS7k1h-O%2B0WVecs6yu7aEVZ0w%40mail.gmail.com.


Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Ashutosh Mishra
I had faced same problem but collectstatic worked for me,,

On Sat, 5 Nov, 2022, 1:15 pm Nishant Sagar,  wrote:

> Hi Ashutosh,
>
> Yeah I tried that as well, still not working.
>
> On Sat, 5 Nov 2022 at 1:10 PM, Ashutosh Mishra <
> ashutoshmishra...@gmail.com> wrote:
>
>> Did you tried, python manage.py collectstatic?
>>
>> On Sat, 5 Nov, 2022, 1:05 pm Nishant Sagar, 
>> wrote:
>>
>>> Hi all,
>>>
>>> I deployed the django project to AWS ec2 instance using nginx and
>>> gunicorn but the static file is not loading at all.
>>>
>>> Can someone suggest where did I do wrong?
>>>
>>> Note - I've not created Profile before deploying
>>>
>>> Here is my settings.py file
>>> STATIC_URL = 'static/'
>>> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
>>> STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
>>>
>>> Project URl - http://54.242.38.208/
>>> Github- https://github.com/Nishant-Sagar/BaskinSolar
>>>
>>> Thank you for your help,
>>> Nishant
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> 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/CANNtL-K_ntgKNAYUd8DHe8wa4bGwHO5da%3DypJfAVN%3DJHj9uCmQ%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/CAGDmY64P1vrziiG_%3DX0pMb3YS%2BWv2BqZLLkix2gY%2B4cL3YRsEA%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/CANNtL-J6HWZ%3DPk7iYx4nxk%2BYZ_9HXSMQY2kt-FiBa6fDQz2vrA%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/CAGDmY66usVHG3O7VOU%2B4b%3Dr6TrKRZVNe1RM5ZEOjBAciZs8biw%40mail.gmail.com.


Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Nishant Sagar
Hi Ashutosh,

Yeah I tried that as well, still not working.

On Sat, 5 Nov 2022 at 1:10 PM, Ashutosh Mishra 
wrote:

> Did you tried, python manage.py collectstatic?
>
> On Sat, 5 Nov, 2022, 1:05 pm Nishant Sagar, 
> wrote:
>
>> Hi all,
>>
>> I deployed the django project to AWS ec2 instance using nginx and
>> gunicorn but the static file is not loading at all.
>>
>> Can someone suggest where did I do wrong?
>>
>> Note - I've not created Profile before deploying
>>
>> Here is my settings.py file
>> STATIC_URL = 'static/'
>> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
>> STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
>>
>> Project URl - http://54.242.38.208/
>> Github- https://github.com/Nishant-Sagar/BaskinSolar
>>
>> Thank you for your help,
>> Nishant
>>
>>
>>
>>
>>
>>
>>
>> --
>> 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/CANNtL-K_ntgKNAYUd8DHe8wa4bGwHO5da%3DypJfAVN%3DJHj9uCmQ%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/CAGDmY64P1vrziiG_%3DX0pMb3YS%2BWv2BqZLLkix2gY%2B4cL3YRsEA%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/CANNtL-J6HWZ%3DPk7iYx4nxk%2BYZ_9HXSMQY2kt-FiBa6fDQz2vrA%40mail.gmail.com.


Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Ashutosh Mishra
Did you tried, python manage.py collectstatic?

On Sat, 5 Nov, 2022, 1:05 pm Nishant Sagar,  wrote:

> Hi all,
>
> I deployed the django project to AWS ec2 instance using nginx and gunicorn
> but the static file is not loading at all.
>
> Can someone suggest where did I do wrong?
>
> Note - I've not created Profile before deploying
>
> Here is my settings.py file
> STATIC_URL = 'static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
> STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
>
> Project URl - http://54.242.38.208/
> Github- https://github.com/Nishant-Sagar/BaskinSolar
>
> Thank you for your help,
> Nishant
>
>
>
>
>
>
>
> --
> 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/CANNtL-K_ntgKNAYUd8DHe8wa4bGwHO5da%3DypJfAVN%3DJHj9uCmQ%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/CAGDmY64P1vrziiG_%3DX0pMb3YS%2BWv2BqZLLkix2gY%2B4cL3YRsEA%40mail.gmail.com.


Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Nishant Sagar
Hi all,

I deployed the django project to AWS ec2 instance using nginx and gunicorn
but the static file is not loading at all.

Can someone suggest where did I do wrong?

Note - I've not created Profile before deploying

Here is my settings.py file
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)

Project URl - http://54.242.38.208/
Github- https://github.com/Nishant-Sagar/BaskinSolar

Thank you for your help,
Nishant

-- 
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/CANNtL-K_ntgKNAYUd8DHe8wa4bGwHO5da%3DypJfAVN%3DJHj9uCmQ%40mail.gmail.com.


RE: Static files not found

2022-02-13 Thread Feroz Ahmed
if 

staticfiles folder not exists in project,

 

in that case you have to create folder name as staticfiles in project level

 

 

 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Dev femibadmus
Sent: 14 February 2022 02:43
To: django-users@googlegroups.com
Subject: Re: Static files not found

 

U need to provide ur static Files dir

 

Using os.path.join(BASR_DIR, "staticfiles")

 

Also if u storing ur static file to cloud or any other host present ur 
STATICFILES_STORAGE="https://domain.com/location/folder;

 

On Sun, Feb 13, 2022, 18:47 Serge Alard  wrote:

To  Ogunsanya Opeyemi : my Django app folder is bridge, thus it's OK

To dashlaksh...@gmail.com : I tried but the static files are not found

To  mminu...@gmail.com :  STATICFILES_DIRS = [BASE_DIR/""] is not necessary because it's given already in static_root.

Thank you everybody but it does not work yet.

 

Serge Alard

 

Le jeudi 3 février 2022 à 20:21:30 UTC+1, mminu...@gmail.com a écrit :

At the bottom of your code, you need to include the STATICFILES_DIRS = 
[BASE_DIR/""].

This tells django where your static files are

 

On Thu, Feb 3, 2022, 18:49 Opeyemi Ogunsanya  wrote:

Move the static folder to the Django app folder

 

On Thu, Feb 3, 2022, 6:01 PM Serge Alard  wrote:

Thank you for the suggestion but it does not work.

I add 2 things to make easier your helps :

*   the settings and wsgi files are in /www/Web_bridge/ Web_bridge/
*   the static files are in /www/Web_bridge/static/bridge/

Below an example of connexion.html that calls a static file :

 

{% extends "bridge/sous_base.html" %}

{% block content %}
{% if error_message %}{{ error_message }}{% endif %}
Connexion

{% csrf_token %}

Pseudonyme : 


Mot de passe : 



Mot de 
passe oublié





{% endblock %}

{% block script %}
{% load static %}
{{ block.super }}

{% endblock %}

 

Thank you in advance for your suggestions.

 

Le jeudi 3 février 2022 à 16:33:10 UTC+1, dashlaksh...@gmail.com a écrit :

Please add this line below static_url

 

STATICFILES_DIRS = [

'static'

]

 

On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:

Hello

 

I developped a project in Django python that works fine. Thus, I deployed my 
project. Everything works but the static files are not found by the application.

I give you below the settings and wsgi files.

 

WSGI

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')

application = get_wsgi_application()

 

SETTINGS

import os
from pathlib import Path

os.environ['ENV'] = 'PRODUCTION'

BASE_DIR = Path(__file__).resolve(strict=True).parent.parent

DEBUG = False
SECRET_KEY = 
'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
ALLOWED_HOSTS = ['*']

STATIC_ROOT = os.path.join(BASE_DIR, "static")

INSTALLED_APPS = [
'bridge.apps.BridgeConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Web_bridge.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'Web_bridge.wsgi.application'

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql', # on utilise l'adaptateur postgresql
'NAME': 'sudoku_bridge', # le nom de notre base de donnees creee precedemment
'USER': 'sudoku', # attention : remplacez par votre nom d'utilisateur
'PASSWORD': '*',
'HOST': 'postgresql-sudoku.alwaysdata.net',
'PORT': '5432',
'CONN_MAX_AGE': 500,
}
}

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

LANGUAGE_CODE = 'fr-FR'

TIME_ZONE = 'Europe/Paris'

USE_I18N = True

USE_L10N = True

USE_TZ = False

STATIC_URL = 'static/'

 

Thank you in advance to help me.

 

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

Re: Static files not found

2022-02-13 Thread Dev femibadmus
U need to provide ur static Files dir

Using os.path.join(BASR_DIR, "staticfiles")

Also if u storing ur static file to cloud or any other host present ur
STATICFILES_STORAGE="https://domain.com/location/folder;

On Sun, Feb 13, 2022, 18:47 Serge Alard  wrote:

> To  Ogunsanya Opeyemi : my Django app folder is bridge, thus it's OK
> To dashlaksh...@gmail.com : I tried but the static files are not found
> To  mminu...@gmail.com :  STATICFILES_DIRS = [BASE_DIR/" directory>"] is not necessary because it's given already in static_root.
> Thank you everybody but it does not work yet.
>
> Serge Alard
>
>
> Le jeudi 3 février 2022 à 20:21:30 UTC+1, mminu...@gmail.com a écrit :
>
>> At the bottom of your code, you need to include the STATICFILES_DIRS =
>> [BASE_DIR/""].
>> This tells django where your static files are
>>
>> On Thu, Feb 3, 2022, 18:49 Opeyemi Ogunsanya 
>> wrote:
>>
>>> Move the static folder to the Django app folder
>>>
>>> On Thu, Feb 3, 2022, 6:01 PM Serge Alard  wrote:
>>>
>>>> Thank you for the suggestion but it does not work.
>>>> I add 2 things to make easier your helps :
>>>>
>>>>- the settings and wsgi files are in /www/Web_bridge/ Web_bridge/
>>>>- the static files are in /www/Web_bridge/static/bridge/
>>>>
>>>> Below an example of connexion.html that calls a static file :
>>>>
>>>> {% extends "bridge/sous_base.html" %}
>>>>
>>>> {% block content %}
>>>> {% if error_message %}{{ error_message }}{% endif
>>>> %}
>>>> Connexion
>>>> 
>>>> {% csrf_token %}
>>>> 
>>>> Pseudonyme : 
>>>> >>> required />
>>>> 
>>>> Mot de passe : 
>>>> 
>>>> >>> onclick="Afficher(['pass'])" >
>>>> 
>>>> Mot
>>>> de passe oublié
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> {% endblock %}
>>>>
>>>> {% block script %}
>>>> {% load static %}
>>>> {{ block.super }}
>>>> 
>>>> {% endblock %}
>>>>
>>>> Thank you in advance for your suggestions.
>>>>
>>>> Le jeudi 3 février 2022 à 16:33:10 UTC+1, dashlaksh...@gmail.com a
>>>> écrit :
>>>>
>>>>> Please add this line below static_url
>>>>>
>>>>> STATICFILES_DIRS = [
>>>>> 'static'
>>>>> ]
>>>>>
>>>>> On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:
>>>>>
>>>>>> Hello
>>>>>>
>>>>>> I developped a project in Django python that works fine. Thus, I
>>>>>> deployed my project. Everything works but the static files are not found 
>>>>>> by
>>>>>> the application.
>>>>>> I give you below the settings and wsgi files.
>>>>>>
>>>>>> *WSGI*
>>>>>> import os
>>>>>>
>>>>>> from django.core.wsgi import get_wsgi_application
>>>>>>
>>>>>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')
>>>>>>
>>>>>> application = get_wsgi_application()
>>>>>>
>>>>>> *SETTINGS*
>>>>>> import os
>>>>>> from pathlib import Path
>>>>>>
>>>>>> os.environ['ENV'] = 'PRODUCTION'
>>>>>>
>>>>>> BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
>>>>>>
>>>>>> DEBUG = False
>>>>>> SECRET_KEY =
>>>>>> 'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
>>>>>> ALLOWED_HOSTS = ['*']
>>>>>>
>>>>>> STATIC_ROOT = os.path.join(BASE_DIR, "static")
>>>>>>
>>>>>> INSTALLED_APPS = [
>>>>>> 'bridge.apps.BridgeConfig',
>>>>>> 'django.contrib.admin',
>>>>>> 'django.contrib.auth',
>>>>>> 'django.contrib.contenttypes',
>>>>>> 'django.contrib.sessions',
>>>>>> 'django.contrib.messages',
>>>>>> 'django.contrib.staticfiles',
>>>>>> 'django.contrib.sites',
>>>>>> ]
>>>>>>
>>>>

Re: Static files not found

2022-02-13 Thread Serge Alard
To  Ogunsanya Opeyemi : my Django app folder is bridge, thus it's OK
To dashlaksh...@gmail.com : I tried but the static files are not found
To  mminu...@gmail.com :  STATICFILES_DIRS = [BASE_DIR/""] is not necessary because it's given already in static_root.
Thank you everybody but it does not work yet.

Serge Alard


Le jeudi 3 février 2022 à 20:21:30 UTC+1, mminu...@gmail.com a écrit :

> At the bottom of your code, you need to include the STATICFILES_DIRS = 
> [BASE_DIR/""].
> This tells django where your static files are
>
> On Thu, Feb 3, 2022, 18:49 Opeyemi Ogunsanya  
> wrote:
>
>> Move the static folder to the Django app folder
>>
>> On Thu, Feb 3, 2022, 6:01 PM Serge Alard  wrote:
>>
>>> Thank you for the suggestion but it does not work.
>>> I add 2 things to make easier your helps :
>>>
>>>- the settings and wsgi files are in /www/Web_bridge/ Web_bridge/
>>>- the static files are in /www/Web_bridge/static/bridge/
>>>
>>> Below an example of connexion.html that calls a static file :
>>>
>>> {% extends "bridge/sous_base.html" %}
>>>
>>> {% block content %}
>>> {% if error_message %}{{ error_message }}{% endif 
>>> %}
>>> Connexion
>>> 
>>> {% csrf_token %}
>>> 
>>> Pseudonyme : 
>>> >> required />
>>> 
>>> Mot de passe : 
>>> 
>>> >> onclick="Afficher(['pass'])" >
>>> 
>>> Mot 
>>> de passe oublié
>>> 
>>> 
>>> 
>>> 
>>> 
>>> {% endblock %}
>>>
>>> {% block script %}
>>> {% load static %}
>>> {{ block.super }}
>>> 
>>> {% endblock %}
>>>
>>> Thank you in advance for your suggestions.
>>>
>>> Le jeudi 3 février 2022 à 16:33:10 UTC+1, dashlaksh...@gmail.com a 
>>> écrit :
>>>
>>>> Please add this line below static_url
>>>>
>>>> STATICFILES_DIRS = [
>>>> 'static'
>>>> ]
>>>>
>>>> On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:
>>>>
>>>>> Hello
>>>>>
>>>>> I developped a project in Django python that works fine. Thus, I 
>>>>> deployed my project. Everything works but the static files are not found 
>>>>> by 
>>>>> the application.
>>>>> I give you below the settings and wsgi files.
>>>>>
>>>>> *WSGI*
>>>>> import os
>>>>>
>>>>> from django.core.wsgi import get_wsgi_application
>>>>>
>>>>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')
>>>>>
>>>>> application = get_wsgi_application()
>>>>>
>>>>> *SETTINGS*
>>>>> import os
>>>>> from pathlib import Path
>>>>>
>>>>> os.environ['ENV'] = 'PRODUCTION'
>>>>>
>>>>> BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
>>>>>
>>>>> DEBUG = False
>>>>> SECRET_KEY = 
>>>>> 'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
>>>>> ALLOWED_HOSTS = ['*']
>>>>>
>>>>> STATIC_ROOT = os.path.join(BASE_DIR, "static")
>>>>>
>>>>> INSTALLED_APPS = [
>>>>> 'bridge.apps.BridgeConfig',
>>>>> 'django.contrib.admin',
>>>>> 'django.contrib.auth',
>>>>> 'django.contrib.contenttypes',
>>>>> 'django.contrib.sessions',
>>>>> 'django.contrib.messages',
>>>>> 'django.contrib.staticfiles',
>>>>> 'django.contrib.sites',
>>>>> ]
>>>>>
>>>>> MIDDLEWARE = [
>>>>> 'django.middleware.security.SecurityMiddleware',
>>>>> 'django.contrib.sessions.middleware.SessionMiddleware',
>>>>> 'django.middleware.common.CommonMiddleware',
>>>>> 'django.middleware.csrf.CsrfViewMiddleware',
>>>>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>>>>> 'django.contrib.messages.middleware.MessageMiddleware',
>>>>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>>>>> ]
>>>>>
>>>>> ROOT_URLCONF = 'Web_bridge.urls'
>>>>>
>>>>> TEMPLATES = [
>>>>> {
>>>>> 'BACKEND': 'django.template.bac

Re: Static files not found

2022-02-03 Thread Muhammad Muhammad inuwa
At the bottom of your code, you need to include the STATICFILES_DIRS =
[BASE_DIR/""].
This tells django where your static files are

On Thu, Feb 3, 2022, 18:49 Opeyemi Ogunsanya 
wrote:

> Move the static folder to the Django app folder
>
> On Thu, Feb 3, 2022, 6:01 PM Serge Alard  wrote:
>
>> Thank you for the suggestion but it does not work.
>> I add 2 things to make easier your helps :
>>
>>- the settings and wsgi files are in /www/Web_bridge/ Web_bridge/
>>- the static files are in /www/Web_bridge/static/bridge/
>>
>> Below an example of connexion.html that calls a static file :
>>
>> {% extends "bridge/sous_base.html" %}
>>
>> {% block content %}
>> {% if error_message %}{{ error_message }}{% endif %}
>> Connexion
>> 
>> {% csrf_token %}
>> 
>> Pseudonyme : 
>> > required />
>> 
>> Mot de passe : 
>> 
>> > onclick="Afficher(['pass'])" >
>> 
>> Mot
>> de passe oublié
>> 
>> 
>> 
>> 
>> 
>> {% endblock %}
>>
>> {% block script %}
>> {% load static %}
>> {{ block.super }}
>> 
>> {% endblock %}
>>
>> Thank you in advance for your suggestions.
>>
>> Le jeudi 3 février 2022 à 16:33:10 UTC+1, dashlaksh...@gmail.com a
>> écrit :
>>
>>> Please add this line below static_url
>>>
>>> STATICFILES_DIRS = [
>>> 'static'
>>> ]
>>>
>>> On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:
>>>
>>>> Hello
>>>>
>>>> I developped a project in Django python that works fine. Thus, I
>>>> deployed my project. Everything works but the static files are not found by
>>>> the application.
>>>> I give you below the settings and wsgi files.
>>>>
>>>> *WSGI*
>>>> import os
>>>>
>>>> from django.core.wsgi import get_wsgi_application
>>>>
>>>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')
>>>>
>>>> application = get_wsgi_application()
>>>>
>>>> *SETTINGS*
>>>> import os
>>>> from pathlib import Path
>>>>
>>>> os.environ['ENV'] = 'PRODUCTION'
>>>>
>>>> BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
>>>>
>>>> DEBUG = False
>>>> SECRET_KEY =
>>>> 'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
>>>> ALLOWED_HOSTS = ['*']
>>>>
>>>> STATIC_ROOT = os.path.join(BASE_DIR, "static")
>>>>
>>>> INSTALLED_APPS = [
>>>> 'bridge.apps.BridgeConfig',
>>>> 'django.contrib.admin',
>>>> 'django.contrib.auth',
>>>> 'django.contrib.contenttypes',
>>>> 'django.contrib.sessions',
>>>> 'django.contrib.messages',
>>>> 'django.contrib.staticfiles',
>>>> 'django.contrib.sites',
>>>> ]
>>>>
>>>> MIDDLEWARE = [
>>>> 'django.middleware.security.SecurityMiddleware',
>>>> 'django.contrib.sessions.middleware.SessionMiddleware',
>>>> 'django.middleware.common.CommonMiddleware',
>>>> 'django.middleware.csrf.CsrfViewMiddleware',
>>>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>>>> 'django.contrib.messages.middleware.MessageMiddleware',
>>>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>>>> ]
>>>>
>>>> ROOT_URLCONF = 'Web_bridge.urls'
>>>>
>>>> TEMPLATES = [
>>>> {
>>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>>> 'DIRS': [BASE_DIR / 'templates'],
>>>> 'APP_DIRS': True,
>>>> 'OPTIONS': {
>>>> 'context_processors': [
>>>> 'django.template.context_processors.debug',
>>>> 'django.template.context_processors.request',
>>>> 'django.contrib.auth.context_processors.auth',
>>>> 'django.contrib.messages.context_processors.messages',
>>>> ],
>>>> },
>>>> },
>>>> ]
>>>>
>>>> WSGI_APPLICATION = 'Web_bridge.wsgi.application'
>>>>
>>>> DATABASES = {
>>>> 'default': {
>>>> 'ENGINE': 'django.db.backends.postgresql', # on utilise l'adaptateur
>>>> postgresql
>>>> 'NAME': 'sudoku_bridge', # le nom de notre base de donnees creee
>>>> precedemment
>>>> 'USER': 'sud

Re: Static files not found

2022-02-03 Thread Lakshyaraj Dash X-D 25
Ok! Actually I had not looked properly to your file. The line that I had
given was already in STATIC_ROOT. If you have debug=False, then you can run
something like this :
python manage.py runserver --insecure

It will serve your static files while the debug mode is set to false.

On Thu, Feb 3, 2022, 22:29 Serge Alard  wrote:

> Thank you for the suggestion but it does not work.
> I add 2 things to make easier your helps :
>
>- the settings and wsgi files are in /www/Web_bridge/ Web_bridge/
>    - the static files are in /www/Web_bridge/static/bridge/
>
> Below an example of connexion.html that calls a static file :
>
> {% extends "bridge/sous_base.html" %}
>
> {% block content %}
> {% if error_message %}{{ error_message }}{% endif %}
> Connexion
> 
> {% csrf_token %}
> 
> Pseudonyme : 
>  />
> 
> Mot de passe : 
> 
>  onclick="Afficher(['pass'])" >
> 
> Mot de
> passe oublié
> 
> 
> 
> 
> 
> {% endblock %}
>
> {% block script %}
> {% load static %}
> {{ block.super }}
> 
> {% endblock %}
>
> Thank you in advance for your suggestions.
>
> Le jeudi 3 février 2022 à 16:33:10 UTC+1, dashlaksh...@gmail.com a écrit :
>
>> Please add this line below static_url
>>
>> STATICFILES_DIRS = [
>> 'static'
>> ]
>>
>> On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:
>>
>>> Hello
>>>
>>> I developped a project in Django python that works fine. Thus, I
>>> deployed my project. Everything works but the static files are not found by
>>> the application.
>>> I give you below the settings and wsgi files.
>>>
>>> *WSGI*
>>> import os
>>>
>>> from django.core.wsgi import get_wsgi_application
>>>
>>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')
>>>
>>> application = get_wsgi_application()
>>>
>>> *SETTINGS*
>>> import os
>>> from pathlib import Path
>>>
>>> os.environ['ENV'] = 'PRODUCTION'
>>>
>>> BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
>>>
>>> DEBUG = False
>>> SECRET_KEY =
>>> 'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
>>> ALLOWED_HOSTS = ['*']
>>>
>>> STATIC_ROOT = os.path.join(BASE_DIR, "static")
>>>
>>> INSTALLED_APPS = [
>>> 'bridge.apps.BridgeConfig',
>>> 'django.contrib.admin',
>>> 'django.contrib.auth',
>>> 'django.contrib.contenttypes',
>>> 'django.contrib.sessions',
>>> 'django.contrib.messages',
>>> 'django.contrib.staticfiles',
>>> 'django.contrib.sites',
>>> ]
>>>
>>> MIDDLEWARE = [
>>> 'django.middleware.security.SecurityMiddleware',
>>> 'django.contrib.sessions.middleware.SessionMiddleware',
>>> 'django.middleware.common.CommonMiddleware',
>>> 'django.middleware.csrf.CsrfViewMiddleware',
>>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>>> 'django.contrib.messages.middleware.MessageMiddleware',
>>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>>> ]
>>>
>>> ROOT_URLCONF = 'Web_bridge.urls'
>>>
>>> TEMPLATES = [
>>> {
>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>> 'DIRS': [BASE_DIR / 'templates'],
>>> 'APP_DIRS': True,
>>> 'OPTIONS': {
>>> 'context_processors': [
>>> 'django.template.context_processors.debug',
>>> 'django.template.context_processors.request',
>>> 'django.contrib.auth.context_processors.auth',
>>> 'django.contrib.messages.context_processors.messages',
>>> ],
>>> },
>>> },
>>> ]
>>>
>>> WSGI_APPLICATION = 'Web_bridge.wsgi.application'
>>>
>>> DATABASES = {
>>> 'default': {
>>> 'ENGINE': 'django.db.backends.postgresql', # on utilise l'adaptateur
>>> postgresql
>>> 'NAME': 'sudoku_bridge', # le nom de notre base de donnees creee
>>> precedemment
>>> 'USER': 'sudoku', # attention : remplacez par votre nom d'utilisateur
>>> 'PASSWORD': '*',
>>> 'HOST': 'postgresql-sudoku.alwaysdata.net',
>>> 'PORT': '5432',
>>> 'CONN_MAX_AGE': 500,
>>> }
>>> }
>>>
>>> AUTH_PASSWORD_VALIDATORS = [
>>> {
>>> 'NAME':
>>> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
>>> },
>>> {
>>> 'NAME': 'django.contrib.auth.password_validation.MinimumLengthVa

Re: Static files not found

2022-02-03 Thread Opeyemi Ogunsanya
Move the static folder to the Django app folder

On Thu, Feb 3, 2022, 6:01 PM Serge Alard  wrote:

> Thank you for the suggestion but it does not work.
> I add 2 things to make easier your helps :
>
>- the settings and wsgi files are in /www/Web_bridge/ Web_bridge/
>    - the static files are in /www/Web_bridge/static/bridge/
>
> Below an example of connexion.html that calls a static file :
>
> {% extends "bridge/sous_base.html" %}
>
> {% block content %}
> {% if error_message %}{{ error_message }}{% endif %}
> Connexion
> 
> {% csrf_token %}
> 
> Pseudonyme : 
>  />
> 
> Mot de passe : 
> 
>  onclick="Afficher(['pass'])" >
> 
> Mot de
> passe oublié
> 
> 
> 
> 
> 
> {% endblock %}
>
> {% block script %}
> {% load static %}
> {{ block.super }}
> 
> {% endblock %}
>
> Thank you in advance for your suggestions.
>
> Le jeudi 3 février 2022 à 16:33:10 UTC+1, dashlaksh...@gmail.com a écrit :
>
>> Please add this line below static_url
>>
>> STATICFILES_DIRS = [
>> 'static'
>> ]
>>
>> On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:
>>
>>> Hello
>>>
>>> I developped a project in Django python that works fine. Thus, I
>>> deployed my project. Everything works but the static files are not found by
>>> the application.
>>> I give you below the settings and wsgi files.
>>>
>>> *WSGI*
>>> import os
>>>
>>> from django.core.wsgi import get_wsgi_application
>>>
>>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')
>>>
>>> application = get_wsgi_application()
>>>
>>> *SETTINGS*
>>> import os
>>> from pathlib import Path
>>>
>>> os.environ['ENV'] = 'PRODUCTION'
>>>
>>> BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
>>>
>>> DEBUG = False
>>> SECRET_KEY =
>>> 'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
>>> ALLOWED_HOSTS = ['*']
>>>
>>> STATIC_ROOT = os.path.join(BASE_DIR, "static")
>>>
>>> INSTALLED_APPS = [
>>> 'bridge.apps.BridgeConfig',
>>> 'django.contrib.admin',
>>> 'django.contrib.auth',
>>> 'django.contrib.contenttypes',
>>> 'django.contrib.sessions',
>>> 'django.contrib.messages',
>>> 'django.contrib.staticfiles',
>>> 'django.contrib.sites',
>>> ]
>>>
>>> MIDDLEWARE = [
>>> 'django.middleware.security.SecurityMiddleware',
>>> 'django.contrib.sessions.middleware.SessionMiddleware',
>>> 'django.middleware.common.CommonMiddleware',
>>> 'django.middleware.csrf.CsrfViewMiddleware',
>>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>>> 'django.contrib.messages.middleware.MessageMiddleware',
>>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>>> ]
>>>
>>> ROOT_URLCONF = 'Web_bridge.urls'
>>>
>>> TEMPLATES = [
>>> {
>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>> 'DIRS': [BASE_DIR / 'templates'],
>>> 'APP_DIRS': True,
>>> 'OPTIONS': {
>>> 'context_processors': [
>>> 'django.template.context_processors.debug',
>>> 'django.template.context_processors.request',
>>> 'django.contrib.auth.context_processors.auth',
>>> 'django.contrib.messages.context_processors.messages',
>>> ],
>>> },
>>> },
>>> ]
>>>
>>> WSGI_APPLICATION = 'Web_bridge.wsgi.application'
>>>
>>> DATABASES = {
>>> 'default': {
>>> 'ENGINE': 'django.db.backends.postgresql', # on utilise l'adaptateur
>>> postgresql
>>> 'NAME': 'sudoku_bridge', # le nom de notre base de donnees creee
>>> precedemment
>>> 'USER': 'sudoku', # attention : remplacez par votre nom d'utilisateur
>>> 'PASSWORD': '*',
>>> 'HOST': 'postgresql-sudoku.alwaysdata.net',
>>> 'PORT': '5432',
>>> 'CONN_MAX_AGE': 500,
>>> }
>>> }
>>>
>>> AUTH_PASSWORD_VALIDATORS = [
>>> {
>>> 'NAME':
>>> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
>>> },
>>> {
>>> 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
>>> },
>>> {
>>> 'NAME':
>>> 'django.contrib.auth.password_validation.CommonPasswordValidator',
>>> },
>>> {
>>> 'NAME':
>>> 'django.contrib.auth.passw

Re: Static files not found

2022-02-03 Thread Serge Alard
Thank you for the suggestion but it does not work.
I add 2 things to make easier your helps :

   - the settings and wsgi files are in /www/Web_bridge/ Web_bridge/
   - the static files are in /www/Web_bridge/static/bridge/

Below an example of connexion.html that calls a static file :

{% extends "bridge/sous_base.html" %}

{% block content %}
{% if error_message %}{{ error_message }}{% endif %}
Connexion

{% csrf_token %}

Pseudonyme : 


Mot de passe : 



Mot de 
passe oublié





{% endblock %}

{% block script %}
{% load static %}
{{ block.super }}

{% endblock %}

Thank you in advance for your suggestions.

Le jeudi 3 février 2022 à 16:33:10 UTC+1, dashlaksh...@gmail.com a écrit :

> Please add this line below static_url
>
> STATICFILES_DIRS = [
> 'static'
> ]
>
> On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:
>
>> Hello
>>
>> I developped a project in Django python that works fine. Thus, I deployed 
>> my project. Everything works but the static files are not found by the 
>> application.
>> I give you below the settings and wsgi files.
>>
>> *WSGI*
>> import os
>>
>> from django.core.wsgi import get_wsgi_application
>>
>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')
>>
>> application = get_wsgi_application()
>>
>> *SETTINGS*
>> import os
>> from pathlib import Path
>>
>> os.environ['ENV'] = 'PRODUCTION'
>>
>> BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
>>
>> DEBUG = False
>> SECRET_KEY = 
>> 'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
>> ALLOWED_HOSTS = ['*']
>>
>> STATIC_ROOT = os.path.join(BASE_DIR, "static")
>>
>> INSTALLED_APPS = [
>> 'bridge.apps.BridgeConfig',
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'django.contrib.sites',
>> ]
>>
>> MIDDLEWARE = [
>> 'django.middleware.security.SecurityMiddleware',
>> 'django.contrib.sessions.middleware.SessionMiddleware',
>> 'django.middleware.common.CommonMiddleware',
>> 'django.middleware.csrf.CsrfViewMiddleware',
>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> 'django.contrib.messages.middleware.MessageMiddleware',
>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>> ]
>>
>> ROOT_URLCONF = 'Web_bridge.urls'
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> 'DIRS': [BASE_DIR / 'templates'],
>> 'APP_DIRS': True,
>> 'OPTIONS': {
>> 'context_processors': [
>> 'django.template.context_processors.debug',
>> 'django.template.context_processors.request',
>> 'django.contrib.auth.context_processors.auth',
>> 'django.contrib.messages.context_processors.messages',
>> ],
>> },
>> },
>> ]
>>
>> WSGI_APPLICATION = 'Web_bridge.wsgi.application'
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.postgresql', # on utilise l'adaptateur 
>> postgresql
>> 'NAME': 'sudoku_bridge', # le nom de notre base de donnees creee 
>> precedemment
>> 'USER': 'sudoku', # attention : remplacez par votre nom d'utilisateur
>> 'PASSWORD': '*',
>> 'HOST': 'postgresql-sudoku.alwaysdata.net',
>> 'PORT': '5432',
>> 'CONN_MAX_AGE': 500,
>> }
>> }
>>
>> AUTH_PASSWORD_VALIDATORS = [
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
>> },
>> {
>> 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
>> },
>> {
>> 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
>> },
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.NumericPasswordValidator',
>> },
>> ]
>>
>> LANGUAGE_CODE = 'fr-FR'
>>
>> TIME_ZONE = 'Europe/Paris'
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> USE_TZ = False
>>
>> STATIC_URL = 'static/'
>>
>> Thank you in advance to help me.
>>
>> -- 
>> 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/1c8bda14-d16f-405f-9c66-29e63275419bn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/1c8bda14-d16f-405f-9c66-29e63275419bn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/280871bd-69c4-42a4-b781-578e20c0d7f4n%40googlegroups.com.


Re: Static files not found

2022-02-03 Thread Lakshyaraj Dash X-D 25
Please add this line below static_url

STATICFILES_DIRS = [
'static'
]

On Thu, Feb 3, 2022, 20:53 Serge Alard  wrote:

> Hello
>
> I developped a project in Django python that works fine. Thus, I deployed
> my project. Everything works but the static files are not found by the
> application.
> I give you below the settings and wsgi files.
>
> *WSGI*
> import os
>
> from django.core.wsgi import get_wsgi_application
>
> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')
>
> application = get_wsgi_application()
>
> *SETTINGS*
> import os
> from pathlib import Path
>
> os.environ['ENV'] = 'PRODUCTION'
>
> BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
>
> DEBUG = False
> SECRET_KEY =
> 'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
> ALLOWED_HOSTS = ['*']
>
> STATIC_ROOT = os.path.join(BASE_DIR, "static")
>
> INSTALLED_APPS = [
> 'bridge.apps.BridgeConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django.contrib.sites',
> ]
>
> MIDDLEWARE = [
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> ]
>
> ROOT_URLCONF = 'Web_bridge.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [BASE_DIR / 'templates'],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> WSGI_APPLICATION = 'Web_bridge.wsgi.application'
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql', # on utilise l'adaptateur
> postgresql
> 'NAME': 'sudoku_bridge', # le nom de notre base de donnees creee
> precedemment
> 'USER': 'sudoku', # attention : remplacez par votre nom d'utilisateur
> 'PASSWORD': '*',
> 'HOST': 'postgresql-sudoku.alwaysdata.net',
> 'PORT': '5432',
> 'CONN_MAX_AGE': 500,
> }
> }
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME':
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
> },
> {
> 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
> },
> {
> 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
> },
> ]
>
> LANGUAGE_CODE = 'fr-FR'
>
> TIME_ZONE = 'Europe/Paris'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = False
>
> STATIC_URL = 'static/'
>
> Thank you in advance to help me.
>
> --
> 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/1c8bda14-d16f-405f-9c66-29e63275419bn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1c8bda14-d16f-405f-9c66-29e63275419bn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAF7qQgD5cHEDVcoCtL6JNJQyg%3Dhqr15bskOg6RWCKKn4-YCreQ%40mail.gmail.com.


Static files not found

2022-02-03 Thread Serge Alard
Hello

I developped a project in Django python that works fine. Thus, I deployed 
my project. Everything works but the static files are not found by the 
application.
I give you below the settings and wsgi files.

*WSGI*
import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Web_bridge.settings')

application = get_wsgi_application()

*SETTINGS*
import os
from pathlib import Path

os.environ['ENV'] = 'PRODUCTION'

BASE_DIR = Path(__file__).resolve(strict=True).parent.parent

DEBUG = False
SECRET_KEY = 
'django-insecure-eqlug^3e20v1c5%mo9*mhhea^vv$!$%x&6!@6$+e%7'
ALLOWED_HOSTS = ['*']

STATIC_ROOT = os.path.join(BASE_DIR, "static")

INSTALLED_APPS = [
'bridge.apps.BridgeConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Web_bridge.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'Web_bridge.wsgi.application'

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql', # on utilise l'adaptateur 
postgresql
'NAME': 'sudoku_bridge', # le nom de notre base de donnees creee 
precedemment
'USER': 'sudoku', # attention : remplacez par votre nom d'utilisateur
'PASSWORD': '*',
'HOST': 'postgresql-sudoku.alwaysdata.net',
'PORT': '5432',
'CONN_MAX_AGE': 500,
}
}

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

LANGUAGE_CODE = 'fr-FR'

TIME_ZONE = 'Europe/Paris'

USE_I18N = True

USE_L10N = True

USE_TZ = False

STATIC_URL = 'static/'

Thank you in advance to help me.

-- 
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/1c8bda14-d16f-405f-9c66-29e63275419bn%40googlegroups.com.


Re: static files not getting served

2021-12-05 Thread Adriano Machado
Hi, Heroku and SQLite do t match.

Read this:
From:
https://devcenter.heroku.com/articles/sqlite3


SQLite runs in memory, and backs up its data store in files on disk. While
this strategy works well for development, Heroku’s Cedar stack has an ephemeral
filesystem
<https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem>. You can
write to it, and you can read from it, but the contents will be cleared
periodically. If you were to use SQLite on Heroku, you would lose your
entire database at least once every 24 hours.

Even if Heroku’s disks were persistent running SQLite would still not be a
good fit. Since SQLite does not run as a service, each dyno would run a
separate running copy. Each of these copies need their own disk backed
store. This would mean that each dyno powering your app would have a
different set of data since the disks are not synchronized.

Em sáb., 4 de dez. de 2021 às 11:25, Rahul 
escreveu:

> hey guys  am using default database i.e. SQL Lite3 but when i deploy it on
> heroku my static files are not getting served . Please suggest what should
> i do??
>
> should i use postgres ???
>
> Please HELP
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3afdbdd1-c481-498e-b659-44bfc2e691c4n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3afdbdd1-c481-498e-b659-44bfc2e691c4n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: static files not getting served

2021-12-05 Thread Jet Ezra
To me, you are not going to serve static files but media files, am sure
that the image linked above was as a result of uploading it somewhere,
However much you try, heroku does not handle media files, when you upload
your image, the next refresh of the running dyno will delete it from your
file directory, unless you find a way of saving your images in the db
direct which django does not emphasise, you should push your media and
static files to AWS S3 bucket, if possible, please serve them using
cloudfront, your issue will be solved well.

This also increases your sites speed.

On Sun, Dec 5, 2021 at 4:41 PM Lakshyaraj Dash X-D 25 <
dashlakshyaraj2...@gmail.com> wrote:

> Inside settings.py,
>
> Write these two lines of code and your static files will be served
>
> import os
>
> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
>
> On Sun, Dec 5, 2021, 18:49 Rahul  wrote:
>
>> see brother i am not shouting at all . i am using heroku for deployment
>> and i didnt got any big error just in websites console ''failed to load
>> resource server responded with the status of 404 ''
>> i had deployed by pushing files to github and then using heroku  . i had
>> also used whitenoise but it didnt worked ,, im using sqllite3 which is
>> provided by django ..
>>
>> my website is working fine . just all the images which are shown in
>> picture are not working[image: problem.PNG]
>> On Saturday, 4 December 2021 at 22:03:56 UTC+5:30 Kasper Laudrup wrote:
>>
>>> On 04/12/2021 10.52, Rahul wrote:
>>> > hey guys  am using default database i.e. SQL Lite3 but when i deploy
>>> it
>>> > on heroku my static files are not getting served . Please suggest what
>>> > should i do??
>>> >
>>>
>>> You should tell us some relevant details, e.g. how you are deploying
>>> your project, any error messages, which instructions you have followed
>>> for deploying etc. so someone actually has a chance of helping you.
>>>
>>>
>>> > should i use postgres ???
>>> >
>>>
>>> Static files and the choice of database are not related so that won't
>>> make a difference.
>>>
>>> > Please HELP
>>> >
>>>
>>> Please don't SHOUT.
>>>
>>> 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/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAF7qQgDYN6YudyqsuJvSyv2b8PWaO1r1fmveamxKYivMM793gA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF7qQgDYN6YudyqsuJvSyv2b8PWaO1r1fmveamxKYivMM793gA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
jet

-- 
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/CAMjc0xVDBPC7U5ftiNJL9b_3N%2BV_v9pF9HCm_gUqFgVu1iqG5A%40mail.gmail.com.


Re: static files not getting served

2021-12-05 Thread Kasper Laudrup

On 05/12/2021 14.18, Rahul wrote:

see brother i am not shouting at all .


Writing in ALL CAPITAL LETTERS is considered shouting. Please refrain 
from doing that. I am also not your brother. Using language like that 
makes it hard to take you serious.


i am using heroku for deployment 
and i didnt got any big error just in websites console ''failed to load 
resource server responded with the status of 404 ''
i had deployed by pushing files to github and then using heroku  . i had 
also used whitenoise but it didnt worked ,, im using sqllite3 which is 
provided by django ..


my website is working fine . just all the images which are shown in 
picture are not workingproblem.PNG


That's not really relevant information for anyone to help you.

Have you read and tried to follow this:

https://devcenter.heroku.com/articles/django-assets

?

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/f5f772d4-9113-c060-da65-7673de7f61ff%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: static files not getting served

2021-12-05 Thread Lakshyaraj Dash X-D 25
Inside settings.py,

Write these two lines of code and your static files will be served

import os

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

On Sun, Dec 5, 2021, 18:49 Rahul  wrote:

> see brother i am not shouting at all . i am using heroku for deployment
> and i didnt got any big error just in websites console ''failed to load
> resource server responded with the status of 404 ''
> i had deployed by pushing files to github and then using heroku  . i had
> also used whitenoise but it didnt worked ,, im using sqllite3 which is
> provided by django ..
>
> my website is working fine . just all the images which are shown in
> picture are not working[image: problem.PNG]
> On Saturday, 4 December 2021 at 22:03:56 UTC+5:30 Kasper Laudrup wrote:
>
>> On 04/12/2021 10.52, Rahul wrote:
>> > hey guys  am using default database i.e. SQL Lite3 but when i deploy it
>> > on heroku my static files are not getting served . Please suggest what
>> > should i do??
>> >
>>
>> You should tell us some relevant details, e.g. how you are deploying
>> your project, any error messages, which instructions you have followed
>> for deploying etc. so someone actually has a chance of helping you.
>>
>>
>> > should i use postgres ???
>> >
>>
>> Static files and the choice of database are not related so that won't
>> make a difference.
>>
>> > Please HELP
>> >
>>
>> Please don't SHOUT.
>>
>> 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/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: static files not getting served

2021-12-05 Thread Rahul
see brother i am not shouting at all . i am using heroku for deployment and 
i didnt got any big error just in websites console ''failed to load 
resource server responded with the status of 404 ''
i had deployed by pushing files to github and then using heroku  . i had 
also used whitenoise but it didnt worked ,, im using sqllite3 which is 
provided by django .. 

my website is working fine . just all the images which are shown in picture 
are not working[image: problem.PNG]
On Saturday, 4 December 2021 at 22:03:56 UTC+5:30 Kasper Laudrup wrote:

> On 04/12/2021 10.52, Rahul wrote:
> > hey guys  am using default database i.e. SQL Lite3 but when i deploy it 
> > on heroku my static files are not getting served . Please suggest what 
> > should i do??
> >
>
> You should tell us some relevant details, e.g. how you are deploying 
> your project, any error messages, which instructions you have followed 
> for deploying etc. so someone actually has a chance of helping you.
>
>
> > should i use postgres ???
> > 
>
> Static files and the choice of database are not related so that won't 
> make a difference.
>
> > Please HELP
> > 
>
> Please don't SHOUT.
>
> 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/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com.


Re: static files not getting served

2021-12-04 Thread 'Mr. Aryan Sharma 4-Year B.Tech. Computer Science and Engineering' via Django users
At static files url at urls.py. And make a seperate directory for media
root as well.  Of your settings are correct project will get pushed .  Then
you ensure you have migrated from the console at heroku website

On Sat, 4 Dec, 2021, 8:55 pm Rahul,  wrote:

> hey guys  am using default database i.e. SQL Lite3 but when i deploy it on
> heroku my static files are not getting served . Please suggest what should
> i do??
>
> should i use postgres ???
>
> Please HELP
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3afdbdd1-c481-498e-b659-44bfc2e691c4n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3afdbdd1-c481-498e-b659-44bfc2e691c4n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAO10MeNkgFAGRfEyyNpH2ELzbZ9CE-F%3DTPoz9jRn1FVzE7zwUw%40mail.gmail.com.


Re: static files not getting served

2021-12-04 Thread Kasper Laudrup

On 04/12/2021 10.52, Rahul wrote:
hey guys  am using default database i.e. SQL Lite3 but when i deploy it 
on heroku my static files are not getting served . Please suggest what 
should i do??




You should tell us some relevant details, e.g. how you are deploying 
your project, any error messages, which instructions you have followed 
for deploying etc. so someone actually has a chance of helping you.




should i use postgres ???



Static files and the choice of database are not related so that won't 
make a difference.



Please HELP



Please don't SHOUT.

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/525ad3b3-a502-1a1d-5b19-2c741e3cda38%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


static files not getting served

2021-12-04 Thread Rahul
hey guys  am using default database i.e. SQL Lite3 but when i deploy it on 
heroku my static files are not getting served . Please suggest what should 
i do??

should i use postgres ???

Please HELP

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3afdbdd1-c481-498e-b659-44bfc2e691c4n%40googlegroups.com.


Re: facing problems while deploying the project some error with static files

2021-10-27 Thread Kasper Laudrup
On 27/10/2021 20.38, 'Mr. Aryan Sharma 4-Year B.Tech. Computer Science 
and Engineering' via Django users wrote:

I tried Whitenoise but it's still not working



Try something else. I'm sure that will work for you.

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/44763e49-9cf9-2c05-4ba2-1533c2af6fc5%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: facing problems while deploying the project some error with static files

2021-10-27 Thread 'Mr. Aryan Sharma 4-Year B.Tech. Computer Science and Engineering' via Django users
I tried Whitenoise but it's still not working

On Wed, 27 Oct, 2021, 11:36 pm Ennio Santos,  wrote:

> see this video and check if solve your problem. (i was facing problems
> with static files when deploying using heroku. it is working fine for me
> now).
>
> https://youtu.be/97UQM-Cfhxs
>
> Em quarta-feira, 27 de outubro de 2021 às 10:05:34 UTC-3,
> aryan.shar...@itbhu.ac.in escreveu:
>
>> i am using heroku
>>
>> --
> 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/f3b648fc-ce33-4e88-b5b0-835d9e5009d7n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f3b648fc-ce33-4e88-b5b0-835d9e5009d7n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAO10MeMxVJ4JXkkaQSPsyvJYT6ZhUx99HXxU3_X5%3D9KW1imvLQ%40mail.gmail.com.


Re: facing problems while deploying the project some error with static files

2021-10-27 Thread Ennio Santos
see this video and check if solve your problem. (i was facing problems with 
static files when deploying using heroku. it is working fine for me now).

https://youtu.be/97UQM-Cfhxs

Em quarta-feira, 27 de outubro de 2021 às 10:05:34 UTC-3, 
aryan.shar...@itbhu.ac.in escreveu:

> i am using heroku
>
>

-- 
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/f3b648fc-ce33-4e88-b5b0-835d9e5009d7n%40googlegroups.com.


Re: facing problems while deploying the project some error with static files

2021-10-27 Thread Lakshyaraj Dash X-D 25
Just do one thing, write STATIC_ROOT = os.path.join(BASE_DIR,
'staticfiles') in settings.py.
Ok. This will definitely solve your problem. I've an experience of
deploying my django projects. If any problems then message me at
dashlakshyaraj2...@gmail.com.

On Wed, Oct 27, 2021, 18:34 'Mr. Aryan Sharma 4-Year B.Tech. Computer
Science and Engineering' via Django users 
wrote:

> i am using heroku
>
> --
> 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/97077339-6e26-4c7d-9653-baf215d1abf7n%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/CAF7qQgD970iok0OebA5O04viR3Y_j-qwFoEjo25NozrXYrS9xQ%40mail.gmail.com.


Re: facing problems while deploying the project some error with static files

2021-10-27 Thread Lakshyaraj Dash X-D 25
Just do one thing, write STATIC_ROOT = os.path.join(BASE_DIR,
'staticfiles').
Ok. This will definitely solve your problem. I've an experience of
deploying my django projects. If any problems then message me at
dashlakshyaraj2...@gmail.com.

On Wed, Oct 27, 2021, 18:34 'Mr. Aryan Sharma 4-Year B.Tech. Computer
Science and Engineering' via Django users 
wrote:

> i am using heroku
>
> --
> 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/97077339-6e26-4c7d-9653-baf215d1abf7n%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/CAF7qQgB3xhfxGD3Pb-N2uRpMf4FwS6sObWRqRiccR0Z_-QxnEA%40mail.gmail.com.


Re: facing problems while deploying the project some error with static files

2021-10-27 Thread Kasper Laudrup
On 27/10/2021 12.51, 'Mr. Aryan Sharma 4-Year B.Tech. Computer Science 
and Engineering' via Django users wrote:

i am using heroku



You are probably doing something wrong. Try to do things correctly 
instead and see if that doesn't solve your problems.


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/2731da45-a49a-409a-5b8f-e6f11dcd5cac%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: facing problems while deploying the project some error with static files

2021-10-27 Thread Aashish Kumar
Have you define the static root in settings.py file

On Wed, 27 Oct 2021 at 6:35 PM, 'Mr. Aryan Sharma 4-Year B.Tech. Computer
Science and Engineering' via Django users 
wrote:

> i am using heroku
>
> --
> 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/97077339-6e26-4c7d-9653-baf215d1abf7n%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/CACTAcrz4fH93yqq84bD_b5fbCSvq6cv%3DuwECSPPdHKZCNtNRzw%40mail.gmail.com.


facing problems while deploying the project some error with static files

2021-10-27 Thread 'Mr. Aryan Sharma 4-Year B.Tech. Computer Science and Engineering' via Django users
i am using heroku

-- 
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/97077339-6e26-4c7d-9653-baf215d1abf7n%40googlegroups.com.


Re: Common problem finding static files. Help appreciated.

2021-08-18 Thread Scott Zimmerman
Resolved by changing nginx config file from above to this:
location /static {
root /home/www/wcsdg/main;
}

On Wednesday, August 18, 2021 at 8:03:00 AM UTC-5 Scott Zimmerman wrote:

>
>  I deployed django + nginx + gunicorn, and DEBUG = True. Nginx/error.log 
> shows that my problem finding static files is a concatenation mistake (caps 
> added)...
>
> "/home/www/wcsdg/main/STATIC/STATIC/main/styles.css" failed (2: No 
> such file or directory),
>  It should instead search for...
>
> "/home/www/wcsdg/main/static/main/styles.css"
>
> But there are 3 places where "static" is configured and I don't know what 
> I'm doing wrong:
>
> In settings.py...
>
> STATIC_URL = '/static/'
> STATIC_ROOT = '/home/www/wcsdg/main/static'
>
> In /etc/nginx/sites-available/wcsdg...
>
> location /static {
> root /home/www/wcsdg/main/static;
> }
>
> I also added whitenoise as an app in settings.py and restarted nginx and 
> gunicorn but it didn't help.
>
> Any advice?

-- 
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/0ced050a-9b98-42db-8d74-2c43491ecb82n%40googlegroups.com.


Common problem finding static files. Help appreciated.

2021-08-18 Thread Scott Zimmerman

 I deployed django + nginx + gunicorn, and DEBUG = True. Nginx/error.log 
shows that my problem finding static files is a concatenation mistake (caps 
added)...

"/home/www/wcsdg/main/STATIC/STATIC/main/styles.css" failed (2: No such 
file or directory),
 It should instead search for...

"/home/www/wcsdg/main/static/main/styles.css"

But there are 3 places where "static" is configured and I don't know what 
I'm doing wrong:

In settings.py...

STATIC_URL = '/static/'
STATIC_ROOT = '/home/www/wcsdg/main/static'

In /etc/nginx/sites-available/wcsdg...

location /static {
root /home/www/wcsdg/main/static;
}

I also added whitenoise as an app in settings.py and restarted nginx and 
gunicorn but it didn't help.

Any advice?

-- 
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/ddca78e8-fa18-4fb5-ac7c-e809d4149c31n%40googlegroups.com.


Re: how to manage static files after Debug = False

2021-04-18 Thread Kasper Laudrup
On 18/04/2021 15.12, Raj Kumar wrote:
> I have problem after debug off, i am unable to handle static files
> when i was doing debug off , i tried WhiteNoise but i can't able to
> done this. if anyone have solution please help me
> 

This looks pretty straightforward:

https://devcenter.heroku.com/articles/django-assets

If you've followed that without success, you should try to explain a bit
more in detail where you are having issues, not just "can't able to done
this".

And of course, if you want someone to do it for you, you should explain
more in detail how much you're willing to pay etc.

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/d35e9583-b225-8c91-afb5-47ed08ead113%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


how to manage static files after Debug = False

2021-04-18 Thread Raj Kumar
I have problem after debug off, i am unable to handle static files when i 
was doing debug off , i tried WhiteNoise but i can't able to done this. if 
anyone have solution please help me
 

Thank you guys

-- 
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/5833949f-9245-4b9c-a5d4-caaeb7257b63n%40googlegroups.com.


Re: Debug=False , heroku static files missing

2021-04-16 Thread sherry wilson
Use whitenoice

On Sat, 17 Apr 2021, 5:15 am Emran Ibn Shayed,  wrote:

> When I set Debug=False in setting.py , images got missing from my app on
> heroku. how do I solve it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8dab1454-aed7-47cc-87c7-9085efbb3e6an%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/CAPaR5pRqY6Kvkr1E1P2GtgihbskBjF6JD1Um5jqOb0H0FUUNjQ%40mail.gmail.com.


Debug=False , heroku static files missing

2021-04-16 Thread Emran Ibn Shayed
When I set Debug=False in setting.py , images got missing from my app on 
heroku. how do I solve it.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8dab1454-aed7-47cc-87c7-9085efbb3e6an%40googlegroups.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread kradem
Yes, thank you very much, the error to warning switch in 3.3.4 solved the 
problem.

Best regards!

Dana utorak, 6. travnja 2021. u 20:24:24 UTC+2 korisnik Andrew Godwin 
napisao je:

> This is probably this error: 
> https://github.com/django/asgiref/issues/251#issuecomment-814337170 - I'm 
> going to switch the error to a warning and we'll see if that helps, then 
> Daphne can have a fix added at a non-emergency pace.
>
> Andrew
>
> On Tue, Apr 6, 2021, at 12:19 PM, kradem wrote:
>
> Not sure if I understand you, I'm getting an server error in my browser 
> with rendered as quoted in the first post here with the following body:
>
>500 Internal Server Error   body { 
> font-family: sans-serif; margin: 0; padding: 0; }  h1 { padding: 0.6em 0 
> 0.2em 20px; color: #896868; margin: 0; }  p { padding: 0 0 0.3em 20px; 
> margin: 0; }  footer { padding: 1em 0 0.3em 20px; color: #999; font-size: 
> 80%; font-style: italic; }500 Internal Server 
> Error Exception inside application. Daphne 
>   
> And as raw:
>
> HTTP/1.1 500 Internal Server Error
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=utf-8
>
> Dana utorak, 6. travnja 2021. u 18:26:34 UTC+2 korisnik Andrew Godwin 
> napisao je:
>
>
> The tracebacks are there somewhere, you might have to look at the raw HTTP 
> response in the browser to see them.
>
> Andrew
>
> On Tue, Apr 6, 2021, at 10:18 AM, kradem wrote:
>
> I'm afraid a "success" was caused by the browser cache or something 
> similar, the 3.3.3 version doesn't fix my problem. :(
>
> > Could you get the traceback out of Django that's causing the 500 error 
> and post it here? 
>
> That was - kind of - my initial question, the only output I can get is the 
> message from the first post and Django's output like:
>
> HTTP GET /static/css/style.css 500 [0.35, 127.0.0.1:37982]
> HTTP GET /static/js/jquery-2.2.4.min.js 500 [0.35, 127.0.0.1:37988]
>
> Dana utorak, 6. travnja 2021. u 18:09:33 UTC+2 korisnik Andrew Godwin 
> napisao je:
>
>
> Aha, glad to hear it! My apologies that we didn't catch that one before 
> release yesterday.
>
> Andrew
>
> On Tue, Apr 6, 2021, at 10:01 AM, kradem wrote:
>
> Stop the press!! The 3.3.3 version is published in PyPi and after 
> installing it it all works well! :)
>
> Thank you!
> Dana utorak, 6. travnja 2021. u 17:56:44 UTC+2 korisnik kradem napisao je:
>
> Thank you very much for a quick response.
>
> Yes, that's the problem:
>
> asgiref   3.3.2
>
> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but 
> static files are served well.
>
> I tried with the very last version 3.3.3 (-e git+
> https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
> been fixed that way.
>
>
> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
> napisao je:
>
>
> This may be related to https://github.com/django/asgiref/issues/251 - 
> what version of asgiref are you running?
>
> Andrew
>
> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>
> > 500 Internal Server Error 
>
> > Exception inside application.
> > Daphne
>
> This error raises every time a file from static folder is accessed.
>
> What would be a proper way for debugging this? I've got  "justMyCode": 
> false setting in VS Code and that doesn't catch anything.
>
> Python 3.9.2
>
> channels  3.0.3
> daphne3.0.1
> Django3.2
>
>
> -- 
> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>
> -- 
> 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/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.co

Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
This is probably this error: 
https://github.com/django/asgiref/issues/251#issuecomment-814337170 - I'm going 
to switch the error to a warning and we'll see if that helps, then Daphne can 
have a fix added at a non-emergency pace.

Andrew

On Tue, Apr 6, 2021, at 12:19 PM, kradem wrote:
> Not sure if I understand you, I'm getting an server error in my browser with 
> rendered as quoted in the first post here with the following body:
> 
>500 Internal Server Error   body { 
> font-family: sans-serif; margin: 0; padding: 0; }  h1 { padding: 0.6em 0 
> 0.2em 20px; color: #896868; margin: 0; }  p { padding: 0 0 0.3em 20px; 
> margin: 0; }  footer { padding: 1em 0 0.3em 20px; color: #999; font-size: 
> 80%; font-style: italic; }500 Internal Server 
> Error Exception inside application. Daphne 
>   
> And as raw:
> 
> HTTP/1.1 500 Internal Server Error
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=utf-8
> 
> Dana utorak, 6. travnja 2021. u 18:26:34 UTC+2 korisnik Andrew Godwin napisao 
> je:
>> __
>> The tracebacks are there somewhere, you might have to look at the raw HTTP 
>> response in the browser to see them.
>> 
>> Andrew
>> 
>> On Tue, Apr 6, 2021, at 10:18 AM, kradem wrote:
>>> I'm afraid a "success" was caused by the browser cache or something 
>>> similar, the 3.3.3 version doesn't fix my problem. :(
>>> 
>>> > Could you get the traceback out of Django that's causing the 500 error 
>>> > and post it here? 
>>> 
>>> That was - kind of - my initial question, the only output I can get is the 
>>> message from the first post and Django's output like:
>>> 
>>> HTTP GET /static/css/style.css 500 [0.35, 127.0.0.1:37982]
>>> HTTP GET /static/js/jquery-2.2.4.min.js 500 [0.35, 127.0.0.1:37988]
>>> 
>>> Dana utorak, 6. travnja 2021. u 18:09:33 UTC+2 korisnik Andrew Godwin 
>>> napisao je:
>>>> __
>>>> Aha, glad to hear it! My apologies that we didn't catch that one before 
>>>> release yesterday.
>>>> 
>>>> Andrew
>>>> 
>>>> On Tue, Apr 6, 2021, at 10:01 AM, kradem wrote:
>>>>> Stop the press!! The 3.3.3 version is published in PyPi and after 
>>>>> installing it it all works well! :)
>>>>> 
>>>>> Thank you!
>>>>> Dana utorak, 6. travnja 2021. u 17:56:44 UTC+2 korisnik kradem napisao je:
>>>>>> Thank you very much for a quick response.
>>>>>> 
>>>>>> Yes, that's the problem:
>>>>>> 
>>>>>> asgiref   3.3.2
>>>>>> 
>>>>>> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
>>>>>> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), 
>>>>>> but static files are served well.
>>>>>> 
>>>>>> I tried with the very last version 3.3.3 (-e 
>>>>>> git+https://github.com/django/asgiref.git#egg=asgiref), but problem 
>>>>>> hasn't been fixed that way.
>>>>>> 
>>>>>> 
>>>>>> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
>>>>>> napisao je:
>>>>>>> __
>>>>>>> This may be related to https://github.com/django/asgiref/issues/251 - 
>>>>>>> what version of asgiref are you running?
>>>>>>> 
>>>>>>> Andrew
>>>>>>> 
>>>>>>> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>>>>>>>> > 500 Internal Server Error 
>>>>>>>> > Exception inside application.

>>>>>>>> > Daphne
>>>>>>>> 
>>>>>>>> This error raises every time a file from static folder is accessed.
>>>>>>>> 
>>>>>>>> What would be a proper way for debugging this? I've got  "justMyCode": 
>>>>>>>> false setting in VS Code and that doesn't catch anything.
>>>>>>>> 
>>>>>>>> Python 3.9.2
>>>>>>>> 
>>>>>>>> channels  3.0.3
>>>>>>>> daphne3.0.1
>>>>>>>> Django3.2
>>>>>>>> 
>>>>>>>> 

>>>>>>>> -- 
>>>>>>>> You received thi

Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread kradem
Not sure if I understand you, I'm getting an server error in my browser 
with rendered as quoted in the first post here with the following body:

   500 Internal Server Error   body { 
font-family: sans-serif; margin: 0; padding: 0; }  h1 { padding: 0.6em 0 
0.2em 20px; color: #896868; margin: 0; }  p { padding: 0 0 0.3em 20px; 
margin: 0; }  footer { padding: 1em 0 0.3em 20px; color: #999; font-size: 
80%; font-style: italic; }500 Internal Server 
Error Exception inside application. Daphne 
  

And as raw:

HTTP/1.1 500 Internal Server Error
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

Dana utorak, 6. travnja 2021. u 18:26:34 UTC+2 korisnik Andrew Godwin 
napisao je:

> The tracebacks are there somewhere, you might have to look at the raw HTTP 
> response in the browser to see them.
>
> Andrew
>
> On Tue, Apr 6, 2021, at 10:18 AM, kradem wrote:
>
> I'm afraid a "success" was caused by the browser cache or something 
> similar, the 3.3.3 version doesn't fix my problem. :(
>
> > Could you get the traceback out of Django that's causing the 500 error 
> and post it here? 
>
> That was - kind of - my initial question, the only output I can get is the 
> message from the first post and Django's output like:
>
> HTTP GET /static/css/style.css 500 [0.35, 127.0.0.1:37982]
> HTTP GET /static/js/jquery-2.2.4.min.js 500 [0.35, 127.0.0.1:37988]
>
> Dana utorak, 6. travnja 2021. u 18:09:33 UTC+2 korisnik Andrew Godwin 
> napisao je:
>
>
> Aha, glad to hear it! My apologies that we didn't catch that one before 
> release yesterday.
>
> Andrew
>
> On Tue, Apr 6, 2021, at 10:01 AM, kradem wrote:
>
> Stop the press!! The 3.3.3 version is published in PyPi and after 
> installing it it all works well! :)
>
> Thank you!
> Dana utorak, 6. travnja 2021. u 17:56:44 UTC+2 korisnik kradem napisao je:
>
> Thank you very much for a quick response.
>
> Yes, that's the problem:
>
> asgiref   3.3.2
>
> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but 
> static files are served well.
>
> I tried with the very last version 3.3.3 (-e git+
> https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
> been fixed that way.
>
>
> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
> napisao je:
>
>
> This may be related to https://github.com/django/asgiref/issues/251 - 
> what version of asgiref are you running?
>
> Andrew
>
> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>
> > 500 Internal Server Error 
>
> > Exception inside application.
> > Daphne
>
> This error raises every time a file from static folder is accessed.
>
> What would be a proper way for debugging this? I've got  "justMyCode": 
> false setting in VS Code and that doesn't catch anything.
>
> Python 3.9.2
>
> channels  3.0.3
> daphne3.0.1
> Django3.2
>
>
> -- 
> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>
> -- 
> 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/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
> -- 
> 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/7a5a269b-9099-4bbf-af72-65b6c77bb511n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/7a5a269b-9099-4bbf-af72-65b6c77bb511n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/16996aec-33cb-4e3e-972b-effed440bed9n%40googlegroups.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
The tracebacks are there somewhere, you might have to look at the raw HTTP 
response in the browser to see them.

Andrew

On Tue, Apr 6, 2021, at 10:18 AM, kradem wrote:
> I'm afraid a "success" was caused by the browser cache or something similar, 
> the 3.3.3 version doesn't fix my problem. :(
> 
> > Could you get the traceback out of Django that's causing the 500 error and 
> > post it here? 
> 
> That was - kind of - my initial question, the only output I can get is the 
> message from the first post and Django's output like:
> 
> HTTP GET /static/css/style.css 500 [0.35, 127.0.0.1:37982]
> HTTP GET /static/js/jquery-2.2.4.min.js 500 [0.35, 127.0.0.1:37988]
> 
> Dana utorak, 6. travnja 2021. u 18:09:33 UTC+2 korisnik Andrew Godwin napisao 
> je:
>> __
>> Aha, glad to hear it! My apologies that we didn't catch that one before 
>> release yesterday.
>> 
>> Andrew
>> 
>> On Tue, Apr 6, 2021, at 10:01 AM, kradem wrote:
>>> Stop the press!! The 3.3.3 version is published in PyPi and after 
>>> installing it it all works well! :)
>>> 
>>> Thank you!
>>> Dana utorak, 6. travnja 2021. u 17:56:44 UTC+2 korisnik kradem napisao je:
>>>> Thank you very much for a quick response.
>>>> 
>>>> Yes, that's the problem:
>>>> 
>>>> asgiref   3.3.2
>>>> 
>>>> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
>>>> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), 
>>>> but static files are served well.
>>>> 
>>>> I tried with the very last version 3.3.3 (-e 
>>>> git+https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
>>>> been fixed that way.
>>>> 
>>>> 
>>>> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
>>>> napisao je:
>>>>> __
>>>>> This may be related to https://github.com/django/asgiref/issues/251 - 
>>>>> what version of asgiref are you running?
>>>>> 
>>>>> Andrew
>>>>> 
>>>>> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>>>>>> > 500 Internal Server Error 
>>>>>> > Exception inside application.

>>>>>> > Daphne
>>>>>> 
>>>>>> This error raises every time a file from static folder is accessed.
>>>>>> 
>>>>>> What would be a proper way for debugging this? I've got  "justMyCode": 
>>>>>> false setting in VS Code and that doesn't catch anything.
>>>>>> 
>>>>>> Python 3.9.2
>>>>>> 
>>>>>> channels  3.0.3
>>>>>> daphne3.0.1
>>>>>> Django3.2
>>>>>> 
>>>>>> 

>>>>>> -- 
>>>>>> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>.
>>>>> 
>>> 

>>> -- 
>>> 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/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com?utm_medium=email_source=footer>.
> 

> -- 
> 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/7a5a269b-9099-4bbf-af72-65b6c77bb511n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/7a5a269b-9099-4bbf-af72-65b6c77bb511n%40googlegroups.com?utm_medium=email_source=footer>.

-- 
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/789cfaea-899b-4f23-885b-4e2857e7dbd1%40www.fastmail.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread kradem
I'm afraid a "success" was caused by the browser cache or something 
similar, the 3.3.3 version doesn't fix my problem. :(

> Could you get the traceback out of Django that's causing the 500 error 
and post it here? 

That was - kind of - my initial question, the only output I can get is the 
message from the first post and Django's output like:

HTTP GET /static/css/style.css 500 [0.35, 127.0.0.1:37982]
HTTP GET /static/js/jquery-2.2.4.min.js 500 [0.35, 127.0.0.1:37988]

Dana utorak, 6. travnja 2021. u 18:09:33 UTC+2 korisnik Andrew Godwin 
napisao je:

> Aha, glad to hear it! My apologies that we didn't catch that one before 
> release yesterday.
>
> Andrew
>
> On Tue, Apr 6, 2021, at 10:01 AM, kradem wrote:
>
> Stop the press!! The 3.3.3 version is published in PyPi and after 
> installing it it all works well! :)
>
> Thank you!
> Dana utorak, 6. travnja 2021. u 17:56:44 UTC+2 korisnik kradem napisao je:
>
> Thank you very much for a quick response.
>
> Yes, that's the problem:
>
> asgiref   3.3.2
>
> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but 
> static files are served well.
>
> I tried with the very last version 3.3.3 (-e git+
> https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
> been fixed that way.
>
>
> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
> napisao je:
>
>
> This may be related to https://github.com/django/asgiref/issues/251 - 
> what version of asgiref are you running?
>
> Andrew
>
> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>
> > 500 Internal Server Error 
>
> > Exception inside application.
> > Daphne
>
> This error raises every time a file from static folder is accessed.
>
> What would be a proper way for debugging this? I've got  "justMyCode": 
> false setting in VS Code and that doesn't catch anything.
>
> Python 3.9.2
>
> channels  3.0.3
> daphne3.0.1
> Django3.2
>
>
> -- 
> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>
> -- 
> 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/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>

-- 
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/7a5a269b-9099-4bbf-af72-65b6c77bb511n%40googlegroups.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
Aha, glad to hear it! My apologies that we didn't catch that one before release 
yesterday.

Andrew

On Tue, Apr 6, 2021, at 10:01 AM, kradem wrote:
> Stop the press!! The 3.3.3 version is published in PyPi and after installing 
> it it all works well! :)
> 
> Thank you!
> Dana utorak, 6. travnja 2021. u 17:56:44 UTC+2 korisnik kradem napisao je:
>> Thank you very much for a quick response.
>> 
>> Yes, that's the problem:
>> 
>> asgiref   3.3.2
>> 
>> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
>> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but 
>> static files are served well.
>> 
>> I tried with the very last version 3.3.3 (-e 
>> git+https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
>> been fixed that way.
>> 
>> 
>> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
>> napisao je:
>>> __
>>> This may be related to https://github.com/django/asgiref/issues/251 - what 
>>> version of asgiref are you running?
>>> 
>>> Andrew
>>> 
>>> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>>>> > 500 Internal Server Error 
>>>> > Exception inside application.

>>>> > Daphne
>>>> 
>>>> This error raises every time a file from static folder is accessed.
>>>> 
>>>> What would be a proper way for debugging this? I've got  "justMyCode": 
>>>> false setting in VS Code and that doesn't catch anything.
>>>> 
>>>> Python 3.9.2
>>>> 
>>>> channels  3.0.3
>>>> daphne3.0.1
>>>> Django3.2
>>>> 
>>>> 

>>>> -- 
>>>> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>.
>>> 
> 

> -- 
> 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/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com?utm_medium=email_source=footer>.

-- 
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/8c9616ad-021a-4162-8f52-b0be27f46d94%40www.fastmail.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread kradem
Stop the press!! The 3.3.3 version is published in PyPi and after 
installing it it all works well! :)

Thank you!

Dana utorak, 6. travnja 2021. u 17:56:44 UTC+2 korisnik kradem napisao je:

> Thank you very much for a quick response.
>
> Yes, that's the problem:
>
> asgiref   3.3.2
>
> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but 
> static files are served well.
>
> I tried with the very last version 3.3.3 (-e git+
> https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
> been fixed that way.
>
>
> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
> napisao je:
>
>> This may be related to https://github.com/django/asgiref/issues/251 - 
>> what version of asgiref are you running?
>>
>> Andrew
>>
>> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>>
>> > 500 Internal Server Error 
>>
>> > Exception inside application.
>> > Daphne
>>
>> This error raises every time a file from static folder is accessed.
>>
>> What would be a proper way for debugging this? I've got  "justMyCode": 
>> false setting in VS Code and that doesn't catch anything.
>>
>> Python 3.9.2
>>
>> channels  3.0.3
>> daphne3.0.1
>> Django3.2
>>
>>
>> -- 
>> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>>
>>

-- 
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/bd27e80e-de40-4dfd-b215-7855f537b191n%40googlegroups.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
asgiref 3.3.2 introduced stricter checks for what an async function is, so I 
would imagine that's the problem. 3.3.3 fixes some of them, but I'm guessing 
you might have a different flavour of problem.

Could you get the traceback out of Django that's causing the 500 error and post 
it here? 

Andrew

On Tue, Apr 6, 2021, at 9:56 AM, kradem wrote:
> Thank you very much for a quick response.
> 
> Yes, that's the problem:
> 
> asgiref   3.3.2
> 
> When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but 
> static files are served well.
> 
> I tried with the very last version 3.3.3 (-e 
> git+https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
> been fixed that way.
> 
> 
> Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin napisao 
> je:
>> __
>> This may be related to https://github.com/django/asgiref/issues/251 - what 
>> version of asgiref are you running?
>> 
>> Andrew
>> 
>> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>>> > 500 Internal Server Error 
>>> > Exception inside application.

>>> > Daphne
>>> 
>>> This error raises every time a file from static folder is accessed.
>>> 
>>> What would be a proper way for debugging this? I've got  "justMyCode": 
>>> false setting in VS Code and that doesn't catch anything.
>>> 
>>> Python 3.9.2
>>> 
>>> channels  3.0.3
>>> daphne3.0.1
>>> Django3.2
>>> 
>>> 

>>> -- 
>>> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>.
>> 
> 

> -- 
> 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/5c9ffb1b-c644-41c6-a5c3-a52bb95a1893n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/5c9ffb1b-c644-41c6-a5c3-a52bb95a1893n%40googlegroups.com?utm_medium=email_source=footer>.

-- 
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/04bc66bc-1cfc-4c02-8333-45b12af186e8%40www.fastmail.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread kradem
Thank you very much for a quick response.

Yes, that's the problem:

asgiref   3.3.2

When I downgrade it to 3.3.1 Django complains ("django 3.2 requires 
asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but 
static files are served well.

I tried with the very last version 3.3.3 (-e 
git+https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't 
been fixed that way.


Dana utorak, 6. travnja 2021. u 17:46:31 UTC+2 korisnik Andrew Godwin 
napisao je:

> This may be related to https://github.com/django/asgiref/issues/251 - 
> what version of asgiref are you running?
>
> Andrew
>
> On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
>
> > 500 Internal Server Error 
>
> > Exception inside application.
> > Daphne
>
> This error raises every time a file from static folder is accessed.
>
> What would be a proper way for debugging this? I've got  "justMyCode": 
> false setting in VS Code and that doesn't catch anything.
>
> Python 3.9.2
>
> channels  3.0.3
> daphne3.0.1
> Django3.2
>
>
> -- 
> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/5c9ffb1b-c644-41c6-a5c3-a52bb95a1893n%40googlegroups.com.


Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
This may be related to https://github.com/django/asgiref/issues/251 - what 
version of asgiref are you running?

Andrew

On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote:
> > 500 Internal Server Error 
> > Exception inside application.

> > Daphne
> 
> This error raises every time a file from static folder is accessed.
> 
> What would be a proper way for debugging this? I've got  "justMyCode": false 
> setting in VS Code and that doesn't catch anything.
> 
> Python 3.9.2
> 
> channels  3.0.3
> daphne3.0.1
> Django3.2
> 
> 

> -- 
> 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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%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/5db33183-8f45-43b9-9485-9e909bea5058%40www.fastmail.com.


Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread kradem
> 500 Internal Server Error 

> Exception inside application.
> Daphne

This error raises every time a file from static folder is accessed.

What would be a proper way for debugging this? I've got  "justMyCode": 
false setting in VS Code and that doesn't catch anything.

Python 3.9.2

channels  3.0.3
daphne3.0.1
Django3.2

-- 
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/9db2fc19-e87c-4a69-ab9e-6c53ec56d6fcn%40googlegroups.com.


Re: Use DropBox to Store Static Files in Django

2021-01-28 Thread Kasper Laudrup

On 1/28/21 8:08 AM, Samiddha সমিদ্ধ wrote:
*How to use DropBox to use/serve Static Files and Upload Media in django 
project?*


I use the method that mentioned here: django-storages[dropbox] 
<https://django-storages.readthedocs.io/en/latest/backends/dropbox.html>
And try this method: django-dropbox-storage 
<https://pypi.org/project/django-dropbox-storage/>


But both method doesn't work. So what's the right way?



Make it work, then share the required changes with the project 
maintainers. That is the right way.


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/4a407f04-78c5-e847-6d3c-34754af578cc%40stacktrace.dk.


Use DropBox to Store Static Files in Django

2021-01-27 Thread Samiddha সমিদ্ধ


*How to use DropBox to use/serve Static Files and Upload Media in django 
project?*

I use the method that mentioned here:  django-storages[dropbox] 
<https://django-storages.readthedocs.io/en/latest/backends/dropbox.html>
And also try this method:  django-dropbox-storage 
<https://pypi.org/project/django-dropbox-storage/>

But both method doesn’t work. So what’s the right way?

-- 
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/e001c012-a364-43e5-b5ba-e049d687b013n%40googlegroups.com.


Use DropBox to Store Static Files in Django

2021-01-27 Thread Samiddha সমিদ্ধ
*How to use DropBox to use/serve Static Files and Upload Media in django 
project?*

I use the method that mentioned here: django-storages[dropbox] 
<https://django-storages.readthedocs.io/en/latest/backends/dropbox.html>
And try this method: django-dropbox-storage 
<https://pypi.org/project/django-dropbox-storage/>

But both method doesn't work. So what's the right way?

-- 
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/a639598d-e333-4413-9c01-aea033a3c2f1n%40googlegroups.com.


Re: Static files not work

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 We can help you in this and related tasks at fair prices. Reply or send
email to divy...@pythonmate.com
Best Regards,
Divyesh Khamele,
Pythonmate

On Thu, 1 Oct 2020, 5:53 pm kkwaq...@gmail.com, 
wrote:

> *Error*
>
> *[image: 1.jpg]*
>
> *Error line number 2*
>
> *[image: 2.jpg]*
>
>
> *settingspy*
>
> *[image: 3.jpg]*
>
> *html file*
>
> *[image: 4.jpg]*
>
> --
> 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/35152588-7c0e-44e3-b7bc-fc48bfa81b37n%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/CAH9mneXKOCEcMahvg-fhWf65pq%3DQAd6wVNzarr9pM34e8X6Q-g%40mail.gmail.com.


Re: Static files not work

2020-10-02 Thread MUGOYA DIHFAHSIH
To become an expert in django is very simple, practice django documentation
regularly as you work on real projects

On Thu, Oct 1, 2020, 16:10 waqar khan  wrote:

> Thank you bro.
> I am fresher ,
> How to expert django framework any tips ..
>
> On Thu, Oct 1, 2020 at 5:58 PM MUGOYA DIHFAHSIH 
> wrote:
>
>> instead of loading staticfiles you use {{ load static}}
>>
>> On Thu, 1 Oct 2020 at 15:23, kkwaq...@gmail.com 
>> wrote:
>>
>>> *Error*
>>>
>>> *[image: 1.jpg]*
>>>
>>> *Error line number 2*
>>>
>>> *[image: 2.jpg]*
>>>
>>>
>>> *settingspy*
>>>
>>> *[image: 3.jpg]*
>>>
>>> *html file*
>>>
>>> *[image: 4.jpg]*
>>>
>>> --
>>> 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/35152588-7c0e-44e3-b7bc-fc48bfa81b37n%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/CAP%3DJD9yG%3DkcarU-dUCCQZh-%3DS9empaEqRj7EY3huivCWmcXM-Q%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/CA%2B08CAO71_9LCsrQH%2BSuhLwEynsibVjOCrJrN3VJY3qa%3DNH8sQ%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/CAP%3DJD9zdiP6C9qs3KeqC-TQs2mvFr8_CH7y-ASaOvmZUbLY7cA%40mail.gmail.com.


Re: Static files not work

2020-10-01 Thread waqar khan
Thank you bro.
I am fresher ,
How to expert django framework any tips ..

On Thu, Oct 1, 2020 at 5:58 PM MUGOYA DIHFAHSIH 
wrote:

> instead of loading staticfiles you use {{ load static}}
>
> On Thu, 1 Oct 2020 at 15:23, kkwaq...@gmail.com 
> wrote:
>
>> *Error*
>>
>> *[image: 1.jpg]*
>>
>> *Error line number 2*
>>
>> *[image: 2.jpg]*
>>
>>
>> *settingspy*
>>
>> *[image: 3.jpg]*
>>
>> *html file*
>>
>> *[image: 4.jpg]*
>>
>> --
>> 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/35152588-7c0e-44e3-b7bc-fc48bfa81b37n%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/CAP%3DJD9yG%3DkcarU-dUCCQZh-%3DS9empaEqRj7EY3huivCWmcXM-Q%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/CA%2B08CAO71_9LCsrQH%2BSuhLwEynsibVjOCrJrN3VJY3qa%3DNH8sQ%40mail.gmail.com.


Re: Static files not work

2020-10-01 Thread MUGOYA DIHFAHSIH
instead of loading staticfiles you use {{ load static}}

On Thu, 1 Oct 2020 at 15:23, kkwaq...@gmail.com 
wrote:

> *Error*
>
> *[image: 1.jpg]*
>
> *Error line number 2*
>
> *[image: 2.jpg]*
>
>
> *settingspy*
>
> *[image: 3.jpg]*
>
> *html file*
>
> *[image: 4.jpg]*
>
> --
> 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/35152588-7c0e-44e3-b7bc-fc48bfa81b37n%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/CAP%3DJD9yG%3DkcarU-dUCCQZh-%3DS9empaEqRj7EY3huivCWmcXM-Q%40mail.gmail.com.


Static files not work

2020-10-01 Thread kkwaq...@gmail.com
*Error*

*[image: 1.jpg]*

*Error line number 2*

*[image: 2.jpg]*


*settingspy*

*[image: 3.jpg]*

*html file*

*[image: 4.jpg]*

-- 
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/35152588-7c0e-44e3-b7bc-fc48bfa81b37n%40googlegroups.com.


403 serving static files

2020-05-25 Thread みやうち`
Hi,

I'm trying to serve static files using nginx, but nginx gives following 
error.
- [error] 8202#8202: *10 open() "/home/user/myproject/media/xxx.jpg" failed 
(13: Permission denied)

I've tried giving all users permission to this directory and it didn't 
change.
What is the cause?

I'm using mod_wsgi 4.7.1 and apache 2.4.
my apache setting is here.

WSGIPythonHome /home/user/mypythonenv
WSGIScriptAlias / /home/user/myproject/myproject/wsgi.py
WSGIPythonPath 
/home/user/myproject/myproject:/home/user/mypythonenv/lib/python3.6/site-packages
WSGIApplicationGroup %{GLOBAL}


 
  Require all granted
 


Alias /static/ /home/user/myproject/collected_static/

 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted


Alias /media/ /home/user/myproject/media/

 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted


-- 
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/23624e5b-2701-45fb-9672-c179cb979403%40googlegroups.com.


Re: Django Media Static Files

2020-05-07 Thread Ilda Pedro
Hello, Jorge!

Thanks Jorge it already worked!

On Wed, May 6, 2020 at 3:38 PM Jorge Gimeno  wrote:

>
>
> On Wed, May 6, 2020 at 3:09 AM ilda.pedro1993 
> wrote:
>
>> Hello, everyone!
>> My name is Ilda, i'm getting a page not found when trying to load django
>> media files.
>>
>> My django settings file looks like below:
>>
>> [image: Captura de Tela (148).png]
>>
>>
>>
>>
>>
>>
>>
>> And saw many suggestions to concatenate my app urls with the static one
>> like:
>>
>> urlpatterns +=static(setting.MEDIA_URL, document_root=MEDIA_ROOT)
>>
>> But after storing the media files when i try to load a get always a not
>> found page.
>>
>> Im using Django 3.0.2
>>
>> Can anybody help me out there?
>>
>> --
>> 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/c08b99df-9423-46b6-8edf-34f01f550bc7%40googlegroups.com
>> 
>> .
>>
>
> Are you getting a 404 in production, or while using the development server
> (manage.py runserver)?
>
> -Jorge
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANfN%3DK8F%2BR1JmugS1jj9wzQ6C%2BkdjfcL6OL75sU_6pzz-2cesQ%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/CAL%3DqnfXP_YL5kXZQVjy0Up-x_-xa9KAxup1quvKVQ%3Dd08uWWpQ%40mail.gmail.com.


Re: Django Media Static Files

2020-05-06 Thread Jorge Gimeno
On Wed, May 6, 2020 at 3:09 AM ilda.pedro1993 
wrote:

> Hello, everyone!
> My name is Ilda, i'm getting a page not found when trying to load django
> media files.
>
> My django settings file looks like below:
>
> [image: Captura de Tela (148).png]
>
>
>
>
>
>
>
> And saw many suggestions to concatenate my app urls with the static one
> like:
>
> urlpatterns +=static(setting.MEDIA_URL, document_root=MEDIA_ROOT)
>
> But after storing the media files when i try to load a get always a not
> found page.
>
> Im using Django 3.0.2
>
> Can anybody help me out there?
>
> --
> 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/c08b99df-9423-46b6-8edf-34f01f550bc7%40googlegroups.com
> 
> .
>

Are you getting a 404 in production, or while using the development server
(manage.py runserver)?

-Jorge

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


Django Media Static Files

2020-05-06 Thread ilda.pedro1993
Hello, everyone!
My name is Ilda, i'm getting a page not found when trying to load django 
media files. 

My django settings file looks like below:

[image: Captura de Tela (148).png] 







And saw many suggestions to concatenate my app urls with the static one 
like:

urlpatterns +=static(setting.MEDIA_URL, document_root=MEDIA_ROOT)

But after storing the media files when i try to load a get always a not 
found page.

Im using Django 3.0.2

Can anybody help me out there?

-- 
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/c08b99df-9423-46b6-8edf-34f01f550bc7%40googlegroups.com.


Re: Why can't Nginx find Django's static files?

2020-02-21 Thread Stephen J. Butler
The way production servers are setup with Django uses this kind of request
workflow:

client /myapp1 --> nginx:8080 ---(proxy)---> gunicorn:8000 (runs python)
client /myapp2 --> nginx:8080 ---(proxy)---> gunicorn:8000 (runs python)
client /myapp3 --> nginx:8080 ---(proxy)---> gunicorn:8000 (runs python)
client /static/somefile1.css ---> nginx:8080 (reads from the filesystem)
client /static/somefile2.css ---> nginx:8080 (reads from the filesystem)

Notice how everything first goes to nginx, and then your nginx either
proxies/forwards the request to gunicorn for the python code, or it serves
up the static file itself. That's what we want to do. gunicorn is very good
at running dynamic python code but it's very bad at serving up static
files. nginx is very good at serving static files but can't run python
code. See how they work together?

Here's another way to think about it. Take a look sometime at the number of
requests a browser makes to a simple Django website that maybe has 10
images on it, 5 CSS files, and 5 JS files. The initial request fetches
dynamic content and the python code, but then there are 20+ (!!) other
requests that fetch all the static things.

So in that case, only 5% of your requests need to run in gunicorn and the
rest of them should be handled by nginx directly. If you did the bad thing
and just let gunicorn handle it all then you'd need to provision x20 the
resources for gunicorn to make your site have good response times under
load! That's because you'd be handling x20 the connections just to serve
static files.

Therefore, every good sysadmin puts gunicorn behind nginx or apache or some
other proxy technology. It says "Let the frontend server (nginx, apache,
CloudFront, CDN, etc) do the easy task of serving up files from /static,
and send everything else to the backend server (gunicorn) for the hard part
of generating dynamic content."

Now, you setup your nginx and gunicorn properly as far as I can tell. The
only bad thing you did was talk to gunicorn directly instead of going
through the nginx proxy like you should have.

On Fri, Feb 21, 2020 at 11:49 AM Robert F. 
wrote:

>
>
> On Thursday, February 20, 2020 at 8:52:31 AM UTC-8, Stephen J. Butler
> wrote:
>>
>> Django only serves up static files itself when run using runserver. This
>> is meant for development and not production use. When you run it through
>> gunicorn the Django framework won't serve up static files. That's why you
>> connections to :8000 (gunicorn directly, bypassing nginx) don't work right.
>>
>> For running in production/gunicorn you need to run "collectstatic" after
>> changes, and connect to nginx (probably port 80/443) so that the
>> "location/alias" block works as intended and you get your static files.
>>
>>
>>> I understand what you're saying but I don't understand specifically what
>>> it is that I'm doing wrong.  Should I not start Gunicorn with ":8000"?  Do
>>> I need to modify my Nginx configuration file?  I don't quite see how all of
>>> these pieces work together and which piece (or pieces) are wrong.  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/f1cd8e78-17ae-47c0-91e8-732a52c9%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f1cd8e78-17ae-47c0-91e8-732a52c9%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAD4ANxWga%2BXA4N%2BYTBxG9spDLUpXdcK3g9o0s2C54tdfpFZrGQ%40mail.gmail.com.


Re: Why can't Nginx find Django's static files?

2020-02-21 Thread אורי
If it's a development server and not production, you can add something like
this to your urls.py:

from django.conf import settings as django_settings
from django.conf.urls.static import static

...

if (django_settings.DEBUG):
urlpatterns = static(prefix=django_settings.MEDIA_URL,
document_root=django_settings.MEDIA_ROOT) + urlpatterns
אורי
u...@speedy.net


On Thu, Feb 20, 2020 at 6:36 PM Robert F.  wrote:

> I'm trying to understand how static files are served up by Django using a
> project I've created on my Mac using Django 3, Gunicorn, and Nginx.  The
> website serves up templates correctly except that the templates can't see
> my CSS stylesheet.  When I go to a page, for example ```
> 127.0.0.1:8000/app1/``` <http://127.0.0.1:8000/app1/> and view the
> source, I see this in my HTML template:
>
> 
>
> If I click on the href link, I get a page "Not Found" at the address ```
> http://127.0.0.1:8000/static/css/main.css```
> <http://127.0.0.1:8000/static/css/main.css>.  This seems like it should
> be the correct link but the template can't see the main.css stylesheet as I
> would expect.
>
> Here are the relevant files in my 'mysite' project located in
> /Users/me/projects/django/django-staticfiles:
>
> ├── app1
> │   ├── templates
> │   │   └── app1
> │   │   └── index.html
> ├── mysite
> │   ├── settings.py
> │   └── wsgi.py
> ├── static
> │   └── css
> │   └── main.css
> ├── static-final
> │   ├── admin
> │   │   ├── css
> │   │   ├── fonts
> │   │   ├── img
> │   │   └── js
> │   └── css
> │   └── main.css
>
> Here are the relevant settings:
>
> # mysite/settings.py
> ...
> DEBUG = False
> ALLOWED_HOSTS = ['127.0.0.1', ]
> ...
> INSTALLED_APPS = [
> 'django.contrib.staticfiles',
> 'app1',
> ]
> ...
> STATIC_URL = '/static/'
> STATICFILES_DIRS = (
> os.path.join(BASE_DIR, 'static'),
> )
> STATIC_ROOT = os.path.join(BASE_DIR, 'static-final/')
> ...
>
> I installed Gunicorn into my virtual environment and run it with this
> command:
>
> gunicorn --bind 0.0.0.0:8000 mysite.wsgi
>
> I installed Nginx using Homebrew.  Here is the part of nginx.conf that
> includes my Nginx settings:
>
> # /usr/local/etc/nginx.conf
> ...
> http {
> ...
> server {
> listen  8080;
> server_name localhost;
> }
> ...
> include server/*;
> }
>
> Here is my Nginx configuration:
>
> # /usr/local/etc/nginx/servers/django-staticfiles
> server {
> listen 80;
> server_name 127.0.0.1;
>
> location / {
> proxy_pass http://127.0.0.1:8000;
> }
>
> location /static/ {
> alias /Users/me/projects/django/django-staticfiles/static-final/;
> }
> }
>
> I should add that when I stop Gunicorn and start Django's development
> server with DEBUG = True, the app1 template accesses the main.css file
> correctly.  It just can't see it when I'm running Gunicorn and Nginx.  I
> realize that I don't have a real need to run Gunicorn/Nginx on my Mac, but
> I've just set it up so I can compare and contrast how Django manages static
> files in development versus production.
>
> --
> 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/75f129a6-2dbf-47cc-b4ea-08008b30b047%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/75f129a6-2dbf-47cc-b4ea-08008b30b047%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CABD5YeEiYOvgNXBPX6aNTAwvqP6NWAX4HdvPDbHurY4h5R%2BMHQ%40mail.gmail.com.


Re: Why can't Nginx find Django's static files?

2020-02-21 Thread Robert F.


On Thursday, February 20, 2020 at 8:52:31 AM UTC-8, Stephen J. Butler wrote:
>
> Django only serves up static files itself when run using runserver. This 
> is meant for development and not production use. When you run it through 
> gunicorn the Django framework won't serve up static files. That's why you 
> connections to :8000 (gunicorn directly, bypassing nginx) don't work right.
>
> For running in production/gunicorn you need to run "collectstatic" after 
> changes, and connect to nginx (probably port 80/443) so that the 
> "location/alias" block works as intended and you get your static files.
>
>
>> I understand what you're saying but I don't understand specifically what 
>> it is that I'm doing wrong.  Should I not start Gunicorn with ":8000"?  Do 
>> I need to modify my Nginx configuration file?  I don't quite see how all of 
>> these pieces work together and which piece (or pieces) are wrong.  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/f1cd8e78-17ae-47c0-91e8-732a52c9%40googlegroups.com.


Re: Why can't Nginx find Django's static files?

2020-02-21 Thread Robert F.
Thanks but I'm not interested in using Whitenoise.

On Friday, February 21, 2020 at 6:22:40 AM UTC-8, Jody Fitzpatrick wrote:
>
> Take a look at whitenoise for django, this should help you. 
>
> On Thursday, February 20, 2020 at 11:35:51 AM UTC-5, Robert F. wrote:
>>
>> I'm trying to understand how static files are served up by Django using a 
>> project I've created on my Mac using Django 3, Gunicorn, and Nginx.  The 
>> website serves up templates correctly except that the templates can't see 
>> my CSS stylesheet.  When I go to a page, for example ```
>> 127.0.0.1:8000/app1/``` <http://127.0.0.1:8000/app1/> and view the 
>> source, I see this in my HTML template:
>>
>> 
>>
>> If I click on the href link, I get a page "Not Found" at the address ```
>> http://127.0.0.1:8000/static/css/main.css``` 
>> <http://127.0.0.1:8000/static/css/main.css>.  This seems like it should 
>> be the correct link but the template can't see the main.css stylesheet as I 
>> would expect.
>>
>> Here are the relevant files in my 'mysite' project located in 
>> /Users/me/projects/django/django-staticfiles:
>>
>> ├── app1
>> │   ├── templates
>> │   │   └── app1
>> │   │   └── index.html
>> ├── mysite
>> │   ├── settings.py
>> │   └── wsgi.py
>> ├── static
>> │   └── css
>> │   └── main.css
>> ├── static-final
>> │   ├── admin
>> │   │   ├── css
>> │   │   ├── fonts
>> │   │   ├── img
>> │   │   └── js
>> │   └── css
>> │   └── main.css
>>
>> Here are the relevant settings:
>>
>> # mysite/settings.py
>> ...
>> DEBUG = False
>> ALLOWED_HOSTS = ['127.0.0.1', ]
>> ...
>> INSTALLED_APPS = [
>> 'django.contrib.staticfiles',
>> 'app1',
>> ]
>> ...
>> STATIC_URL = '/static/'
>> STATICFILES_DIRS = (
>> os.path.join(BASE_DIR, 'static'),
>> )
>> STATIC_ROOT = os.path.join(BASE_DIR, 'static-final/')
>> ...
>>
>> I installed Gunicorn into my virtual environment and run it with this 
>> command:
>>
>> gunicorn --bind 0.0.0.0:8000 mysite.wsgi
>>
>> I installed Nginx using Homebrew.  Here is the part of nginx.conf that 
>> includes my Nginx settings:
>>
>> # /usr/local/etc/nginx.conf
>> ...
>> http {
>> ...
>> server {
>> listen  8080;
>> server_name localhost;
>> }
>> ...
>> include server/*;
>> }
>>
>> Here is my Nginx configuration:
>>
>> # /usr/local/etc/nginx/servers/django-staticfiles
>> server {
>> listen 80;
>> server_name 127.0.0.1;
>>
>> location / {
>>     proxy_pass http://127.0.0.1:8000;
>> }
>>
>> location /static/ {
>> alias /Users/me/projects/django/django-staticfiles/static-final/;
>> }
>> }
>>
>> I should add that when I stop Gunicorn and start Django's development 
>> server with DEBUG = True, the app1 template accesses the main.css file 
>> correctly.  It just can't see it when I'm running Gunicorn and Nginx.  I 
>> realize that I don't have a real need to run Gunicorn/Nginx on my Mac, but 
>> I've just set it up so I can compare and contrast how Django manages static 
>> files in development versus production.
>>
>>

-- 
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/64a79357-c5db-4da6-8320-4b19d5fa51d1%40googlegroups.com.


Re: Why can't Nginx find Django's static files?

2020-02-21 Thread Aldian Fazrihady
When you are using Nginx, it is assumed you are trying to make a production
environment.
On production environments you don't want your backend code execution to be
slowed down by something like serving people downloading static images.
On production environments, Django will focus on its purpose, which is to
handle application code logic.

Static files handling should be delegated to other server such as Nginx.
The static file folder will be referenced directly by Nginx.
Most of static files, such as images are so irrelevant to your backend
application logic so that they can be cached on the browser.


On Thu, Feb 20, 2020 at 11:36 PM Robert F. 
wrote:

> I'm trying to understand how static files are served up by Django using a
> project I've created on my Mac using Django 3, Gunicorn, and Nginx.  The
> website serves up templates correctly except that the templates can't see
> my CSS stylesheet.  When I go to a page, for example ```
> 127.0.0.1:8000/app1/``` <http://127.0.0.1:8000/app1/> and view the
> source, I see this in my HTML template:
>
> 
>
> If I click on the href link, I get a page "Not Found" at the address ```
> http://127.0.0.1:8000/static/css/main.css```
> <http://127.0.0.1:8000/static/css/main.css>.  This seems like it should
> be the correct link but the template can't see the main.css stylesheet as I
> would expect.
>
> Here are the relevant files in my 'mysite' project located in
> /Users/me/projects/django/django-staticfiles:
>
> ├── app1
> │   ├── templates
> │   │   └── app1
> │   │   └── index.html
> ├── mysite
> │   ├── settings.py
> │   └── wsgi.py
> ├── static
> │   └── css
> │   └── main.css
> ├── static-final
> │   ├── admin
> │   │   ├── css
> │   │   ├── fonts
> │   │   ├── img
> │   │   └── js
> │   └── css
> │   └── main.css
>
> Here are the relevant settings:
>
> # mysite/settings.py
> ...
> DEBUG = False
> ALLOWED_HOSTS = ['127.0.0.1', ]
> ...
> INSTALLED_APPS = [
> 'django.contrib.staticfiles',
> 'app1',
> ]
> ...
> STATIC_URL = '/static/'
> STATICFILES_DIRS = (
> os.path.join(BASE_DIR, 'static'),
> )
> STATIC_ROOT = os.path.join(BASE_DIR, 'static-final/')
> ...
>
> I installed Gunicorn into my virtual environment and run it with this
> command:
>
> gunicorn --bind 0.0.0.0:8000 mysite.wsgi
>
> I installed Nginx using Homebrew.  Here is the part of nginx.conf that
> includes my Nginx settings:
>
> # /usr/local/etc/nginx.conf
> ...
> http {
> ...
> server {
> listen  8080;
> server_name localhost;
> }
> ...
> include server/*;
> }
>
> Here is my Nginx configuration:
>
> # /usr/local/etc/nginx/servers/django-staticfiles
> server {
> listen 80;
> server_name 127.0.0.1;
>
> location / {
> proxy_pass http://127.0.0.1:8000;
> }
>
> location /static/ {
> alias /Users/me/projects/django/django-staticfiles/static-final/;
> }
> }
>
> I should add that when I stop Gunicorn and start Django's development
> server with DEBUG = True, the app1 template accesses the main.css file
> correctly.  It just can't see it when I'm running Gunicorn and Nginx.  I
> realize that I don't have a real need to run Gunicorn/Nginx on my Mac, but
> I've just set it up so I can compare and contrast how Django manages static
> files in development versus production.
>
> --
> 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/75f129a6-2dbf-47cc-b4ea-08008b30b047%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/75f129a6-2dbf-47cc-b4ea-08008b30b047%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Regards,

Aldian Fazrihady
http://aldianfazrihady.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/CAN7EoAbn3p8AcQoz3yygaqmdKz-X4Z84fZQrQcVh3Pm0eENkmA%40mail.gmail.com.


  1   2   3   4   5   6   7   8   >