Monday, August 31, 2020

Re: raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)

In clearer terms, I logged into the ADMIN PORTAL and saw that the items existed. There was also an image for each item in the ADMIN PORTAL. 

Strangely, when returning to the website, I am unable to actually "see" the pictures - they are blank. This was not the case back in the testing environment.

Why would this occur only upon publishing the website? Also, when I click cart after adding one of the non-image showing items, I receive an error 500 stating that the cart.html and only the cart.html TemplateDoesNotExist. It has the same settings as every other html page, what makes this single page unique to becoming an error 500? 

On Mon, Aug 31, 2020 at 9:51 AM King Niko <thelegendofearthreturns@gmail.com> wrote:
Okay, got it to work. My STATICFILES_DIRS was not set. 

Now I am encountering the issue of the admin portal not working. I am unable to access pictures from the DJANGO ADMIN portal nor can I access any of the products that I have created.

When I look at items that are linked to the DJANGO ADMIN portal, they are blank as though they do not exist. I looked at the logging and when I click "Cart" I receive a 500 error stating that the TemplateDoesNotExist.

Is there any way to connect the DJANGO ADMIN portal to the published site? 

On Mon, Aug 31, 2020 at 9:37 AM King Niko <thelegendofearthreturns@gmail.com> wrote:
Thank you Ranga, the site is up and running now. Unfortunately, none of the Static CSS, Images, nor JS are appearing and I get this error for each individual CSS, Image, or JS file: 

 "GET /static/images/Facebook.png HTTP/1.1" 404 179 "https://samplesite.herokuapp.com/home/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/- (KHTML, like Gecko) Chrome/- Safari/-"

Somehow the system does not seem to register the images, js, and css folders within my static folder. Would the images, js, and css folders have to be put into the root directory? Or would a path in the settings need to be altered to allow the static folder to actually register with the system? 

On Mon, Aug 31, 2020 at 1:11 AM RANGA BHARATH JINKA <bharathjinka09@gmail.com> wrote:

On Mon, Aug 31, 2020 at 9:28 AM Lightning Bit <thelegendofearthreturns@gmail.com> wrote:
Hello all, 

Does anyone know how to add a manifest entry for a staticfile? I have used:

> python manage.py collectstatic --noinput 

From this I got the  "staticfiles" folder. However, when I perform a logging on the website, this 505 error appears: 

> raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)


I tried deleting the "staticfiles"  folder and restarting the "collectstatic " process but that does not seem to work either. Any resolutions?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b9738987-daa9-403f-b1f6-ec27e076cff8n%40googlegroups.com.


--
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m315Y1aKjDrXepn_iT2A_rL5R6jmQM9KJ8n5GnJLRd%2B6Z6g%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO1EWpE6s3evwQzxTEdpkjfhvK5_HK_jbn25Agy%2BKsReBfmACg%40mail.gmail.com.

Re: raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)

Okay, got it to work. My STATICFILES_DIRS was not set. 

Now I am encountering the issue of the admin portal not working. I am unable to access pictures from the DJANGO ADMIN portal nor can I access any of the products that I have created.

When I look at items that are linked to the DJANGO ADMIN portal, they are blank as though they do not exist. I looked at the logging and when I click "Cart" I receive a 500 error stating that the TemplateDoesNotExist.

Is there any way to connect the DJANGO ADMIN portal to the published site? 

On Mon, Aug 31, 2020 at 9:37 AM King Niko <thelegendofearthreturns@gmail.com> wrote:
Thank you Ranga, the site is up and running now. Unfortunately, none of the Static CSS, Images, nor JS are appearing and I get this error for each individual CSS, Image, or JS file: 

 "GET /static/images/Facebook.png HTTP/1.1" 404 179 "https://samplesite.herokuapp.com/home/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/- (KHTML, like Gecko) Chrome/- Safari/-"

Somehow the system does not seem to register the images, js, and css folders within my static folder. Would the images, js, and css folders have to be put into the root directory? Or would a path in the settings need to be altered to allow the static folder to actually register with the system? 

On Mon, Aug 31, 2020 at 1:11 AM RANGA BHARATH JINKA <bharathjinka09@gmail.com> wrote:

On Mon, Aug 31, 2020 at 9:28 AM Lightning Bit <thelegendofearthreturns@gmail.com> wrote:
Hello all, 

