Wednesday, August 30, 2017

Re: Doubts about static files

STATIC_URL = '/static/'
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'firstdjango', 'static'),
)
STATIC_ROOT = '/Users/mk/Desktop/api/New folder/' : When you run collectstatic files moves files from static files from static folder to desktop.
add this settings to the settings.py

On Wed, Aug 30, 2017 at 6:28 PM, sarfaraz ahmed <findsarfaraz@gmail.com> wrote:
 Hello Team,

I have doubts about static files. I read articles on Django but it does not clearly states that atleast I got confused.

STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] this is my STATICFILES_DIRS settings which points out to static folder under my project. Also, I can add all the folder from individual app which hold static files here so that it search for static files.
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR),'static_root') which points out to one level up folder than my project. This is how my project folder structures look like

static_root
MyProject
--static
----CSS
----JS
----imgs
--MyProject
--MyApp

When I run collectstatic files moves files from static files from static folder to static root.

Now, my question is when deploy it on apache which folder should I point to in my conf files. static_root or static.

Regards,
Sarfaraz Ahmed





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

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

No comments:

Post a Comment