I've now read the documentation you're pointing to, but unfortunately it 
doesn't solve the problem. It says that this should work with the default 
nginx configuration, but there *is* no default nginx configuration in 
Mezzanine. There's a deploy/nginx.conf.template that I renamed to 
deploy/nginx.conf, but that didn't solve the problem. I don't even know 
where that config file is supposed to be, if not in the deploy directory.

I've tried this on two different installations now, and it seems to me that 
*Mezzanine, 
out of the box, stops working as soon as you turn off debug*. This seems 
like something that should be fixed upstream (IE, not on my installation), 
and I'd gladly do what I can to help resolve this issue. But then again, 
perhaps it's just me who's missing something.

Could someone try making a new installation *as per the official 
instructions on Mezzanine's site*, then turn off debugging in 
local_settings.py, then *force a full reload in the browser by clicking 
shift-reload* (to get rid of the local cache of static files), and see if 
it still works?

Den fredag 11 januari 2019 kl. 21:53:38 UTC+1 skrev Nicolas Pinault:
>
> Please take time to read all the content of this page. : 
> https://docs.djangoproject.com/en/dev/howto/static-files/
> You'll understand the difference between DEBUG mode and deployement mode 
> concerning static files.
>
> Le 11/01/2019 à 20:23, Christer Enfors a écrit :
>
> Thanks for your response. I have a directory called 
> /home/enfors/PyVarm/static, that's the one which is served when debug == 
> True, and PyVarm is obviously the name of the project. So by your 
> description, I take it PyVarm is the name of my Mezzanine / Django "app". 
> But where is the top-level /static? I find no other directories called 
> static on my machine, outside the Mezzanine-related ones under 
> site-packages in my virtual environment. Is it defined in a config file 
> somewhere? 
>
> These are all (well, most of) my directories under /home/enfors/PyVarm: 
>
> $ find /home/enfors/PyVarm -maxdepth 4 -type d                            
>                                                               
> /home/enfors/PyVarm                                                        
>                                                              
> /home/enfors/PyVarm/PyVarm                                                
>                                                               
> /home/enfors/PyVarm/PyVarm/__pycache__                                    
>                                                               
> /home/enfors/PyVarm/deploy                                                
>                                                               
> /home/enfors/PyVarm/static                                                
>                                                               
> /home/enfors/PyVarm/static/js                                              
>                                                              
> /home/enfors/PyVarm/static/mezzanine                                      
>                                                               
> /home/enfors/PyVarm/static/mezzanine/tinymce                              
>                                                               
> /home/enfors/PyVarm/static/mezzanine/tinymce/plugins                      
>                                                               
> /home/enfors/PyVarm/static/mezzanine/tinymce/themes                        
>                                                              
> /home/enfors/PyVarm/static/mezzanine/tinymce/skins                        
>                                                               
> /home/enfors/PyVarm/static/mezzanine/tinymce/langs                        
>                                                               
> /home/enfors/PyVarm/static/mezzanine/js                                    
>                                                              
> /home/enfors/PyVarm/static/mezzanine/js/admin                              
>                                                              
> /home/enfors/PyVarm/static/mezzanine/css                                  
>                                                               
> /home/enfors/PyVarm/static/mezzanine/css/admin                            
>                                                               
> /home/enfors/PyVarm/static/mezzanine/css/smoothness                        
>                                                              
> /home/enfors/PyVarm/static/mezzanine/chosen                                
>                                                              
> /home/enfors/PyVarm/static/mezzanine/img
> /home/enfors/PyVarm/static/css
> /home/enfors/PyVarm/static/filebrowser
> /home/enfors/PyVarm/static/filebrowser/js
> /home/enfors/PyVarm/static/filebrowser/css
> /home/enfors/PyVarm/static/filebrowser/uploadify
> /home/enfors/PyVarm/static/filebrowser/img
> /home/enfors/PyVarm/static/admin
> /home/enfors/PyVarm/static/admin/js
> /home/enfors/PyVarm/static/admin/js/admin
> /home/enfors/PyVarm/static/admin/js/vendor
> /home/enfors/PyVarm/static/admin/css
> /home/enfors/PyVarm/static/admin/fonts
> /home/enfors/PyVarm/static/admin/img
> /home/enfors/PyVarm/static/admin/img/admin
> /home/enfors/PyVarm/static/admin/img/gis
> /home/enfors/PyVarm/static/media
> /home/enfors/PyVarm/static/media/uploads
> /home/enfors/PyVarm/static/media/uploads/.thumbnails
> /home/enfors/PyVarm/static/media/uploads/logos
> /home/enfors/PyVarm/static/media/uploads/people
> /home/enfors/PyVarm/static/fonts
> /home/enfors/PyVarm/static/test
> /home/enfors/PyVarm/static/grappelli
> /home/enfors/PyVarm/static/grappelli/js
> /home/enfors/PyVarm/static/grappelli/js/admin
> /home/enfors/PyVarm/static/grappelli/css
> /home/enfors/PyVarm/static/grappelli/img
> /home/enfors/PyVarm/static/grappelli/img/admin
> /home/enfors/PyVarm/static/grappelli/img/icons
> /home/enfors/PyVarm/static/img
>
>
> Den fredag 11 januari 2019 kl. 15:41:53 UTC+1 skrev Eduardo Rivas: 
>>
>> Hi Christer.
>>
>> The collectstatic command is a Django concept, not something specific to 
>> Mezzanine. Even though it requires more time, a strong foundation on Django 
>> will make your time with Mezzanine much more productive. 
>>
>> When you use Django's dev server, it will look into the /static directory 
>> inside each of your apps. In production, all static files should be served 
>> from the top-level /static directory. You need to copy all files scattered 
>> across the app directories into this central location, and that's what the 
>> command does. 
>>
>> You need to make sure your production sever is routing the /static/ url 
>> of your site to this top level /static folder. The nginx config included 
>> with mezzanine does that by default. 
>>
>> On Fri, Jan 11, 2019, 8:30 AM Christer Enfors <christe...@gmail.com 
>> wrote:
>>
>>> I don't understand how the "collectstatic" stuff works. I have a static 
>>> directory, and inside it there are files. But if I turn off debugging in 
>>> settings.py, then the files inside static/ suddenly give me a 404, meaning 
>>> I only get a very bare-bones page with no CSS, no images, etc. But the 
>>> files are still there, in the static/ directory. It's as if it's looking in 
>>> a different static/ depending on if debug is turned on or off. 
>>>
>>> This would be a lot easier if I could find some documentation about 
>>> Mezzanine *as a CMS* - the documentation I found is for programming 
>>> extensions for it from what I can tell. And it's great that there's 
>>> documentation for that, but that's not what I'm looking for right now.
>>>
>>> I suspect that I am supposed to learn Django to learn how this stuff 
>>> works, and sure, I could do that. But I'd rather not, right now. I just 
>>> want to use Mezzanine as a CMS.
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to mezzanine-use...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mezzanine-use...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to