Does anyone know how to add a manifest entry for a staticfile? I have used:

> python manage.py collectstatic --noinput 

From this I got the  "staticfiles" folder. However, when I perform a logging on the website, this 505 error appears: 

> raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)


I tried deleting the "staticfiles"  folder and restarting the "collectstatic " process but that does not seem to work either. Any resolutions?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b9738987-daa9-403f-b1f6-ec27e076cff8n%40googlegroups.com.


--
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m315Y1aKjDrXepn_iT2A_rL5R6jmQM9KJ8n5GnJLRd%2B6Z6g%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO1EWpEt_JL-4bs1GqGtEXLGH8DqOQQie8sh-%2B95gXbBHwFDFQ%40mail.gmail.com.

Re: raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)

Thank you Ranga, the site is up and running now. Unfortunately, none of the Static CSS, Images, nor JS are appearing and I get this error for each individual CSS, Image, or JS file: 

 "GET /static/images/Facebook.png HTTP/1.1" 404 179 "https://samplesite.herokuapp.com/home/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/- (KHTML, like Gecko) Chrome/- Safari/-"

Somehow the system does not seem to register the images, js, and css folders within my static folder. Would the images, js, and css folders have to be put into the root directory? Or would a path in the settings need to be altered to allow the static folder to actually register with the system? 

On Mon, Aug 31, 2020 at 1:11 AM RANGA BHARATH JINKA <bharathjinka09@gmail.com> wrote:

On Mon, Aug 31, 2020 at 9:28 AM Lightning Bit <thelegendofearthreturns@gmail.com> wrote:
Hello all, 

Does anyone know how to add a manifest entry for a staticfile? I have used:

> python manage.py collectstatic --noinput 

From this I got the  "staticfiles" folder. However, when I perform a logging on the website, this 505 error appears: 

> raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)


I tried deleting the "staticfiles"  folder and restarting the "collectstatic " process but that does not seem to work either. Any resolutions?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b9738987-daa9-403f-b1f6-ec27e076cff8n%40googlegroups.com.


--
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m315Y1aKjDrXepn_iT2A_rL5R6jmQM9KJ8n5GnJLRd%2B6Z6g%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO1EWpHmSG6CDcLV-_RPEoPJQcXrNfyoWN07xWg3jH3MQk2Q1g%40mail.gmail.com.

Re: can anyone help me

Apart from the answers already given, I see in your views, your form variable didn't include request.FILES that allows for files to be saved via views. It should be form = PostForm(request.POST, request.FILES).

On Sat, Aug 29, 2020 at 12:48 allaberdi...@gmail.com <allaberdi16yazhanow@gmail.com> wrote:
I can upload images from django admin panel but cannot to do same thing with django form ,  it saves any text but did not save images only,  anyone help me  please 
this is my code:

models.py:
class Posts(models.Model):

Ahal = 'Ahal'
Balkan = 'Balkan'
Dasoguz = 'Dasoguz'
Lebap = 'Lebap'
Mary = 'Mary'


CHOOSE_REGION = {
(Ahal,'Ahal'),
(Balkan,'Balkan'),
(Dasoguz,'Dasoguz'),
(Lebap,'Lebap'),
(Mary,'Mary')


name = models.CharField(max_length=30, blank=False, verbose_name='Ady')
image = models.ImageField(blank=True, null=True, verbose_name='surat')
text = models.TextField(verbose_name='gosmaça maglumat')
price = models.FloatField(verbose_name='bahasy')
region = models.CharField(max_length=30, choices=CHOOSE_REGION, blank=False, verbose_name='welaýat')
district = models.CharField(max_length=30, blank=False, verbose_name='etrab')
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='eýesi')
phone = models.CharField(max_length=50, blank=False, verbose_name='telefon belgisi')
published = models.DateTimeField(auto_now=True, verbose_name='satuwa çykan guni')



forms.py:
class PostForm(forms.ModelForm):
class Meta:
model = Posts
fields = ['name','image','text','price','region','district','user','phone']


views.py:
def add_post(request):
form = PostForm(request.POST or None)
if form.is_valid():
form.save()
template = 'add_post.html'
context = {'form':form}
return render(request,template,context)

settings.py:

STATIC_URL = '/static/'
STATICFILES_DIR = [Path(BASE_DIR,'static')]

