GithubHelp home page GithubHelp logo

Comments (5)

unnat404 avatar unnat404 commented on May 25, 2024 2

NOTE: This is just another way to access your static files and NOT A FIX for the above problem.

  • Method : What you can try is put the static folder inside your app(/s) folders where they are needed, instead of the root(/project) folder, with namespacing (just a good practice that helps Django differentiate between static files with same names across different apps), and then reference them accordingly.
  • The reason of the error I think is some error in routing (/urls) in path joining of BASE_DIR and STATIC files , which we have avoided by in the above method by shifting the static folder's location inside each app

Refer the following Django documentation for better understanding of method:
https://docs.djangoproject.com/en/3.2/intro/tutorial06/

from patrowldocs.

MaKyOtOx avatar MaKyOtOx commented on May 25, 2024

Hi s3c,
Do you run the manager in the development or production mode ? If you run in the production mode (variable DEBUG set to False in the app/settings.py file), you must deploy a web server/proxy like NGinx.
If you want to start to have a quick look, try to set the DEBUG parameter to True and restart it.

Let me know if it works :)

--Nicolas

from patrowldocs.

s3cur3n3t avatar s3cur3n3t commented on May 25, 2024

Hi MakyOtOx,

Thanks for the rapid response! ;)

Well I tried in development mode and then in production mode.

I have a web server (apache2 on debian based system) (so I have to configure it), but what do you sugest? Better to have Nginx?

Later on I'll try what you suggest and try to see if I can get any information that can help solve the issue.

Then I'll let you know.

Thank you.

Best regards.

from patrowldocs.

Mpho777 avatar Mpho777 commented on May 25, 2024

"GET /static/css/bootstrap.css HTTP/1.1" 404 1810 this is my problem

from patrowldocs.

Mpho777 avatar Mpho777 commented on May 25, 2024

WARNINGS:
shop.Category: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the ShopConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
shop.Customer: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the ShopConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
shop.Order: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the ShopConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
shop.OrderItem: (models.W042) Auto-created primary key used when not defining a primary key type, by default
'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the ShopConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
shop.Product: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the ShopConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
shop.ShippingAddress: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the ShopConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

System check identified 6 issues (0 silenced).

You have 19 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions, shop.
Run 'python manage.py migrate' to apply them.
May 27, 2021 - 14:09:43
Django version 3.2.2, using settings 'starletshop.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[27/May/2021 14:09:48] "GET / HTTP/1.1" 200 7563
[27/May/2021 14:09:48] "GET /static/css/bootstrap.css HTTP/1.1" 404 1810
[27/May/2021 14:09:48] "GET /static/css/main.css HTTP/1.1" 404 1795
[27/May/2021 14:09:48] "GET /static/font-awesome-4.7.0/css/font-awesome.css HTTP/1.1" 404 1876
[27/May/2021 14:09:48] "GET /static/JS/main.js HTTP/1.1" 404 1789
[27/May/2021 14:09:48] "GET /static/JS/bootstrap.js HTTP/1.1" 404 1804
[27/May/2021 14:09:48] "GET /static/images/hero.webp HTTP/1.1" 404 1807
[27/May/2021 14:09:48] "GET /static/images/hero3.jpg HTTP/1.1" 404 1807
[27/May/2021 14:09:48] "GET /static/images/hero4.jpg HTTP/1.1" 404 1807
[27/May/2021 14:09:49] "GET /static/JS/main.js HTTP/1.1" 404 1789
[27/May/2021 14:09:55] "GET /cart/ HTTP/1.1" 200 6628
[27/May/2021 14:09:55] "GET /static/css/main.css HTTP/1.1" 404 1795
[27/May/2021 14:09:55] "GET /static/css/bootstrap.css HTTP/1.1" 404 1810
[27/May/2021 14:09:55] "GET /static/font-awesome-4.7.0/css/font-awesome.css HTTP/1.1" 404 1876
[27/May/2021 14:09:55] "GET /static/JS/main.js HTTP/1.1" 404 1789
[27/May/2021 14:09:56] "GET /static/JS/bootstrap.js HTTP/1.1" 404 1804
[27/May/2021 14:09:56] "GET /static/JS/main.js HTTP/1.1" 404 1789
[27/May/2021 14:10:03] "GET /checkout/ HTTP/1.1" 200 0
[27/May/2021 14:10:11] "GET /static/css/bootstrap.css HTTP/1.1" 404 1810
[27/May/2021 14:10:11] "GET /static/css/main.css HTTP/1.1" 404 1795
[27/May/2021 14:10:11] "GET /static/JS/main.js HTTP/1.1" 404 1789
[27/May/2021 14:10:12] "GET /static/font-awesome-4.7.0/css/font-awesome.css HTTP/1.1" 404 1876
[27/May/2021 14:10:12] "GET /static/JS/main.js HTTP/1.1" 404 1789
[27/May/2021 14:10:16] "GET / HTTP/1.1" 200 7563
[27/May/2021 14:10:16] "GET /static/css/main.css HTTP/1.1" 404 1795
[27/May/2021 14:10:16] "GET /static/css/bootstrap.css HTTP/1.1" 404 1810
[27/May/2021 14:10:16] "GET /static/JS/main.js HTTP/1.1" 404 1789
[27/May/2021 14:10:16] "GET /static/JS/bootstrap.js HTTP/1.1" 404 1804
[27/May/2021 14:10:16] "GET /static/font-awesome-4.7.0/css/font-awesome.css HTTP/1.1" 404 1876
[27/May/2021 14:10:16] "GET /static/images/hero.webp HTTP/1.1" 404 1807
[27/May/2021 14:10:17] "GET /static/images/hero3.jpg HTTP/1.1" 404 1807
[27/May/2021 14:10:17] "GET /static/images/hero4.jpg HTTP/1.1" 404 1807
[27/May/2021 14:10:17] "GET /static/JS/main.js HTTP/1.1" 404 1789

from patrowldocs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.