Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
OperationalError at /admin/accounts/picture/ no such table: accounts_picture
Keep on getting the error below This is occurring after making migrations. OperationalError at /admin/accounts/picture/ no such table: accounts_picture def get_image_filename(instance,filename): id = instance.product.id return "picture_image/%s" % (id) def path_and_rename(instance, filename): upload_to = 'images' ext = filename.split('.'[-1]) if instance.pk: filename = '{}.{}'.format(instance.pk, ext) else: filename = '{}.{}'.format(uuid4().hex, ext) return os.path.join(upload_to, filename) class Picture(models.Model): product_pic = models.ImageField(null=True, blank=True,upload_to=path_and_rename) product = models.ForeignKey(Product, null=True, on_delete=models.SET_NULL ) date_created = models.DateTimeField(auto_now_add=True, null=True) This error is appearing when trying to access my pictures model on admin. Is there a way of resolving this? User = get_user_model() class UserAdmin(BaseUserAdmin): # The forms to add and change user instances form = UserAdminChangeForm add_form = UserAdminCreationForm # The fields to be used in displaying the User model. # These override the definitions on the base UserAdmin # that reference specific fields on auth.User. list_display = ('email', 'admin') list_filter = ('admin','staff','active') fieldsets = ( (None, {'fields': ('email', 'password')}), ('Personal info', {'fields': ()}), ('Permissions', {'fields': ('admin','staff','active')}), ) # add_fieldsets is not a standard ModelAdmin attribute. UserAdmin # overrides get_fieldsets to use this attribute when creating a user. add_fieldsets = ( (None, { 'classes': ('wide',), 'fields': ('email', 'password1', 'password2')} ), ) search_fields = ('email',) ordering = ('email',) filter_horizontal = () admin.site.register(User,UserAdmin) admin.site.unregister(Group) … -
django: gaierror at /accounts/signup/ [Errno 11001] getaddrinfo failed
I am using django all-auth for account registration and I am having issues sending account verification email. Currently I am using the following settings. Below I replaced my real domain name with mydomain and I registered my support@mydomain.com with Gmail. # email details to send confirmation email EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.mydomain.com' EMAIL_PORT = 587 EMAIL_HOST_USER = DEFAULT_FROM_EMAIL = 'support@mydomain.com' EMAIL_HOST_PASSWORD = '************' when I use EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' email is printing in the console. But when I comment this line to send email instead of printing in the console then its throwing following error. gaierror at /accounts/signup/ [Errno 11001] getaddrinfo failed There were couple of similar questions like this on stackoverflow but they didn't solve my issue. How do I send an email for account verification? -
Django loop to without loop using orm
In the following code i am converting date_no to day of the week.So i have to loop 7 times for each day.And query is executing 7 times.But i want to change this code such that there is no loop and query to run is only one. day_wise = {} for date_no in range(1,7): # Total 7 queryies BusinessShareInfo_result = BusinessShareInfo.objects.filter(Date__week_day=date_no).all() day_wise[calendar.day_name[date_no]] = {'Average':0,'Maximum':0,'Minimum':0 } data = BusinessShareInfo_result.aggregate(Avg('Turnover'), Max('Turnover'), Min('Turnover') ) day_wise[calendar.day_name[date_no]]['Average'] = data['Turnover__avg'] day_wise[calendar.day_name[date_no]]['Maximum'] = data['Turnover__max'] day_wise[calendar.day_name[date_no]]['Minimum'] = data['Turnover__min'] I just want the functionality to be same but without any loop. -
Reference to an image in front end and use it in back end
This question might be very easy to answer, but I have no clue how it works. I have browsed an image in front end which uses django-forms attached to a model with ImageField. If I hit submit image saves with no issue, but I need different behavior. I need to store this image manually in backend: from django.core.files import File reopen=open("C:/Users/user1/Desktop/ninja.png","rb") django_file = File(reopen) msg2=Message.objects.create(writer=usr,chatroom=cr,body="hello world") msg2.imagemsg.save("imagename",django_file,save=True) the problem is that I cannot get "C:/Users/user1/Desktop/ninja.png" for obvious security reasons. So my question is that how can I have access to the browsed file in the back-end, then I can save it. -
Why is my serializer test giving me a "TypeError: 'ReturnDict' object is not callable" error?
I'm using Django 2.2, Python 3.7, the Django rest framework, and pytest. I want to write a unit test to see if my serializer can create my model. My test looks like this ... @pytest.mark.django_db def test_coop_create(self): """ Test coop serizlizer model """ state = StateFactory() serializer_data = { "name": "Test 8899", "types": [ {"name": "Library"} ], "address": { "formatted": "222 W. Merchandise Mart Plaza, Suite 1212", "locality": { "name": "Chicago", "postal_code": "60654", "state_id": state.id } }, "enabled": "true", "phone": "7739441426", "email": "myemail", "web_site": "http://www.1871.com/" } serializer = CoopSerializer(data=serializer_data) serializer.is_valid() print(serializer.errors()) assert serializer.is_valid(), serializer.errors() result = serializer.save() print(result) However, "serializer.errors()" is producing the output TypeError: 'ReturnDict' object is not callable I'm not clear on why or how to debug further. The code for my serializer is class CoopSerializer(serializers.ModelSerializer): types = CoopTypeSerializer(many=True) address = AddressTypeField() class Meta: model = Coop fields = ['id', 'name', 'types', 'address', 'phone', 'enabled', 'email', 'web_site'] extra_kwargs = { 'phone': { 'required': False, 'allow_blank': True } } def to_representation(self, instance): rep = super().to_representation(instance) rep['types'] = CoopTypeSerializer(instance.types.all(), many=True).data rep['address'] = AddressSerializer(instance.address).data return rep def create(self, validated_data): #""" #Create and return a new `Snippet` instance, given the validated data. #""" coop_types = validated_data.pop('types', {}) instance = super().create(validated_data) for item … -
Django RequestFactory doesn't store a User
I'm testing whether an API User can POST to a view if the User can pass the IsAuthenticated permission. Upon running the test I get the assertion error: AssertionError: 401 != 201. When permission_classes = (permissions.IsAuthenticated,) is commented out and the test is ran again, I'm finding that request.user is turning out to be an AnonymousUser. Yet, I have a User created and attached to the request as shown below. I'm not sure what is causing this, and looking to understand how I can pass a User instance to the request. Note - I'm trying to do this in the Django testing API rather than use Django REST Framework. tests.py class TestUserPreferencesResource(TestCase): '''Verify that a User is capable of setting preferences for their profile''' @classmethod def setUpTestData(cls): cls.user = User.objects.create_user('Mock', password="secret") cls.user_prefs = json.dumps({ "age": ['Baby', 'Adult'], "gender": ['Male'], "size": ["Medium", "Large"] }) cls.factory = RequestFactory() cls.credentials = b64encode(b"Mock:secret").decode("ascii") def test_user_preferences_settings(self): request = self.factory.post( reverse("pref-settings"), data=self.user_prefs, content_type="application/json", headers = { "Authorization": f"Basic {self.credentials}" }, ) request.user = self.user print(request.user) response = UserPrefView.as_view()(request) self.assertEqual(response.status_code, 201) views.py class UserPrefView( CreateModelMixin, UpdateModelMixin, GenericAPIView): queryset = UserPref.objects.all() permission_classes = (permissions.IsAuthenticated,) serilaizer_class = serializers.UserPreferenceSerializer def post(self, request, format=None): import pdb; pdb.set_trace() serializer = self.serializer_class(data=request.data) serializer.is_valid(raise_exception=True) … -
500 response when updating server on pythonanywhere through GitHub
I've followed this tutorial (Tutorial) in order to connect my GitHub private repository with my host (pythonanywhere). I got and registered the deploy key for the server, added a webhook and deployed the web. The first time was perfect, the first pulling went fine, but when I try to send a package I get this '500 error'. Here's the error. Can someone help me? I've tried to search in the error log of my webapp, nothing there... Request Request URL: https://myweb.com/update_server/ Request method: POST content-type: application/json Expect: User-Agent: GitHub-Hookshot/[code] X-GitHub-Delivery: [The code] X-GitHub-Event: ping Response Connection: keep-alive Content-Length: 63390 Content-Type: text/html Date: Sun, 24 May 2020 23:56:25 GMT Server: PythonAnywhere Vary: Cookie X-Content-Type-Options: nosniff X-Frame-Options: DENY -
Using async function of requests-html in Django views
My bota.py file contains code to scrap a ecommerce site. This works if i call directly in this file like get_bota("mouse") and does return the list of data scraped . import json from requests_html import AsyncHTMLSession asession = AsyncHTMLSession() async def get_bota_page(keyword, page_no): template_link = 'https://www.bota.com.np/catalog/?_keyori=ss&from=input&page={page_no}&q={keyword}&spm=a2a0e.11779170.search.go.287d2d2bVToBsh' r = await asession.get(template_link.format(keyword=keyword,page_no=page_no)) return r def getBota(search): total = 1 page = 1 items = list() if search== "": return items results = asession.run( lambda: get_bota_page(search, 1), lambda: get_bota_page(search, 2), lambda: get_bota_page(search, 3), ) print(results) while total != 0: scripts = results[page-1].html.find('script') jsonData = scripts[3].text.split("window.pageData=")[1] dictData = json.loads(jsonData) if (page == 1): total = int(dictData['mainInfo']['totalResults']) if total==0: return items products = dictData['mods']['listItems'] found = len(products) total = total - found for item in products: temp = dict() temp['name'] = item['name'] temp['productUrl'] = (item['productUrl']) temp['image'] = (item['image']) temp['price'] = (item['price']) temp['site'] = 'daraz' items.append(temp) page += 1 return items My index view function where i call the above function to give me scraped data in django views.py. from .forms import Search from .bota import getBota def index(request): form = Search(request.POST or None) if request.method=='GET': return render(request, 'sites_scrap/index.html', {'form': form}) else: if form.is_valid(): keyword=form.cleaned_data['product'] print(keyword) list=getBota(keyword) print(x) return render(request, 'sites_scrap/index.html', {'List': list,'form':form}) the error i … -
Get model's ModelAdmin "list_display" fields
Consider a model called Person which has four fields: f_name l_name dob something_else I registered this model on the admin site. In the ModelAdmin class, I specified the list_display` fields like so: list_display = ["f_name", "l_name", "something_else"] In the view.py file, I called the model object using the apps.get_model() function from django.apps. Now that I have this model object, I want to retrieve the list_display fields through this model object. How would I be able do that? Thanks for reading this awfully presented question and your time, I really appreciate any help. EDIT : I would also like to know how I store the data in a list according to the list_display fields from a queryset. For example: represented_data = [['John', "Snow", "He died"], ["Arya", "Not Snow", "Killed the king"]] -
Django FileField form error "This field is required." when file IS in request.FILES
I am having an issue when uploading an image to my form. ISSUE: form.is_valid() is failing with "This field is required." in reference to the image field which IS in request.FILES and passed to the forms constructor. Here is some of the view code: if request.method == 'POST': form = ImageForm(request.POST, request.FILES, user=user, album=album, prefix='form') if form.is_valid(): Here is some of the ModelForm code: class ImageForm(forms.ModelForm): def __init__(self, *args, **kwargs): self.user = kwargs.pop('user') self.album = kwargs.pop('album', None) super(ImageForm, self).__init__(*args, **kwargs) class Meta: model = AlbumImage fields = ['image', 'caption'] The form tag does contain: role="form" enctype="multipart/form-data" method="post" When I set a breakpoint and inspect request.FILES I can see the "image" in the list. -
In django if i want to display files which i've uploaded them to a model how can i display each one alone?
I'm tryin to create a website the website should have some pdf files i've made a tmplate that contains all the files titles and used { for in } to display the titles but i want to redirect them to a page that shows the pdf file when they click on the title how can i do that ? and thnx. -
How to input the image into django model from api call
I am currently creating a method to allow users to upload their image for avatar. I am using vue.js as my frontend framework. I have done some research and successfully created the formData object and passed to the Django server via DRF. Everything went through well just the image. I did many kinds of research but could not find a solution to write a function for uploading the image. My formData uploadImage(item){ console.log(item.file); this.formData = new FormData(); this.formData.append('profile.birthday', this.registerForm.profile.birthday); this.formData.append('profile.gender', this.registerForm.profile.gender); this.formData.append('profile.role', this.registerForm.profile.role); this.formData.append('profile.avatar', item.file); this.formData.append('username', this.registerForm.username); this.formData.append('password', this.registerForm.password); this.formData.append('email', this.registerForm.email); console.log(...this.formData); }, isRegister() { let that = this; register( this.formData ).then((response) => { that.$router.push({name: 'login'}); console.log('success') }).catch(function (error) { console.log(error.response); that.error.mobile = error.username ? error.username[0] : ''; that.error.password = error.password ? error.password[0] : ''; }); }, User model class Profile(models.Model): role_choice = ( ('Reader', u'Reader'), ('Author', u'Author'), ('Editor', u'Editor'), ('Admin', u'Admin') ) user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile', verbose_name='user') gender = models.CharField(choices=(("male", u"Male"), ("female", u"Female")), default="Female", max_length=150, verbose_name='Gender') birthday = models.DateField(null=True, blank=True, verbose_name="Birthday") icon = models.ImageField(upload_to="media/image/%Y/%m", default=u"media/image/default.png", max_length=1000, verbose_name=u"User icon", null=True) role = models.CharField(choices=role_choice, max_length=150, default='Admin', verbose_name='Role') User serializer class UserSerializer(serializers.ModelSerializer): profile = UserProfileSerializer() class Meta: model = User fields = ('id', 'username', 'password', 'email', 'profile',) depth = 1 def … -
Django input not showing
Im building a site using Django. I am trying to pass an input from index.html and display it in about.html using view.py. My input seems to get passed as it is in the url at the top the browser.I am trying to store this value in a variable and display the variable in a html paragraph. However it does not show. Instead of seeing the input associated with the variable i just see the string of text with the variable name. My index.html: <form action="{% url 'theaboutpage' %}"> <input type="text" name="user_input"> <input type="submit" value="click here now"> </form> My about.html: <a href={% url 'thehomepage' %}>go back to the home page</a> <p>{{'input_from_home_page'}}</p> My views.py: def about(request): Hellothere = request.GET['user_input'] return render(request, 'about.html', {'input_from_home_page':Hellothere}) -
Django + Javascript | How to play sound in django?
How to play sound in django with javascript script? Script with Javascript and file route with Django. <script> var snd = new Audio("{% static 'media/file.wav' %}"); snd.play(); </script> -
django translation only few text are translating on production
The django translation works all fine in my local system,but in production only few text are translated, other texts remain same. Any idea, why few text are translated and not all? -
Django with Stripe,payment is not successful when submitting card info in frontend (React JS)
When I submit card details from frontend it fails to successfully POST in Django Rest server. I think the error with Django code. If you know how to configure strip with Django, please help DJANGO VIEWS.PY @csrf_exempt def chargeview(request,*args,**kwargs): # new if request.method == 'POST': charge = stripe.Charge.create( amount=500, currency='usd', description='A Django charge', source=request.POST['token'] ) return render(request, 'payments/charge.html') ERROR raise MultiValueDictKeyError(key) django.utils.datastructures.MultiValueDictKeyError: 'stripeToken' REACT JS CODE import React, { useState } from "react"; import StripeCheckout from "react-stripe-checkout"; import axios from 'axios'; const StripeBtn = () => { const publishableKey = "pk_test_some key"; const price = 1000 const onToken = token => { const body = { amount: 1000, token: token }; console.log(body.token) axios .post("http://localhost:8000/payments/", {token:body.token}) .then(response => { console.log(response); }) .catch(error => { console.log("Payment Error: ", error); alert("Payment Error"); }); }; return ( <StripeCheckout label="Go Premium" //Component button text name="Business LLC" //Modal Header description="Upgrade to a premium account today." panelLabel="Go Premium" //Submit button in modal amount={price} //Amount in cents $9.99 token={onToken} stripeKey={publishableKey} image="" //Pop-in header image billingAddress={false} /> ); }; export default StripeBtn; -
django guardian displaying objects based on object-level permssions without having to use a FK that refers to User
I want to use user_can_access_owned_objects_only = True to display objects based on users permissions but it's giving me this error: Cannot resolve keyword 'user' into field. Choices are: college_name, college_name_id, department_name, email, name, nameAR, type which I think it's because I don't have a Foreign Key that refers to User, and I don't want to add a field to my model, I don't want to add: user = models.ForeignKey(User). So can I achieve that ? models.py : class Teachersall(models.Model): name = models.CharField(max_length=45, null=True, blank=True) nameAR = models.CharField(max_length=45, null=True, blank=True) email = models.CharField(max_length=45, null=True, blank=True) type = models.CharField(max_length=45, null=True, blank=True) college_name = models.ForeignKey(Generator, unique=False, null=True, blank=True, on_delete=models.CASCADE) department_name = models.CharField(max_length=45, null=True, blank=True) admin.py : @admin.register(Teachersall) class TeachersAdmin(GuardedModelAdmin): def save_model(self, request, obj, form, change): obj.user = request.user super().save_model(request, obj, form, change) assign_perm('teacher_admin', obj.user, obj) user_can_access_owned_objects_only = True Error : Cannot resolve keyword 'user' into field. Choices are: college_name, college_name_id, department_name, email, name, nameAR, type -
Redirected to wrong url
I have 2 urls which are kind of similar, path('account/', views.register_login, name='register_login'), path('account/<slug:user_slug>/', views.home, name='account'), When I go to 127.0.0.1:8000/account/ I get redirected to the url with name account instead of to the one with name register_login. How can I fix this? -
How to get part of a URL and convert to string in django python?
I have a simple blog website in django and I want to include video embeds using this script: <script src= "http://player.twitch.tv/js/embed/v1.js"></script> <div id="youtubeplayer"></div> <script type="text/javascript"> var options = { width: 800, height: 500, video: "627627612" }; var player = new Twitch.Player("youtubeplayer", options); player.setVolume(0.5); </script> I have a URL field on the Post model. I want to then take that URL and only take part of it to fill in the "video" parameter in the above script. So, for example we have Twitch video URL https://www.twitch.tv/videos/494181151 and I want to take the 494181151 and convert to string so I can fill it in to the "video" parameter above in an html template. Is this possible and how can I go about doing it? I know I have to check for the URL and then check if it contains part of the URL like this: {% if url %} {% if 'twitch.tv/videos' in url %} But I'm not sure how to get the last part of the URL. Thanks! -
Images not loading in HTMLs after user uploads in forms in Django
I am building a form where a user can upload an image. After clicking on the submit button he/she will be redirected to a preview page to see all submitted image. But the image is not showing up in the review page whereas the image is visible from the admin site. Here's my code: models.py from django.db import models from phonenumber_field.modelfields import PhoneNumberField # Create your models here. class Register(models.Model): name = models.CharField(max_length=50) idCard = models.ImageField(upload_to='idCard', null=True) def __str__(self): return self.name forms.py from django import forms from django.forms import ModelForm from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from .models import * class RegisterForm(ModelForm): name = forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Your full name...'})) class Meta: model = Register fields = '__all__' views.py from django.shortcuts import render, redirect from .models import * from .forms import * # Create your views here. def index(request): form = RegisterForm() if request.method == 'POST': form = RegisterForm(request.POST, request.FILES) if form.is_valid(): instance = form.save() return redirect('preview', pk=instance.id) context = {'form':form} return render(request, 'event/index.html', context) def preview(request, pk): reg = Register.objects.get(id=pk) prev = RegisterForm(instance=reg) if request.method == 'POST': form = RegisterForm(request.POST, instance=reg) if form.is_valid(): form.save() return redirect('/') context = {'reg':reg, 'prev':prev} return render(request, 'event/preview.html', context) urls.py from django.urls import path from … -
Django url problems not loading my html template
*I have creted a shop app now in it * shop/urls.py from django.urls import path from . import views urlpatterns = [ path("", views.index, name="ShopHome"), path("shop/cart/", views.cart, name="Cart"), path("shop/checkout/", views.checkout, name="Checkout"), path("shop/contact/", views.contact, name="ContactUs"), path("shop/register/", views.register, name="Register"), path("shop/product_details/", views.product_details, name="ProductDetails"), path("shop/products/", views.products, name="Products"), ] the main project urls.py from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('shop/', include('shop.urls')), ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) views.py from django.shortcuts import render # Create your views here. from django.http import HttpResponse def index(request): return render(request, 'shop/index.html') def register(request): return render(request, 'shop/register.html') def contact(request): return render(request, 'shop/contact.html') def products(request): return render(request, 'shop/products.html') def product_details(request): return render(request, 'shop/product_details.html') def cart(request): return render(request, 'shop/cart.html') def checkout(request): return render(request, 'shop/checkout.html') models.py from django.db import models # Create your models here. class Product(models.Model): name = models.CharField(max_length=300) slug = models.SlugField(max_length=150) description = models.TextField() image = models.ImageField(upload_to='shop/images', default='') manufacturer = models.CharField(max_length=300, blank=True) price_in_dollars = models.DecimalField(max_digits=6, decimal_places=2) def __str__(self): return self.name setting.py the installed apps part INSTALLED_APPS = [ 'shop.apps.ShopConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] apps.py from django.apps import AppConfig class ShopConfig(AppConfig): name = 'shop' admin.py from django.contrib import admin # Register your models here. from . models … -
Django Rest Framework: Is it a security concern to have both "TokenAuthentication" and "SessionAuthentication" in the default authentication classes?
I was using "TokenAuthentication" for my API which it will be used by a mobile application. But I noticed I was not able to use the DRF Browsable web API. Some people online suggested to add "SessionAuthentication" to the authentication classes, so it looks like this: REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.SessionAuthentication', ] } Now I'm able to log in as a specific user in the Browsable API and interact with it but I'm wondering if there any security concern leaving both types of authentication in my Rest API? -
2 table reference to the model
I have a Models as below : class Ingredient(models.Model): code_number = models.CharField(max_length = 20) description = models.CharField(max_length = 100) colour = models.CharField(max_length = 100) specific_gravity= models.DecimalField(max_digits = 4, decimal_places = 3) class Meta: db_table = 'ingredient' class Supplier(models.Model): name = models.CharField(max_length = 50) class Meta: db_table = 'supplier' class Ingredient_Supplier(models.Model): ingredient = models.ForeignKey(Ingredient, on_delete=models.CASCADE) supplier = models.ForeignKey(Supplier, on_delete=models.CASCADE) class Meta: db_table = 'ingredient_supplier' class Order(models.Model): ingredient_supplier = models.ForeignKey(Ingredient_Supplier, on_delete=models.CASCADE) order_number = models.IntegerField(default = 0) value = models.DecimalField(max_digits = 5, decimal_places = 2) class Meta: db_table = 'order' Here's the Goal : When user logs in, fetch supplier id from database. Create a dynamic form which lists out every ingredient that can is related to that supplier. Allow them to add Order Number and value for every ingredient. I know Formset is the option I should use but haven't got a real success with it. Also, I could actually just create foreign key in supplier table or in ingredient table which could make this a lot easier but I don't have that option as this tables are also managed by another system. Hence, there has to be 2 step reference between ingredient and order Model. Any leads will be appreciated ! … -
How can I use correctly djangify to django framework?
I am testing djangify: djangify -d main/templates/main INFO:Directory : main/templates/main INFO:app_name : None INFO:Succeeded.. Generated Modified_Files/index.html in the directory passed. INFO:Directory : main/templates/main INFO:app_name : None INFO:Succeeded.. Generated Modified_Files/index.html in the directory passed. But CSS settings and images not showing: enter image description here \MyProject>python manage.py runserver Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). May 25, 2020 - 19:20:00 Django version 3.0.6, using settings 'MyProject.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. [25/May/2020 19:20:03] "GET / HTTP/1.1" 200 43240 Not Found: /assets/vendor/bootstrap/css/bootstrap.min.css [25/May/2020 19:20:03] "GET /assets/vendor/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2238 Not Found: /assets/vendor/icofont/icofont.min.css [25/May/2020 19:20:03] "GET /assets/vendor/icofont/icofont.min.css HTTP/1.1" 404 2214 Not Found: /assets/vendor/boxicons/css/boxicons.min.css Not Found: /assets/vendor/venobox/venobox.css [25/May/2020 19:20:04] "GET /assets/vendor/boxicons/css/boxicons.min.css HTTP/1.1" 404 2232 Not Found: /assets/vendor/animate.css/animate.min.css [25/May/2020 19:20:04] "GET /assets/vendor/venobox/venobox.css HTTP/1.1" 404 2202 Not Found: /assets/vendor/remixicon/remixicon.css [25/May/2020 19:20:04] "GET /assets/vendor/animate.css/animate.min.css HTTP/1.1" 404 2226 Not Found: /assets/vendor/aos/aos.css Not Found: /assets/vendor/owl.carousel/assets/owl.carousel.min.css [25/May/2020 19:20:04] "GET /assets/vendor/aos/aos.css HTTP/1.1" 404 2178 [25/May/2020 19:20:04] "GET /assets/vendor/remixicon/remixicon.css HTTP/1.1" 404 2214 [25/May/2020 19:20:04] "GET /assets/vendor/owl.carousel/assets/owl.carousel.min.css HTTP/1.1" 404 2265 Not Found: /assets/css/style.css Not Found: /assets/vendor/jquery/jquery.min.js [25/May/2020 19:20:04] "GET /assets/css/style.css HTTP/1.1" 404 2163 Not Found: /assets/vendor/bootstrap/js/bootstrap.bundle.min.js Not Found: /assets/vendor/jquery.easing/jquery.easing.min.js [25/May/2020 19:20:04] "GET /assets/vendor/jquery/jquery.min.js HTTP/1.1" 404 2205 Not Found: /assets/vendor/php-email-form/validate.js … -
Where should I put node modules in a project directory?
Starting my first Django project and can't seem to find the correct answer for this online anywhere (or just confused what root people are talking about). I setup Django but don't know if I should put node modules inside the Django project folder or outside of that in the main root directory. Is there a correct way to do this or does it not matter? Current Structure - root - env - node - node_modules - package.json - django-root - main - settings.py - app1 or - root - env - django-root - main - app1 - node - node_modules - package.json