MEDIA_URL = '/media/'
MEDIA_ROOT = Path(BASE_DIR,'media')


urls.py:

from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('posts.urls')),

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)



html form tag:
{% extends 'index.html' %}

{% load static %}

{% block content %}

<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{form.media}}
{{form.as_p}}
<input type="submit" value="Save" name="">
</form>

{% endblock %}

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a403ac50-9dfb-4a48-8007-9a52579886d4n%40googlegroups.com.
--
KeLLs

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADYqDX1-4P6g9G4Ss42J233aiDX8XyuFKmkzB%2BXq-K3xQ4Bnbg%40mail.gmail.com.

Re: Python/Django, "The 'poster' attribute has no file associated with it"

Did you create media directory in your base directory?

On Thu 27 Aug, 2020, 8:33 PM Tony Hall, <thalldakota@gmail.com> wrote:
I'm relatively new to programming and I'm having some trouble with the ImageField in my models.py. 

I keep getting the error in the attachment every time I load the local:8000.

My models.py is: 

from django.db import models

class Pilot(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
count = models.IntegerField()
writer = models.CharField(max_length=200)
year = models.IntegerField()
script = models.FileField(blank=True, null=True, upload_to="scripts")
poster = models.ImageField(blank=True, null=True, upload_to="posters")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

def __str__(self):
return self.title

@property
def imageURL(self):
try:
url = self.poster.url
except:
url = ''
print('URL:', url)
return url

The settings.py :
STATIC_URL = '/static/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

STATICFILES_DIR = [
os.path.join(BASE_DIR, 'static')
]

The 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('', include('script_app.urls')),
]

if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


How do I fix this?!!!

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2aae39fa-8fe5-4f83-b139-60918022ae61n%40googlegroups.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP6mExiz2-3ohsm4izrBUCO8SocmkksocsKe3P_KoTEprLyT6A%40mail.gmail.com.

Re: plz help i found this kinda problem when i run

You need to create a directory named templates in your current directory i.e., any app or project directory under that templates directory create html file and include that html file with render method.


On Thu 27 Aug, 2020, 10:04 PM Ogunsanya Opeyemi, <ogunsanyaopeyemi4@gmail.com> wrote:
This means that your current_datetime.html template does not exists in any of those directory in the defined directory under templates in your setting.py file.



On Thu, Aug 27, 2020 at 4:01 PM ALAKO ABIYO <aleludago@gmail.com> wrote:

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/time/

Django Version: 1.8
Python Version: 2.7.17
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/home/django/mysite/templates/current_datetime.html (File does not exist)
/home/html/example.com/current_datetime.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/home/aa/.local/lib/python2.7/site-packages/django/contrib/admin/templates/current_datetime.html (File does not exist)
/home/aa/.local/lib/python2.7/site-packages/django/contrib/auth/templates/current_datetime.html (File does not exist)



Traceback:
File "/home/aa/.local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/aa/mysite/mysite/views.py" in current_datetime
  12.     t=get_template('current_datetime.html')
File "/home/aa/.local/lib/python2.7/site-packages/django/template/loader.py" in get_template
  46.     raise TemplateDoesNotExist(template_name)

Exception Type: TemplateDoesNotExist at /time/
Exception Value: current_datetime.html

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/898d34f9-b67c-40aa-9dc9-32fab2e5f50cn%40googlegroups.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABJxPrFbRGNKBYog9HCL2AdNKe5DVtN0WZ1y5x0jrhM3O%3DixMg%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP6mExh9t4H8p8sPMZkdZ%2Bgb%2BpeNquNDCdOhja%3DBDFChLeb81Q%40mail.gmail.com.

Re: Can Anyone suggest on Snowflake database connection using Django?

Hi everyone,

I am also searching for a solution for this.
Please Help

Thanks

On Tuesday, October 29, 2019 at 5:41:16 PM UTC+5:30 Avinash Gaurav wrote:
Hi All,
I am trying to create an engine in settings.py of django app to connect to snowflake database,
but not able to do so. Since snowflake is a 3rd party database for django, so not able to figure out
if the connection is possible, however I am able to connect using simple python script using snowflake connector.
So need some quick suggestion, if it seems interesting.

Thanks.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e77a02ef-9f52-4c92-8a26-cb60c34a4c50n%40googlegroups.com.