- problem with feed - 1 Update
- Collaborators wanted - 2 Updates
- Can I use Django for client-server communication ? - 1 Update
- Success Message after Submitting a form - 2 Updates
- django.urls.exceptions.NoReverseMatch: 'courses' is not a registered namespace - 4 Updates
- NoReverseMatch at /update-orders/12 Reverse for 'update_order' with arguments '('',)' not found. 1 pattern(s) tried: ['update\\-orders/(?P<pk>[0-9]+)$'] - 2 Updates
- Django Error - 'staticfiles' is not a registered tag library. Must be one of: admin_list admin_modify admin_urls - 1 Update
- Beginner question - 3 Updates
- Problem with user.username - 4 Updates
- is there any way to django3.0 & oracle 11g together? - 1 Update
- Reg: Django signal not working - 1 Update
- Error while sending email - 1 Update
- Long list in queryset's __in lookup - 1 Update
- Django pdfs - 1 Update
carlos <croch...@gmail.com>: Apr 23 11:09PM -0600
Hi, i have a website with SSL certificate
but when create feed syndication the link protocol always is http why?
how to change to https? in site_id a put only www.mydomain.com in
syndication say
<link>http://www.mydomain.com/news/</link>
any idea o link to find the problem in my setting put this
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
but nothing not change the protocol in feed :/
any help is welcome
Cheers
--
mohamed khaled <mohamed.k...@gmail.com>: Apr 23 09:23PM -0700
I can work with you about add design I have good knowledge in semantic I
created two apps and I have worked in third app form a while this my repo
with my friend all theses project I used bootstrap django semantic
django-filter and etc
On Tuesday, 21 April 2020 23:20:24 UTC+2, John McClain wrote:
mohamed khaled <mohamed.k...@gmail.com>: Apr 23 09:24PM -0700
this my repo https://github.com/khaldon
On Friday, 24 April 2020 06:23:41 UTC+2, mohamed khaled wrote:
mohamed khaled <mohamed.k...@gmail.com>: Apr 23 09:19PM -0700
if you have different apps in a different platform or like a desktop app or
mobile app you communicate with them or with a website using API in Django
has a very good package called Django REST framework you can take your
result of your GUI you can serialize or convert this data to JSON and send
it your app in Django app website and parse or take this JSON data and
translate to a dataset
On Wednesday, 22 April 2020 15:22:07 UTC+2, Sharanagouda Biradar wrote:
Ahmed Khairy <ahmed.he...@gmail.com>: Apr 23 06:24PM -0700
I have created this class with the success message but I am not receiving
the success message I requested, other pages are showing them but this one
is not
What might be wrong?
In the views:
class PostCreateView(LoginRequiredMixin, CreateView):
model = Post
fields = ['caption', 'design']
template_name = "post_form.html"
success_url = '/score'
success_message = "Your Design has been submitted for Review"
def form_valid(self, form):
form.instance.author = self.request.user
return super().form_valid(form)
in the HTML
<!-- Navbar -->
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }}" style="
padding-top:80px">
{{ message }}
</div>
{% endfor %}
{% endif %}
Thank you
mohamed khaled <mohamed.k...@gmail.com>: Apr 23 09:11PM -0700
just use SuccessMessageMixin
from django.contrib.messages.views import SuccessMessageMixin
class PostCreateView(LoginRequiredMixin,SuccessMessageMixin, CreateView):
model = Post
fields = ['caption', 'design']
template_name = "post_form.html"
success_url = '/score'
success_message = "Your Design has been submitted for Review"
it will work
On Friday, 24 April 2020 03:24:56 UTC+2, Ahmed Khairy wrote:
Bruno Gama <bqg...@gmail.com>: Apr 22 08:04PM -0700
Hi, I have a problem since I tried to use get_absolute_url(self): to enter
in a url beyond a photo.
When I used <a href="{{ course.get_absolute_url }}">, my index.html stopped
running.
Here I have the top level url.py
from django.contrib import admin
from django.urls import path, include
from simplemooc.core import views, urls
from simplemooc.courses import views, urls
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [path('admin/', admin.site.urls),
path('', include(('simplemooc.core.urls', 'simplemooc'),
namespace='core')),
path('cursos', include(('simplemooc.courses.urls',
'simplemooc'), namespace='courses'))]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)
Here courses/url.py
from django.urls import path
from simplemooc.courses import views
urlpatterns = [path('', views.index, name='index'),
path('/<slug:slug>/', views.details, name='datails')]
Here courses/model.py
from django.db import models
from django.urls import reverse
class CourseManager(models.Manager):
def search(self, query):
return self.get_queryset().filter(
models.Q(name__icontains=query) | \
models.Q(description__icontains=query)
)
class Course(models.Model):
name = models.CharField('Nome', max_length=100)
slug = models.SlugField('Atalho')
description = models.TextField('Descrição Simples', blank=True)
about = models.TextField('Sobre o Curso', blank=True)
start_date = models.DateField(
'Data de Início', null=True, blank=True
)
image = models.ImageField(
upload_to='courses/images', verbose_name='Imagem',
null=True, blank=True
)
created_at = models.DateTimeField(
'Criado em', auto_now_add=True
)
updated_at = models.DateTimeField('Atualizado em', auto_now=True)
objects = CourseManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('courses:datails', (), {'slug': self.slug})
class Meta:
verbose_name = 'Curso'
verbose_name_plural = 'Cursos'
ordering = ['name']
And here courses/views.py
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from .models import Course
def index(request):
courses = Course.objects.all()
template_name = 'courses\index.html'
context = {
'courses': courses
}
return render(request, template_name, context)
def details(request, slug):
course = get_object_or_404(Course, slug=slug)
context = {
'course': course
}
template_name = 'courses/datails.html'
return render(request, template_name, context)
My problem happens when I use:
<a href="{{ course.get_absolute_url }}">
in my index.html
Please, Anyone can help me?
Bruno Gama <bqg...@gmail.com>: Apr 22 08:08PM -0700
I have a problem since I tried to use get_absolute_url(self): to enter in a
url beyond a photo. When I used , my index.html stopped running.
Here I have the top level url.py
from django.contrib import adminfrom django.urls import path, includefrom simplemooc.core import views, urlsfrom simplemooc.courses import views, urlsfrom django.conf import settingsfrom django.conf.urls.static import static
urlpatterns = [path('admin/', admin.site.urls),
path('', include(('simplemooc.core.urls', 'simplemooc'), namespace='core')),
path('cursos', include(('simplemooc.courses.urls', 'simplemooc'), namespace='courses'))]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Here courses/url.py
from django.urls import pathfrom simplemooc.courses import views
urlpatterns = [path('', views.index, name='index'),
path('/<slug:slug>/', views.details, name='datails')]
Here courses/model.py
from django.db import modelsfrom django.urls import reverse
class CourseManager(models.Manager):
def search(self, query):
return self.get_queryset().filter(
models.Q(name__icontains=query) | \
models.Q(description__icontains=query)
)
class Course(models.Model):
name = models.CharField('Nome', max_length=100)
slug = models.SlugField('Atalho')
description = models.TextField('Descrição Simples', blank=True)
about = models.TextField('Sobre o Curso', blank=True)
start_date = models.DateField(
'Data de Início', null=True, blank=True
)
image = models.ImageField(
upload_to='courses/images', verbose_name='Imagem',
null=True, blank=True
)
created_at = models.DateTimeField(
'Criado em', auto_now_add=True
)
updated_at = models.DateTimeField('Atualizado em', auto_now=True)
objects = CourseManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('courses:datails', (), {'slug': self.slug})
class Meta:
verbose_name = 'Curso'
verbose_name_plural = 'Cursos'
ordering = ['name']
And here courses/views.py
from django.shortcuts import render, get_object_or_404from django.http import HttpResponse
from .models import Course
def index(request):
courses = Course.objects.all()
template_name = 'courses\index.html'
context = {
'courses': courses
}
return render(request, template_name, context)
def details(request, slug):
course = get_object_or_404(Course, slug=slug)
context = {
'course': course
}
template_name = 'courses/datails.html'
return render(request, template_name, context)
My problem happens when I use:
<a href="{{ course.get_absolute_url }}">
in my index.html
Please, Anyone can help me?
Jorge Gimeno <jlgim...@gmail.com>: Apr 23 09:53AM -0700
> from .models import Course
> <span class="kwd" style="font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; lin
> Bruno,
I believe it may be a typo in Course.get-absolute-url. In the reverse
call, the first argument should be 'course:details". In your code, it's
'course:datails'.
-Jorge
Bruno Gama <bqg...@gmail.com>: Apr 23 04:04PM -0300
I tried it, but happens the same error.
Sergei Sokov <soko...@gmail.com>: Apr 23 11:09AM -0700
Hello everybody
I have a problem:
NoReverseMatch at /update-orders/12
Reverse for 'update_order' with arguments '('',)' not found. 1 pattern(s) tried: ['update\\-orders/(?P<pk>[0-9]+)$']
Request Method: GET
Request URL: http://192.168.0.249:8000/update-orders/12
Django Version: 3.0.5
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'update_order' with arguments '('',)' not found. 1 pattern(s) tried: ['update\\-orders/(?P<pk>[0-9]+)$']
Exception Location: /root/.local/share/virtualenvs/myp4-4l8n6HJk/lib/python3.7/site-packages/django/urls/resolvers.py
in _reverse_with_prefix, line 677
Python Executable: /root/.local/share/virtualenvs/myp4-4l8n6HJk/bin/python
Python Version: 3.7.3
Python Path:
['/var/workspace/myp4/webprint',
'/usr/lib/python37.zip',
'/usr/lib/python3.7',
'/usr/lib/python3.7/lib-dynload',
'/root/.local/share/virtualenvs/myp4-4l8n6HJk/lib/python3.7/site-packages']
Why do I have this Error during template rendering?
detail_order.html
{% extends 'index.html' %}
{% block content %}
<p><a href="{% url 'orders' %}">Back</a></p>
<h1>Заказ {{get_order.number_order}}</h1>
<h2><a href="{% url 'update_order' get_order.id %}">Update</a></h2>
views.py
class UpdateOrderView(CustomSuccessMessageMixin, UpdateView):
model = Order
template_name = 'detail_order.html'
form_class = OrderForm
success_url = reverse_lazy('detail_order')
success_msg = 'Ok'
def get_context_data(self, **kwargs):
kwargs['update'] = True
return super().get_context_data(**kwargs)
urls.py
from django.contrib import admin
from django.urls import path, include
from .views import *
from print import views
urlpatterns = [
path('', views.home_page, name='index'),
path('orders', views.OrderCreateView.as_view(), name='orders'),
path('update-orders/<int:pk>', views.UpdateOrderView.as_view(),
name='update_order'), # THIS PATH
path('delete-orders/<int:pk>', views.DeleteOrderView.as_view(),
name='delete_order'),
path('detail-order/<int:pk>', views.DetailOrderView.as_view(),
name='detail_order'),
path('login', views.MyprojectLoginView.as_view(), name='login_page'),
path('register', views.RegisterUserView.as_view(),
name='register_page'),
path('logout', views.MyprojectLogout.as_view(), name='logout_page'),
]
Anonymous Patel <airbu...@gmail.com>: Apr 24 12:21AM +0530
Hey sergei.
Here is group know as errormania. This is group of Developers who are
solving this errors we developer's are facing.
And here is the. Link which can help you so take a look and let them know
you liked this channel.
If you like it they have telegram channel
@errormania you can join that as well
https://youtu.be/RPl-3CqTjQE
Raj Patel
mourice otieno Oduor <otienoma...@gmail.com>: Apr 23 11:11AM -0700
On Tuesday, 10 December 2019 11:00:32 UTC-5, Balaji wrote:
> *SGGS Institute of Engineering & Technology, Vishnupuri, Nanded.MH.India*
> *Official: bssh...@sggs.ac.in <javascript:> *
> * Mobile: +91-9270696267*
1
<https://stackoverflow.com/posts/61015726/timeline>
It's due to upgrading to Django3.0, use as mentioned above.
use:
{% load static %}
dradam lomas <theadamco...@gmail.com>: Apr 22 08:39PM -0700
Hello there! I am just starting out! I need help knowing how to get past
this screen. I'm just typing "Hello world", right now, but I plan to make a
website using Python.
Anonymous Patel <airbu...@gmail.com>: Apr 23 08:30PM +0530
https://www.youtube.com/channel/UCxxPBCkto7W8MX6TMctgLqw
This group of Developers on YouTube provide with solutions to all
programming errors you can always ask them for the solutions.
Follow there telegram channel
@errormania
Raj Patel
On Thu, 23 Apr, 2020, 8:15 pm dradam lomas, <theadamco...@gmail.com>
wrote:
Chucky Mada Madamombe <chuck...@gmail.com>: Apr 23 07:48PM +0200
Hello,
You need to create views and urls and a templates. Read more on the Django
documentation.
Regards
Chuck G. Madamombe
NAM: +264 81 842 1284
RSA: +27 78 208 7034
Twitter: @chuckygari
Skype: chuckygari
Facebook: Chucky Mada Madamombe
LinkedIn: Chucknorris Garikayi Madamombe
On Thu, 23 Apr 2020, 16:46 dradam lomas <theadamco...@gmail.com>
wrote:
Bishop Akolgo <bak...@gmail.com>: Apr 23 07:50AM -0700
i have a similar problem. when i installed the env and django it did not
require me to create password but after successfully installing django and
trying to open admin, i need password and i cannot enter so i am stuck.
Can someone help me?
On Tuesday, July 12, 2011 at 7:31:27 AM UTC+1, Suprnaturall wrote:
Jorge Gimeno <jlgim...@gmail.com>: Apr 23 09:56AM -0700
> https://groups.google.com/d/msgid/django-users/7f4f7a9f-cf9a-4bf1-9d63-d2b711a58f68%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7f4f7a9f-cf9a-4bf1-9d63-d2b711a58f68%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
Did you create an administrative user? In Django, it's python manage.py
createsuperuser
-Jorge
Allison Tretina <allison...@gmail.com>: Apr 23 01:03PM -0400
Open the python shell in your terminal.
$ python3 manage.py shell
Import the modules to access your admin values.
>>> from django.contrib.auth import get_user_model
Get the username first.
list(get_user_model().objects.fileter(is_superuser=True).values_list('username',
flat=True))
['someusername'] # The username attribute is returned as string.
Now, let's try to get the password.
list(get_user_model().objects.fileter(is_superuser=True).values_list('password',
flat=True))
['hykeft3_sha365$230001$nUYjkejaijfWESn98jalkoix3rgthaeTklia+SwklksileGs/2jilEFD/kesliI=']
# The output is a hex, and other metadata about the password.
Django does not store the raw password. But the password can be set for the
admin User object.
>>> u= set_password('s0m3pa$$w5rD')
>>> u.save()
>>> exit()
Return to the admin login and you should be able to login with the new set
password.
On Thu, Apr 23, 2020 at 11:59 AM Bishop Akolgo <bak...@gmail.com> wrote:
Allison Tretina <allison...@gmail.com>: Apr 23 01:07PM -0400
I have two typos on line 6 and 9. My bad.
>>> list(get_user_model().*objects.filter*(is_superuser=True).values_list('username',
flat=True))
>>> list(get_user_model().*objects.filter*(is_superuser=True).values_list('password',
flat=True))
On Thu, Apr 23, 2020 at 1:03 PM Allison Tretina <allison...@gmail.com>
wrote:
Benjamin Daneker <bend...@gmail.com>: Apr 23 09:52AM -0700
I just ran into the same issue, my company only recently upgraded to 11g
and they won't be upgrading again anytime soon. I've coded in a number of
languages over the past several years but I'm still very new to Python,
Django, Oracle, and databases in general. Creating the tables by hand is
definitely a pain but if doing so would allow me to continue running Django
3.0 I'll happily put in the effort
Obviously the April 2 date has passed so LTS has expired but is there any
harm in continuing to use Django 1.11? My app isn't all that complex, just
a feedback submission tool, but I don't know what features exist in 3.0 but
not in 1.11 that might break the app if I rollback my version.
sahil khan <parmarsa...@gmail.com>: Apr 23 08:15PM +0530
https://youtu.be/lHQI9ydQlSU
Here is the Link for your Problem.
if you like the solutions please like share and subscribe errormania. in
your groups and join our telegram channel: @errormania
And share in your groups and with other developer friends
thank you
Amarjit Singh <asso...@gmail.com>: Apr 23 01:23AM -0700
Hi Friends,
Trying to send mail from Contact us form. While internet is disconnected it
show the contents correctly on development server console.(see attached
Development server console.png)
But once internet is connected, it shows an error (see attached email
sending error.png)
Using Python 3.7.7, Django 3.0, MySql Database connected through Xampp
server and SMTP settings of this email-id in settings.py
I am new to python/django, kindly help.
Kind Regards
Amarjit
Le Hai Pham <pha...@seagroup.com>: Apr 22 06:57PM -0700
Hi everyone,
I am having an issue with the queryset's __in lookup. The story is that we
need to filter within a very long list.
E.g.
users = User.objects.filter(id__in=long_list_uids).filter(**logic_conditions
).
Since the long_list_uids is really long (Around 20k items), it will be
ineffective to pass the list to the DB layer.
And there is no way to get the list directly from DB.
Put the logic aside, is there any way to improve this?
I am thinking about inheriting the QuerySet class to make to store multiple
smaller queryset, but still acts like a normal Queryset. Is this possible?
Thanks in advance,
Perceval Maturure <drper...@gmail.com>: Apr 23 03:41PM +0200
thanks Lunga
I will share once im done
--
*Perceval Maturure*
*083 303 9423*
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to django-users...@googlegroups.com.