Here is an exemple, slightly simplified from one of my project
Assuming a "generic" app, generic/templates/base.html would be
something like that
<!doctype html>
{% load staticfiles %}
<meta charset=utf-8>
<link rel=stylesheet href="{% static "css/style.css" %}">
<title>{% block title %}myfb{% endblock %}</title>
{% block content %}{% endblock %}
with style.css in generic/static/css/style.css and generic/js/dashboard.js
Then you can have users/templates/users/base.html like that
{% extends "base.html" %}
{% block title %}{{ block.super }}: user{% endblock %}
{% block content %}{% block main %}{% endblock %}{% endblock %}
then users/templates/users/dashboard.html
{% extends "users/base.html" %}
{% load staticfiles %}
{% block main %}
<script type=text/javascript src="{% static "js/dashboard.js" %}"></script>
the content of your dashboard here
{% endblock %}
categories/templates/categories/friends.html could be that:
{% extends "base.html" %}
{% block content %} list of friends {% endblock %}
generic would hold resources common to all other apps.
See the pattern ?
2017-02-17 11:21 GMT+01:00 Kazi Atik <[email protected]>:
> what i have to do when i have multiple apps
>
>
> On Friday, February 17, 2017 at 1:28:29 PM UTC+5:30, Jani Tiainen 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.
>> 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/18065a52-9952-4c35-b185-7f330ca5af4d%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
Cordialement, Coues Ludovic
+336 148 743 42
--
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%2BTZ9Kx_2wue%3Df5u_3oG1D7AHy7-Uxfkb0m0npDZfZQGk4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.