Re: SMTP Authentification error

2022-05-01 Thread 'Delvin Alexander' via Django users
Improvements! i fixed my settings.py file and now i do not get the error. 
The only problem is that for my email, i do not get the email notification 
to reset my password. Any clues to this?

On Sunday, May 1, 2022 at 4:08:46 AM UTC-7 Mahendra Yadav wrote:

> I Know this solution charges are applicable if you want?
>
> Mahendra Yadav
>
> On Wed, 27 Apr 2022, 11:08 am 'Delvin Alexander' via Django users, <
> django...@googlegroups.com> wrote:
>
>> Hello everyone, 
>>
>> May you please assist in informing me on what i need to do to resolve 
>> this issue. 
>>
>> - *SMTPAuthenticationError at /password-reset/*
>> *- (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 
>> https://support.google.com/mail/?p=BadCredentials 
>> <https://support.google.com/mail/?p=BadCredentials> 
>> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>>
>>
>> I included the 16 character code to my environment variable and called it 
>> in my settings.pymfile,  but still the error occurs. Also here is my 
>> settings.py file:
>>
>> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
>> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com>'*
>> *EMAIL_PORT = 587*
>> *EMAIL_USE_TLS = True*
>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>
>> -- 
>>
> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a87e4b6a-6c5d-49ea-b308-2121936054fdn%40googlegroups.com.


Re: SMTP Authentification error

2022-04-29 Thread &#x27;Delvin Alexander&#x27; via Django users
Good Afternoon,

i included the db_user and db_password becasue that was what my environment 
variable used in my advanced settings. When i debugged i did use both email 
user and db user and got the same result. Also i tried everyone's answer 
but still obtained the same result. Is it something i might have done 
wrong? I will try to rewatch the videos again but if someone has another 
try i can give then please inform me. i have been stuck for a while on this 
one. 

On Friday, April 29, 2022 at 2:30:49 AM UTC-7 h.bash...@gmail.com wrote:

> Hi there, 
>
> EMAIL_BACKEND = 'django.core.mail.backends.*smtp.EmailBackend'*
> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com/>'*
> *EMAIL_PORT = 587*
> *EMAIL_USE_TLS = True*
> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
> in this code you just need to provide that email on which you will 
> receive the email i means   that gmail account why you use the db user or 
> db password ?
> here the solution to receive emails like 
> *EMAIL_HOST_USER = exa...@gmail.com*
> *EMAIL_HOST_PASSWORD = 12345678*
>
>
>
> On Thu, Apr 28, 2022 at 8:00 AM 'Delvin Alexander' via Django users <
> django...@googlegroups.com> wrote:
>
>> i thought that because i had that as my variable name that i had to call 
>> upon that name. Thank you, i will give that a try. 
>>
>> On Tuesday, April 26, 2022 at 11:33:20 PM UTC-7 jul.ale...@gmail.com 
>> wrote:
>>
>>> Seem pretty clear, you are calling db user and db password instead of 
>>> email and email password, 
>>>
>>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>>
>>> Regards,
>>>
>>> Julio Cojom
>>>
>>> El mar, 26 abr 2022 a las 23:38, 'Delvin Alexander' via Django users (<
>>> django...@googlegroups.com>) escribió:
>>>
>>>> Hello everyone, 
>>>>
>>>> May you please assist in informing me on what i need to do to resolve 
>>>> this issue. 
>>>>
>>>> - *SMTPAuthenticationError at /password-reset/*
>>>> *- (535, b'5.7.8 Username and Password not accepted. Learn more 
>>>> at\n5.7.8 https://support.google.com/mail/?p=BadCredentials 
>>>> <https://support.google.com/mail/?p=BadCredentials> 
>>>> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>>>>
>>>>
>>>> I included the 16 character code to my environment variable and called 
>>>> it in my settings.pymfile,  but still the error occurs. Also here is my 
>>>> settings.py file:
>>>>
>>>> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
>>>> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com>'*
>>>> *EMAIL_PORT = 587*
>>>> *EMAIL_USE_TLS = True*
>>>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>>>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>>>
>>>> -- 
>>>> 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...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/274f9087-f97c-4f15-bbc7-708a3538e75fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/274f9087-f97c-4f15-bbc7-708a3538e75fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ce27a06a-f5fb-48b7-ac88-873fdcad5d18n%40googlegroups.com.


Re: SMTP Authentification error

2022-04-27 Thread &#x27;Delvin Alexander&#x27; via Django users
okay i did both but now i am getting this error. Any clue on why?

*SMTPSenderRefused at /password-reset/*


*(530, b'5.7.0 Authentication Required. Learn more at\n5.7.0 
https://support.google.com/mail/?p=WantAuthError 
w137-20020a62828f00b0050d2f9c3409sm14545822pfd.199 - gsmtp', 
'webmaster@localhost')*
On Wednesday, April 27, 2022 at 12:27:02 AM UTC-7 dashlaksh...@gmail.com 
wrote:

> Check whether you have turned on less secure apps or not.
>
> On Wed, Apr 27, 2022, 11:07 'Delvin Alexander' via Django users <
> django...@googlegroups.com> wrote:
>
>> Hello everyone, 
>>
>> May you please assist in informing me on what i need to do to resolve 
>> this issue. 
>>
>> - *SMTPAuthenticationError at /password-reset/*
>> *- (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 
>> https://support.google.com/mail/?p=BadCredentials 
>> <https://support.google.com/mail/?p=BadCredentials> 
>> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>>
>>
>> I included the 16 character code to my environment variable and called it 
>> in my settings.pymfile,  but still the error occurs. Also here is my 
>> settings.py file:
>>
>> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
>> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com>'*
>> *EMAIL_PORT = 587*
>> *EMAIL_USE_TLS = True*
>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>
>> -- 
>>
> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a6f92133-32db-4f4a-ae46-bb1f7644b431n%40googlegroups.com.


Re: SMTP Authentification error

2022-04-27 Thread &#x27;Delvin Alexander&#x27; via Django users
i thought that because i had that as my variable name that i had to call 
upon that name. Thank you, i will give that a try. 

On Tuesday, April 26, 2022 at 11:33:20 PM UTC-7 jul.ale...@gmail.com wrote:

> Seem pretty clear, you are calling db user and db password instead of 
> email and email password, 
>
> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>
> Regards,
>
> Julio Cojom
>
> El mar, 26 abr 2022 a las 23:38, 'Delvin Alexander' via Django users (<
> django...@googlegroups.com>) escribió:
>
>> Hello everyone, 
>>
>> May you please assist in informing me on what i need to do to resolve 
>> this issue. 
>>
>> - *SMTPAuthenticationError at /password-reset/*
>> *- (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 
>> https://support.google.com/mail/?p=BadCredentials 
>> <https://support.google.com/mail/?p=BadCredentials> 
>> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>>
>>
>> I included the 16 character code to my environment variable and called it 
>> in my settings.pymfile,  but still the error occurs. Also here is my 
>> settings.py file:
>>
>> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
>> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com>'*
>> *EMAIL_PORT = 587*
>> *EMAIL_USE_TLS = True*
>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/274f9087-f97c-4f15-bbc7-708a3538e75fn%40googlegroups.com.


SMTP Authentification error

2022-04-26 Thread &#x27;Delvin Alexander&#x27; via Django users
Hello everyone, 

May you please assist in informing me on what i need to do to resolve this 
issue. 

- *SMTPAuthenticationError at /password-reset/*
*- (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 
https://support.google.com/mail/?p=BadCredentials 
j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*


I included the 16 character code to my environment variable and called it 
in my settings.pymfile,  but still the error occurs. Also here is my 
settings.py file:

- *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
*EMAIL_HOST = 'smtp.gmail.com'*
*EMAIL_PORT = 587*
*EMAIL_USE_TLS = True*
*EMAIL_HOST_USER = os.environ.get('DB_USER')*
*EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com.


Re: delete button

2022-04-13 Thread &#x27;Delvin Alexander&#x27; via Django users
test func is a function that my 'User' passes tests mixins runs in django.

Also thank you for informing me to include less. I put 3 files there
because i thought someone would have needed it.

On Tue, Apr 12, 2022 at 11:20 PM Antonis Christofides <
anto...@antonischristofides.com> wrote:

> What is `test_func()`?
>
> In addition, if you want people to help you, it would be a good idea to
> help them by giving them the smallest possible amount of code that
> reproduces the problem. (In fact, whenever I do that, in about 50% of cases
> I solve the problem myself during the reduction process.)
>
> Regards,
>
> Antonis
>
> On 13/04/2022 07.32, 'Delvin Alexander' via Django users wrote:
>
> Hello everyone,
>
> i am having trouble. i created a delete button but my page does not
> confirm the deletion of the post, nor does it redirect to another page. may
> someone help guide me on what it is i have done wrong and explain for me
> please?
>
> - I feel as though the problem could be located in my views.py but not sure
>
>
> Here is my views.py:
>
> *from django.shortcuts import render*
> *from django.contrib.auth.mixins import LoginRequiredMixin,
> UserPassesTestMixin*
> *from django.views.generic import ListView, DetailView, CreateView,
> UpdateView, DeleteView*
> *from .models import Post*
>
>
> *def home(request):*
> *context = {*
> *'posts': Post.objects.all()*
> *}*
> *return render(request, 'blog/home.html', context)*
>
>
> *class PostListView(ListView):*
> *model = Post*
> *template_name = 'blog/home.html'*
> *context_object_name = 'posts'*
> *ordering = ['-date_posted']*
>
>
> *class PostDetailView(DetailView):*
> *model = Post*
>
>
> *class PostCreateView(LoginRequiredMixin, CreateView):*
> *model = Post*
> *fields = ['title', 'content']*
>
> *def form_valid(self, form):*
> *form.instance.author = self.request.user*
> *return super().form_valid(form)*
>
> *class PostUpdateView(LoginRequiredMixin, UserPassesTestMixin,
> UpdateView):*
> *model = Post*
> *fields = ['title', 'content']*
>
> *def form_valid(self, form):*
> *form.instance.author = self.request.user*
> *return super().form_valid(form)*
>
> *def test_func(self):*
> *post = self.get_object()*
> *if self.request.user == post.author:*
> *return True*
> *return False*
>
> *class PostDeleteView(LoginRequiredMixin, UserPassesTestMixin,
> DeleteView):*
> *model = Post*
> *success_url = 'blog'*
>
> *def test_func(self):*
> *post = self.get_object()*
> *if self.request.user == post.author:*
> *return True*
> *return False*
>
> *def about(request):*
> *return render(request, 'blog/about.html', {'title': 'About'})*
>
>
>
> Here is my urls.py:
>
> *from django.urls import path*
> *from .views import PostListView, PostDetailView, PostCreateView,
> PostUpdateView, PostDeleteView*
> *from . import views*
>
> *urlpatterns = [*
> *path('', PostListView.as_view(), name='blog-home'),*
> *path('post//', PostDetailView.as_view(), name='post-detail'),*
> *path('post/new/', PostCreateView.as_view(), name='post-create'),*
> *path('post//update/', PostUpdateView.as_view(),
> name='post-update'),*
> *path('post//delete/', PostDeleteView.as_view(),
> name='post-delete'),*
> *path('about/', views.about, name='blog-about'),*
> *]*
>
>
> And here is my post_confirm_delete.html:
>
> *{% extends "blog/base.html" %}*
> *{% block content %}*
> **
> *{% csrf_token %}*
> **
> *Delete Post*
> *Are you sure you want to delete this post? "{{
> object.title }}"*
> **
> **
> *Yes,
> Delete*
> *http://object.id> %}">Cancel  *
> **
> **
> *   *
> *{% endblock content %}*
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3a23eabf-f8b

delete button

2022-04-12 Thread &#x27;Delvin Alexander&#x27; via Django users
Hello everyone,

i am having trouble. i created a delete button but my page does not confirm 
the deletion of the post, nor does it redirect to another page. may someone 
help guide me on what it is i have done wrong and explain for me please?

- I feel as though the problem could be located in my views.py but not sure


Here is my views.py:

*from django.shortcuts import render*
*from django.contrib.auth.mixins import LoginRequiredMixin, 
UserPassesTestMixin*
*from django.views.generic import ListView, DetailView, CreateView, 
UpdateView, DeleteView*
*from .models import Post*


*def home(request):*
*context = {*
*'posts': Post.objects.all()*
*}*
*return render(request, 'blog/home.html', context)*


*class PostListView(ListView):*
*model = Post*
*template_name = 'blog/home.html'*
*context_object_name = 'posts'*
*ordering = ['-date_posted']*


*class PostDetailView(DetailView):*
*model = Post*


*class PostCreateView(LoginRequiredMixin, CreateView):*
*model = Post*
*fields = ['title', 'content']*

*def form_valid(self, form):*
*form.instance.author = self.request.user*
*return super().form_valid(form)*

*class PostUpdateView(LoginRequiredMixin, UserPassesTestMixin, UpdateView):*
*model = Post*
*fields = ['title', 'content']*

*def form_valid(self, form):*
*form.instance.author = self.request.user*
*return super().form_valid(form)*

*def test_func(self):*
*post = self.get_object()*
*if self.request.user == post.author:*
*return True*
*return False*

*class PostDeleteView(LoginRequiredMixin, UserPassesTestMixin, DeleteView):*
*model = Post*
*success_url = 'blog'*

*def test_func(self):*
*post = self.get_object()*
*if self.request.user == post.author:*
*return True*
*return False*

*def about(request):*
*return render(request, 'blog/about.html', {'title': 'About'})*



Here is my urls.py:

*from django.urls import path*
*from .views import PostListView, PostDetailView, PostCreateView, 
PostUpdateView, PostDeleteView*
*from . import views*

*urlpatterns = [*
*path('', PostListView.as_view(), name='blog-home'),*
*path('post//', PostDetailView.as_view(), name='post-detail'),*
*path('post/new/', PostCreateView.as_view(), name='post-create'),*
*path('post//update/', PostUpdateView.as_view(), 
name='post-update'),*
*path('post//delete/', PostDeleteView.as_view(), 
name='post-delete'),*
*path('about/', views.about, name='blog-about'),*
*]*


And here is my post_confirm_delete.html:

*{% extends "blog/base.html" %}*
*{% block content %}*
**
*{% csrf_token %}*
**
*Delete Post*
*Are you sure you want to delete this post? "{{ 
object.title }}"*
**
**
*Yes, 
Delete*
*Cancel  *
**
**
*   *
*{% endblock content %}*


  

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3a23eabf-f8bd-4fa3-a27b-199a3aabf33bn%40googlegroups.com.


Stuck

2022-03-27 Thread &#x27;Delvin Alexander&#x27; via Django users
Hello everyone,

I am trying to register a new user by watching the Django tutorial. I have 
created the new user but upon attempting to log the new user in I get an, 

*"FileNotFoundError at /login/[Errno 2] No such file or directory: 
'C:\\Users\\delvi\\django_project\\media\\default.jpg'"*

But on my visual code it tells me this, "Exception has occurred: 
ImproperlyConfigured

   - 

*Requested setting INSTALLED_APPS, but settings are not configured. You 
must either define the environment variable DJANGO_SETTINGS_MODULE or call 
settings.configure() before accessing settings.*
* File "C:\Users\delvi\django_project\users\models.py", line 2, in  
from django.contrib.auth.models import User"*


Here is my model.py file:

from django.db import models
from django.contrib.auth.models import User
from PIL import Image
import os
from django.core.asgi import get_asgi_application

class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg', 
upload_to='profile_pics')

def __str__(self):
return f'{self.user.username} Profile'

def save(self, *args, **kwargs):
super(Profile, self).save(*args, **kwargs)

img = Image.open(self.image.path)
file = open('media')

if img.height > 300 or img.width > 300:
output_size = (300, 300)
img.thumbnail(output_size)
img.save(self.image.path)
And here is my views.py file for the User folder:

from django.shortcuts import render, redirect
from django.contrib import messages
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
from django.contrib.auth.decorators import login_required


def register(request):
if request.method == 'POST':
form = UserRegisterForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
messages.success(request, f'Your Account has been created you 
are now able to log in {username}!')
return redirect('login')
else:
form = UserRegisterForm()
return render(request, 'users/register.html', {'form': form})

@login_required
def profile(request):
if request.method == 'POST':
u_form = UserUpdateForm(request.POST, instance=request.user)
p_form = ProfileUpdateForm(request.POST, request.FILES, 
instance=request.user.profile)
if u_form.is_valid() and p_form.is_valid():
u_form.save()
p_form.save()
messages.success(request, f'Your Account has been updated!')
return redirect('profile')
else:
u_form = UserUpdateForm(instance=request.user)
p_form = ProfileUpdateForm(instance=request.user.profile)

context = {
'u_form': u_form,
'p_form': p_form,
}

return render(request, 'users/profile.html', context)
*Would anyone know the reason why i am getting two mistakes ?*


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4caa9f7-3715-4486-9c8c-feca7ad31b2an%40googlegroups.com.


Re: FileNotFoundError at /login/

2022-03-24 Thread &#x27;Delvin Alexander&#x27; via Django users
I did just that but now this error popped up on my visual code. Will i have 
to go into my setting.py file and create a new app for my models.py?

*Exception has occurred: ImproperlyConfigured*

*Requested setting INSTALLED_APPS, but settings are not configured. You 
must either define the environment variable DJANGO_SETTINGS_MODULE or call 
settings.configure() before accessing settings.*
* File "C:\Users\delvi\django_project\users\models.py", line 2, in  
from django.contrib.auth.models import User*

I also ran the web page but the same issue occurred. Would it just be the 
placement of my code that i made a mistake on?

Models.py file 
*from django.db import models*
*from django.contrib.auth.models import User*
*from PIL import Image*

*class Profile(models.Model):*
*user = models.OneToOneField(User, on_delete=models.CASCADE)*
*image = models.ImageField(default='default.jpg', 
upload_to='profile_pics')*

*def __str__(self):*
*return f'{self.user.username} Profile'*

*def save(self, *args, **kwargs):*
*super(Profile, self).save(*args, **kwargs)*

*img = Image.open(self.image.path)*
*file = open('media.ext')*

*if img.height > 300 or img.width > 300:*
*output_size = (300, 300)*
*img.thumbnail(output_size)*
*img.save(self.image.path)*


On Thursday, March 24, 2022 at 7:19:00 AM UTC-7 shahsawoo...@gmail.com 
wrote:

> 1. According to your model, you meant the models.py file and default.jpg 
> are in same directory.
> => But according to the error it smells that they are not same directory, 
> so try to point to the exact relative path of the image.
>
> On Thursday, March 24, 2022 at 10:10:13 AM UTC+5 Delvin Alexander wrote:
>
>> would anyone know why this is popping up for me and where can i go to 
>> solve this issue?
>>
>> - [Errno 2] No such file or directory: 
>> 'C:\\Users\\delvi\\django_project\\media\\default.jpg'
>>
>> *Here is my models.py:*
>> from django.db import models
>> from django.contrib.auth.models import User
>> from PIL import Image
>>
>> class Profile(models.Model):
>> user = models.OneToOneField(User, on_delete=models.CASCADE)
>> image = models.ImageField(default='default.jpg', 
>> upload_to='profile_pics')
>> 
>> def __str__(self):
>> return f'{self.user.username} Profile'
>>
>> def save(self, *args, **kwargs):
>> super(Profile, self).save(*args, **kwargs)
>> 
>> img = Image.open(self.image.path)
>> 
>> if img.height > 300 or img.width > 300:
>> output_size = (300, 300)
>> img.thumbnail(output_size)
>> img.save(self.image.path)
>>
>>
>> *And here is my signlas.py:*
>> from django.db.models.signals import post_save
>> from django.contrib.auth.models import User
>> from django.dispatch import receiver
>> from .models import Profile
>>
>>
>> @receiver(post_save, sender=User)
>> def create_profile(sender, instance, created, **kwargs):
>> if created:
>> Profile.objects.create(user=instance)
>> 
>> 
>> @receiver(post_save, sender=User)
>> def save_profile(sender, instance, **kwargs):
>> instance.profile.save()
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2f327270-7b90-43d1-88ce-65a52d4ed558n%40googlegroups.com.


FileNotFoundError at /login/

2022-03-23 Thread &#x27;Delvin Alexander&#x27; via Django users
would anyone know why this is popping up for me and where can i go to solve 
this issue?

- [Errno 2] No such file or directory: 
'C:\\Users\\delvi\\django_project\\media\\default.jpg'

*Here is my models.py:*
from django.db import models
from django.contrib.auth.models import User
from PIL import Image

class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg', 
upload_to='profile_pics')

def __str__(self):
return f'{self.user.username} Profile'

def save(self, *args, **kwargs):
super(Profile, self).save(*args, **kwargs)

img = Image.open(self.image.path)

if img.height > 300 or img.width > 300:
output_size = (300, 300)
img.thumbnail(output_size)
img.save(self.image.path)


*And here is my signlas.py:*
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.dispatch import receiver
from .models import Profile


@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
if created:
Profile.objects.create(user=instance)


@receiver(post_save, sender=User)
def save_profile(sender, instance, **kwargs):
instance.profile.save()

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/075a512d-671f-461b-8834-3623e4c5ce58n%40googlegroups.com.


Re: runserver not working

2022-03-22 Thread &#x27;Delvin Alexander&#x27; via Django users
i did that but the problem still remains :(

On Tuesday, March 22, 2022 at 2:09:33 AM UTC-7 sebasti...@gmail.com wrote:

> Hey,
>
> I think yoz don't have installed django package. Please install it over 
> pip install django
>
> Regards
>
> 'Delvin Alexander' via Django users  schrieb 
> am Di., 22. März 2022, 06:07:
>
>> would anyone know why my "manage.py runserver" is not working?
>>
>> Every time i try running it on the command prompt, i get relocated to my 
>> visual studio of manage.py file that states this:
>>
>> #*!/usr/bin/env python*
>> *"""Django's command-line utility for administrative tasks."""*
>> *import os*
>> *import sys*
>>
>>
>> *def main():*
>> *"""Run administrative tasks."""*
>> *os.environ.setdefault('DJANGO_SETTINGS_MODULE', 
>> 'django_project.settings')*
>> *try:*
>> *from django.core.management import execute_from_command_line*
>> *except ImportError as exc:*
>> *raise ImportError(*
>> *"Couldn't import Django. Are you sure it's installed and "*
>> *"available on your PYTHONPATH environment variable? Did you 
>> "*
>> *"forget to activate a virtual environment?"*
>> *) from exc*
>> *execute_from_command_line(sys.argv)*
>>
>>
>> *if __name__ == '__main__':*
>> *main()*
>>
>>
>> A step in the right direction will be super helpful for me.
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/69291c68-61e7-4557-8175-7b705bcfcbb0n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/69291c68-61e7-4557-8175-7b705bcfcbb0n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a60f5102-0638-4fae-9dec-e870e6c2c98fn%40googlegroups.com.


runserver not working

2022-03-21 Thread &#x27;Delvin Alexander&#x27; via Django users
would anyone know why my "manage.py runserver" is not working?

Every time i try running it on the command prompt, i get relocated to my 
visual studio of manage.py file that states this:

#*!/usr/bin/env python*
*"""Django's command-line utility for administrative tasks."""*
*import os*
*import sys*


*def main():*
*"""Run administrative tasks."""*
*os.environ.setdefault('DJANGO_SETTINGS_MODULE', 
'django_project.settings')*
*try:*
*from django.core.management import execute_from_command_line*
*except ImportError as exc:*
*raise ImportError(*
*"Couldn't import Django. Are you sure it's installed and "*
*"available on your PYTHONPATH environment variable? Did you "*
*"forget to activate a virtual environment?"*
*) from exc*
*execute_from_command_line(sys.argv)*


*if __name__ == '__main__':*
*main()*


A step in the right direction will be super helpful for me.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/69291c68-61e7-4557-8175-7b705bcfcbb0n%40googlegroups.com.


Re: profile page and new user will not save

2022-03-09 Thread &#x27;Delvin Alexander&#x27; via Django users
Sorry for the late reply, but here is my signlay.py file

from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.dispatch import receiver
from .models import Profile


@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
if created:
Profile.objects.create(user=instance)


@receiver(post_save, sender=User)
def save_profile(sender, instance, **kwargs):
instance.Profile.save()

On Wednesday, February 23, 2022 at 1:28:58 AM UTC-8 omkar...@gmail.com 
wrote:

> Something went wrong with the signals. Paste your signals.py file. 
>
> On Wed, Feb 23, 2022, 10:52 AM 'Delvin Alexander' via Django users <
> django...@googlegroups.com> wrote:
>
>> Hello Everyone,
>>
>> I am having trouble saving a new profile, and user when they are created. 
>> Upon creating a new user and profile, i get this:
>>
>> "TypeError: Profile.save() got an unexpected keyword argument 
>> 'force_insert'"
>>
>> Would anyone know why this is popping up for me
>>
>>
>> Here is my work for that particular page as well.
>>
>> from django.shortcuts import render, redirect
>> from django.contrib import messages
>> from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
>> from django.contrib.auth.decorators import login_required
>>
>>
>> def register(request):
>> if request.method == 'POST':
>> form = UserRegisterForm(request.POST)
>> if form.is_valid():
>> form.save()
>> username = form.cleaned_data.get('username')
>> messages.success(request, f'Your Account has been created you 
>> are now able to log in {username}!')
>> return redirect('login')
>> else:
>> form = UserRegisterForm()
>> return render(request, 'users/register.html', {'form': form})
>>
>> @login_required
>> def profile(request):
>> if request.method == 'POST':
>> u_form = UserUpdateForm(request.POST, instance=request.user)
>> p_form = ProfileUpdateForm(request.POST, request.FILES, 
>> instance=request.user.profile)
>> if u_form.is_valid() and p_form.is_valid():
>> u_form.save()
>> p_form.save()
>> messages.success(request, f'Your Account has been updated!')
>> return redirect('profile')
>> else:
>> u_form = UserUpdateForm(instance=request.user)
>> p_form = ProfileUpdateForm(instance=request.user.profile)
>> 
>> context = {
>> 'u_form': u_form,
>> 'p_form': p_form,
>> }
>> 
>> return render(request, 'users/profile.html', context)
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/39c57e72-9e09-403e-97db-562ef943db4an%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/39c57e72-9e09-403e-97db-562ef943db4an%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b7e20438-fa2d-4f72-9fa9-dfa761194c72n%40googlegroups.com.


profile page and new user will not save

2022-02-22 Thread &#x27;Delvin Alexander&#x27; via Django users
Hello Everyone,

I am having trouble saving a new profile, and user when they are created. 
Upon creating a new user and profile, i get this:

"TypeError: Profile.save() got an unexpected keyword argument 
'force_insert'"

Would anyone know why this is popping up for me


Here is my work for that particular page as well.

from django.shortcuts import render, redirect
from django.contrib import messages
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
from django.contrib.auth.decorators import login_required


def register(request):
if request.method == 'POST':
form = UserRegisterForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
messages.success(request, f'Your Account has been created you 
are now able to log in {username}!')
return redirect('login')
else:
form = UserRegisterForm()
return render(request, 'users/register.html', {'form': form})

@login_required
def profile(request):
if request.method == 'POST':
u_form = UserUpdateForm(request.POST, instance=request.user)
p_form = ProfileUpdateForm(request.POST, request.FILES, 
instance=request.user.profile)
if u_form.is_valid() and p_form.is_valid():
u_form.save()
p_form.save()
messages.success(request, f'Your Account has been updated!')
return redirect('profile')
else:
u_form = UserUpdateForm(instance=request.user)
p_form = ProfileUpdateForm(instance=request.user.profile)

context = {
'u_form': u_form,
'p_form': p_form,
}

return render(request, 'users/profile.html', context)

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39c57e72-9e09-403e-97db-562ef943db4an%40googlegroups.com.


Re: migrations: "no changes detected"

2022-02-08 Thread &#x27;Delvin Alexander&#x27; via Django users
there is! but will this have something to do with it?
- "from django.contrib.auth.models import User"

Rite now the error is displaying this:
- Requested setting INSTALLED_APPS, but settings are not configured. You
must either define the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.

On Tue, Feb 8, 2022 at 7:32 PM ramadhan ngallen  wrote:

> On your app(blog) on the module(folder) migrations,   make sure there is a
> file named   __init__.py
>
>
> You can share app structure too
> On 9 Feb 2022, 06:26 +0300, 'Delvin Alexander' via Django users <
> django-users@googlegroups.com>, wrote:
>
> here is a list of my installed apps:
>
> i added the blog.apps but still nothing.
>
>
> INSTALLED_APPS = ['blog.apps.BlogConfig','django.contrib.admin',
>  'django.contrib.auth','django.contrib.contenttypes',
> 'django.contrib.sessions','django.contrib.messages',
> 'django.contrib.staticfiles',
>
>
> On Mon, Feb 7, 2022 at 9:37 PM RANGA BHARATH JINKA <
> bharathjink...@gmail.com <https://mailto:bharathjink...@gmail.com>> wrote:
>
> Hi,
>
> I think you forgot to add the app name in settings file. Please add the
> app names in installed apps. Then it will find out the models.
>
> All the best
>
>
> On Tue, 8 Feb 2022, 10:14 am 'Delvin Alexander' via Django users, <
> django-users@googlegroups.com
> <https://mailto:django-users@googlegroups.com>> wrote:
>
> I am trying to run migrations so that i can create a table, but when I
> type out, "python manage.py makemigrations"
> it returns this: "no changes detected"
>
> would anyone know the reason for 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+unsubscr...@googlegroups.com
> <https://mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/639770ea-db24-469a-a123-6f4cb2af3036n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/639770ea-db24-469a-a123-6f4cb2af3036n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>  --
> 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+unsubscr...@googlegroups.com
> <https://mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK5m314skg-HBhQx25mxzg4rHEp8-5jZEX8%2BT9Kr8uDHv-bR5A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK5m314skg-HBhQx25mxzg4rHEp8-5jZEX8%2BT9Kr8uDHv-bR5A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>  --
> 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+unsubscr...@googlegroups.com
> <https://mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADq-sifxMbkc%3DyZdXOw_RUwBq8QiKLUU_TY9RaC9ZfSytSq1%2BA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADq-sifxMbkc%3DyZdXOw_RUwBq8QiKLUU_TY9RaC9ZfSytSq1%2BA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d8834a19-4ff1-48e2-b101-046f9b9f0814%40Spark
> <https://groups.google.com/d/msgid/django-users/d8834a19-4ff1-48e2-b101-046f9b9f0814%40Spark?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADq-sicjbjRUs%3DrCpnf7xX79NZ55mEdEWTd8ixv%3D4%2BURoSuh%2Bg%40mail.gmail.com.


Re: migrations: "no changes detected"

2022-02-08 Thread &#x27;Delvin Alexander&#x27; via Django users
here is a list of my installed apps:

i added the blog.apps but still nothing.


INSTALLED_APPS = [
'blog.apps.BlogConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',



On Mon, Feb 7, 2022 at 9:37 PM RANGA BHARATH JINKA 
wrote:

> Hi,
>
> I think you forgot to add the app name in settings file. Please add the
> app names in installed apps. Then it will find out the models.
>
> All the best
>
>
> On Tue, 8 Feb 2022, 10:14 am 'Delvin Alexander' via Django users, <
> django-users@googlegroups.com> wrote:
>
>> I am trying to run migrations so that i can create a table, but when I
>> type out, "python manage.py makemigrations"
>> it returns this: "no changes detected"
>>
>> would anyone know the reason for 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/639770ea-db24-469a-a123-6f4cb2af3036n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/639770ea-db24-469a-a123-6f4cb2af3036n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK5m314skg-HBhQx25mxzg4rHEp8-5jZEX8%2BT9Kr8uDHv-bR5A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK5m314skg-HBhQx25mxzg4rHEp8-5jZEX8%2BT9Kr8uDHv-bR5A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADq-sifxMbkc%3DyZdXOw_RUwBq8QiKLUU_TY9RaC9ZfSytSq1%2BA%40mail.gmail.com.


migrations: "no changes detected"

2022-02-07 Thread &#x27;Delvin Alexander&#x27; via Django users
I am trying to run migrations so that i can create a table, but when I type 
out, "python manage.py makemigrations"
it returns this: "no changes detected"

would anyone know the reason for 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/639770ea-db24-469a-a123-6f4cb2af3036n%40googlegroups.com.


Re: web page blank

2022-02-07 Thread &#x27;Delvin Alexander&#x27; via Django users
it  is now, thank you for your help!

On Wed, Feb 2, 2022 at 12:23 AM Dev femibadmus 
wrote:

> Is it working fine for you?
>
>
> If not url blog/home.html?
>
> On Wed, Feb 2, 2022, 08:08 Sebastian Jung 
> wrote:
>
>> Hello,
>>
>> Please try:
>>
>> context = {
>>     'posts': post
>> }
>>
>> 'Delvin Alexander' via Django users 
>> schrieb am Mi., 2. Feb. 2022, 06:59:
>>
>>> Hello everyone,
>>>
>>> I am currently following a django tutorial regarding applications. I
>>> have followed through completely but for some reason, when I run server, i
>>> incur no errors but the web page is blank. Why would this be?
>>>
>>> Here is what is not displayed:
>>>
>>> from my Home.html file:
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> {% for post in posts %}
>>> {{ post.title }}
>>> By {{ post.author }} on {{ post.date_posted}}
>>> {{ post.content }}
>>> {% endfor %}
>>>
>>> 
>>> 
>>>
>>> from my views.py file:
>>> from django.shortcuts import render
>>>
>>> post = [
>>> {
>>> 'author': 'CoreyMS',
>>> 'title': 'Blog Post',
>>> 'content': 'First Post Content',
>>> 'date_posted': 'August 27, 2018'
>>> },
>>> {
>>> 'author': 'Jane Doe',
>>> 'title': 'Blog Post 2',
>>> 'content': 'Second Post Content',
>>> 'date_posted': 'August 28, 2018'
>>> }
>>> ]
>>>
>>> def home(request):
>>> context = {
>>> 'post': post
>>> }
>>> return render(request, 'blog/home.html', context)
>>>
>>> def about(request):
>>> return render(request, 'blog/about.html')
>>>
>>> My urls.py:
>>> from django.urls import path
>>> from . import views
>>>
>>> urlpatterns = [
>>> path('', views.home, name='blog-home'),
>>> path('about/', views.about, name='blog-about'),
>>> ]
>>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/e9b557a6-403b-46ce-bc18-8d19b0091f2an%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/e9b557a6-403b-46ce-bc18-8d19b0091f2an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAKGT9mzFaC4Eq9B_76nb0N2%2BRW-%2BNkbLMdfJT0Vph2qWuGefOw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAKGT9mzFaC4Eq9B_76nb0N2%2BRW-%2BNkbLMdfJT0Vph2qWuGefOw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/OKU-v7eWPtc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAD9bWYzcLeS5HbKQvpa3v%3Drt015_Pufd8BVMe7R_U0OaGZO09g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAD9bWYzcLeS5HbKQvpa3v%3Drt015_Pufd8BVMe7R_U0OaGZO09g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADq-sidAHHy6V0%3DqXdOz%2BRDVfnB5cBragq%3DJ59Cd4R2yTk6xdQ%40mail.gmail.com.


web page blank

2022-02-01 Thread &#x27;Delvin Alexander&#x27; via Django users
Hello everyone,

I am currently following a django tutorial regarding applications. I have 
followed through completely but for some reason, when I run server, i incur 
no errors but the web page is blank. Why would this be?

Here is what is not displayed:

from my Home.html file:






{% for post in posts %}
{{ post.title }}
By {{ post.author }} on {{ post.date_posted}}
{{ post.content }}
{% endfor %}




from my views.py file:
from django.shortcuts import render

post = [
{
'author': 'CoreyMS',
'title': 'Blog Post',
'content': 'First Post Content',
'date_posted': 'August 27, 2018'
},
{
'author': 'Jane Doe',
'title': 'Blog Post 2',
'content': 'Second Post Content',
'date_posted': 'August 28, 2018'
}
]

def home(request):
context = {
'post': post
}
return render(request, 'blog/home.html', context)

def about(request):
return render(request, 'blog/about.html')

My urls.py:
from django.urls import path
from . import views

urlpatterns = [
path('', views.home, name='blog-home'),
path('about/', views.about, name='blog-about'),
]
  

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e9b557a6-403b-46ce-bc18-8d19b0091f2an%40googlegroups.com.


django module not found

2022-01-24 Thread &#x27;Delvin Alexander&#x27; via Django users
Hello,

I am new and just started to learn Django. I am attempting to create my 
first application and ofcourse progress to a website but i am having 
difficulty at the moment. here is whats going on:  

["Import "django.shortcut" could not be resolvedPylancereportMissingImports 

Exception has occurred: ModuleNotFoundError

   - 

No module named 'django.shortcut'
File "C:\Users\delvi\django_project\blog\views.py", line 1, in  
from django.shortcut import render]

I have tried looking online for an answer and still have yet to come to an 
answer that has resolved my issue. I even changed my interpreter, but this 
1 problem still remains. May you someone please help me?



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f931616a-652f-4ce0-9f8d-32435e9d6e04n%40googlegroups.com.