I second the need to put js and css files under a static directory. When
going to production, you'll need to look at the management command about
static files.

Also, don't put html files outside templates directory. And unless you have
a good reason not to, put the html files in a subdirectory of the templates
for named after the app. I now, it suck. But it let you have multiple app
define an index.html template. Which is big plus.

Now, for your actual question. If the CSS isn't specific to an app, don't
put it under that app. Create an extra app for all the generic stuff.
Remember the part I was telling about subdirectory of templates ? Here you
have a good reason to not have one. If all your html files start with a
header and a link to your css, you are doing it wrong. Put the part that is
common to all your page in a base.html file, with {% block content %}{%
endblock %} where the content should be. Then post.html and friends.html
will start with {% extends 'base.html' %}{% block content %}

I hope I am not being too confusing.


On 17 Feb 2017 8:58 a.m., "Jani Tiainen" <[email protected]> wrote:

Hi,

You need to put static files under static directory within app. Now you
have static resources at your app root. So layout should be:

users/
    static/
        css/
            style.css


On 17.02.2017 08:15, Kazi Atik wrote:

Hi Everyone,

I am having multiple app in my project so i want to make globally these
css, js,img folder because every time making css,js,img folder very
difficult and slowing my development of
my project please give me solution

myfb
users/
        __init__.py
        models.py
        views.py
        urls.py
        templates/
login.html
dashboard.html
logout.html
        css/
         style.css
-----------------------------------
categories/
        __init__.py
        models.py
        views.py
        urls.py
        templates/
post.html
friends.html
upload.html
        css/
         user.css
    img/
         fb.jpg
  JS/
  boot.min.js



-- 
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 [email protected].
To post to this group, send email to [email protected].
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/215f85be-b377-4f44-a3bb-0e9311f31c35%40googlegroups.com?utm_medium=email&utm_source=footer>
https://groups.google.com/d/msgid/django-users/215f85be-
b377-4f44-a3bb-0e9311f31c35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
Jani Tiainen

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/d845f92b-f408-7c28-f7fc-47a9af165aac%40gmail.com
<https://groups.google.com/d/msgid/django-users/d845f92b-f408-7c28-f7fc-47a9af165aac%40gmail.com?utm_medium=email&utm_source=footer>
.

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 [email protected].
To post to this group, send email to [email protected].
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/CAEuG%2BTatzj-L0rAG1xwZgkSdcv7yRtvMXV73_9-7T-cb%3DCie_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to