Use django-allauth package.
On 26 Feb 2022, at 15:09, Ankit Chaurasia wrote:
Hey, I am new in Djnaog and I want to make Login and Register Page
with Email Verification.
Can anone share the code ?
and please gide me for the same.
--
You received this message because you are subscribed to th
On 27 Feb 2022, at 17:54, Steve Smith wrote:
...the documentation on Formsets is scarce in my opinion and to get
them to work is a lot of trial and error...
To massively simplify formsets try django-extra-views
-- Clive
--
You received this message because you are subscribed to the Googl
On 28 Feb 2022, at 16:24, Prashanth Patelc wrote:
Any example?
Just read the django-extra-views documentation. Essentially a formset
can be as simple to use as any of the built-in class-based views, eg:
from extra_views import InlineFormSetView
class EditContactAddresses(InlineF
On 12 Mar 2022, at 17:43, Heman Okumbo wrote:
How comes I'm not able to modify my templates after extending from
a base template.eg can't add extra contents,the template only
display contents of the inherited template.
Some code might help. It's not really clear to me what you are asking.
On 27 May 2022, at 22:37, Andrew Rea wrote:
OperationalError at /admin/login/
database or disk is full
Is this because my SQLite database is full from other projects? Or
possibly because I have too many virtual envs from those same other
projects? Or is it due to my personal computer's di
Try django-extra-views
https://github.com/AndrewIngram/django-extra-views
Hugely simplifies formsets
On 10 Nov 2022, at 11:14, Arnold Falanga wrote:
Hello can anyone help me to design a dynamic form with Django the
idea is to have two parts in this form. a link to add the lines
--
You rec
You can use django-allauth:
https://github.com/pennersr/django-allauth
On 10 Nov 2022, at 09:59, venkat Bukka wrote:
Hello all,
Could anyone please let me know how we can implement SSO in the
django...for authenticating multiple apps in a base application.
--
You received this message bec
Questions.objects.all().order_by('?')[:5]
ie get all the rows from the Questions table, in a random order, then
show me the first five.
https://docs.djangoproject.com/en/dev/topics/db/queries/#limiting-
querysets
-- Clive
On 16 Nov 2022, at 01:14, Lakshyaraj Dash wrote:
Hello everyone,
It's more or less the same problem, use a new field to insert your
new foreign keys (UUIDs), looking them up via your old foreign keys
to get the new UUID values. Or, as the other Jason suggests, if you
can, just use the UUIDs for external access.
-- Clive
On 22 Nov 2022, at 19:02, Rajesh
Try Django Relativity:
https://pypi.org/project/django-relativity/
-- Clive
On 21 Nov 2022, at 10:11, Marek Rouchal wrote:
Any suggestion how I can model such an integerfield, so that I can
do joins on it using the Django ORM queryset syntax?
--
You received this message because you are
If you print:
dir(form_instance)
You'll get the methods available to the form. From memory, amongst
these you will find "data" and "initial", I think that "data"
contains the information submitted in the form action. So, to show that:
print(form.data)
-- Clive
On 2 Jan 2023, at 00
On 17 Jan 2023, at 05:01, Prashanth Patelc wrote:
I written query it's taking more time like 38 seconds, how to to
fetch the lac of records within seconds any example in django using
orm or MySQL query ?
Are you saying that you have a raw SQL query, or you are using a
Django query?
My
data ,
On Tue, Jan 17, 2023, 12:40 PM Clive Bruton wrote:
On 17 Jan 2023, at 05:01, Prashanth Patelc wrote:
> I written query it's taking more time like 38 seconds, how to to
> fetch the lac of records within seconds any example in django using
> orm or MySQL query ?
Are you sa
On 17 Jan 2023, at 12:06, Ayanfeoluwa Koyinsola wrote:
You might now have to display all the data at once, see if you can
use paginisation to reduce the numbers of queries
I think this will only help if there are related lookups.
-- Clive
--
You received this message because you are subs
Here maps:
https://www.here.com
https://heremaps.github.io/
-- Clive
--
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.co
On 12 May 2020, at 22:41, Anubhav Madhav wrote:
Is there any way to display the forms with my HTML CSS files.
Use {% include %} (https://docs.djangoproject.com/en/3.0/ref/
templates/builtins/#include) in your HTML template files for an
embedded style sheet, or just use a link in the head
I am using django-allauth for a user registration/log-in system. I
have this working, however, as a general question, I would like to
understand how one can view the functions/variables available on a
given template.
For example I see that in some templates these are included:
{% user_disp
t' tags or
'submit' button, which are rendered using django forms, cannot be
modified using CSS in this way. Is there any other way to fix it?
On Wednesday, 13 May 2020 18:58:08 UTC+5:30, Clive Bruton wrote:
On 12 May 2020, at 22:41, Anubhav Madhav wrote:
> Is there any way
On 16 May 2020, at 15:03, sunday honesty wrote:
I did that and got a TemplateSyntaxError stating that bootstrap4 is
not a registered tag library
Did you put it in your installed_apps?
-- Clive
--
You received this message because you are subscribed to the Google Groups "Django
users" gr
On 16 May 2020, at 15:43, sunday honesty wrote:
I included it to installed app and got an error message on the
console. "Module not found, no module named bootstrap 4"
"bootstrap4"
-- Clive
--
You received this message because you are subscribed to the Google Groups "Django
users" group
There are django modules for hierarchical navigation
https://djangopackages.org/grids/g/navigation/
-- Clive
On 19 May 2020, at 23:20, saqlain abbas wrote:
Please tell me if anyone knows about this.
On Mon, May 18, 2020 at 4:50 PM saqlain abbas
wrote:
Hi, if i add Categories , for exam
I would like to add a date comparison filter to a lookup, to find
items in a database table that have not yet expired. I tried:
.filter(expires>=datetime.today()) \
But this does not appear to have any effect.
"expires" is a column in the table of datetime type, that looks like
this
You have to use the correct python install:
python3 -m pip install django
You can test your versions and locations:
which python3
which python
python3 -V
python -V
When you are running the development server:
python3 manage.py runserver
You ca
I am trying to create a queryset that filters against the logged-in
user's id and the user_id in the record, ie so that only the relevant
user can see the record.
Without the filter, when I display the page I can capture elements in
the template that would allow this comparison, ie:
objec
I am trying to update an existing date field, however when I do that
I get the following exception:
Exception Type: TypeError
Exception Value: expected string or bytes-like object
The query looks like this:
queryset = Item.edit.filter(**kwargs).update
(expires=set_expires,is_acti
Apparently the magic is:
queryset = Item.edit.filter(**kwargs).update(expires=set_expires
(),is_active=True)
-- Clive
On 14 Jun 2020, at 03:24, Clive Bruton wrote:
I am trying to update an existing date field, however when I do
that I get the following exception:
Exception Type
On 23 Jun 2020, at 23:32, Oleg Kishenkov wrote:
Hello Soumen, you should use a CharField with the primary_key=True
attribute for your model. This way no no automatic primary key
field is generated, your field will be implicitly unique and non-
null though. Only one primary key is allowed i
I have a form in which, after filing, I would like one field to be
locked for editing, the forms.py looks like this:
**
class ProfileForm(forms.ModelForm):
status = forms.ChoiceField(choices=Profile.status_choices,
widget=forms.RadioSelect)
class Meta:
model = P
On 24 Jun 2020, at 06:24, Soumen Khatua wrote:
Yes, at the time of add a new record in model, automatically I want
to create a custom ID and insert it into model
There is a post about this at Stack Overflow:
https://stackoverflow.com/questions/52070462/django-generate-custom-id
-- Clive
On 24 Jun 2020, at 23:03, Chetan Ganji wrote:
Try this one
https://docs.djangoproject.com/en/3.0/ref/forms/fields/#disabled
Ok, well that's a little help, because I can disable the input:
status = forms.ChoiceField(choices=Profile.status_choices,
widget=forms.RadioSelect(attrs={'disab
If you are testing the site with manage.py runserver, then you have
to make sure debug is on. And you have to ensure the app knows where
the static directories are.
-- Clive
On 28 Jun 2020, at 12:21, Suny wrote:
Do I need to add STATICFILES_DIRS in settings.py file
TREE STRUCTURE for ref
On 2 Jul 2020, at 00:06, Stats Student wrote:
Hi, I am using a Postgres database and have been populating the
primary key from a sequence. Is there any way to define this
behavior through Django's ORM? Thanks
I think you are basically asking how to create a custom key. This was
discusse
I am struggling with getting kwarg values into a queryset filter:
class UsersItemsView(ListView):
template_name = 'testapp/user_item_list.html'
def get_queryset(self, **kwargs):
print('kwargs-userlist')
print(kwargs)
#return Item.objects.filter(user__username='cli
Thank you.
On 6 Jul 2020, at 05:24, Stephen J. Butler wrote:
def get_queryset(self):
qs = super().get_queryset()
return qs.filter(user__id=self.kwargs['userlist'])
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To un
I am working into someone else's solution, with this code in forms.py:
***
class SearchForm(forms.Form):
area = forms.ModelChoiceField(label=_('Area'),
queryset=Area.objects.all(), required=False)
group = forms.ModelChoiceField(label=_('Group'),
queryset=Group.objects.all
On 7 Jul 2020, at 22:58, Kai Kobschätzki wrote:
I render one input field surname. And if the user writes one string in
the input field it should be saved to surname (so forename is
None). If
the user writes two strings (separated through a white space) than the
first part should be saved to
I am trying to make a simple form, that conditionally shows the
"website" input field based on the value of another database field
(that is not on the form) "status". For the sake of this process the
"status" field is not editable by the user, just by the admin. Both
fields are in the same
On 18 Oct 2020, at 12:53, Asaduzzaman Sohel wrote:
I am creating a django application. now I would like to create
logo, site name & info which will be dynamic. I want to create
Model for this , but problem is use create many logo, site name or
info. but Use can create or edit only one log
I have a function that uses the current date to set up a file path
for uploaded images:
def upload_path():
dtnow = datetime.now(timezone.utc)
dtstr = '{:%Y/%m/%d/%H/%M/%S}'.format(dtnow)
print('dtstr: ')
print(dtstr)
dtstr = 'images/
path(instance,
filename))```
But if I do that I get:
```NameError: name 'instance' is not defined```
Sorry for so many more questions!
-- Clive
On 28 Oct 2020, at 08:58, Carles Pina i Estany wrote:
Hi,
On Oct/27/2020, Clive Bruton wrote:
I have a function that uses t
On 30 Oct 2020, at 11:00, Carles Pina i Estany wrote:
Let me know if it's not clear or if I explained something that you
didn't ask!
Thanks you very much for spending the time on this, to explain it to
me - it was very helpful!
-- Clive
--
You received this message because you are subs
On 11 Nov 2020, at 23:37, George P. Olson wrote:
So when I go to this url: http://127.0.0.1:8000/polls/
Although the urlpatterns below shows "# ex: /polls/", the defined
path has no path elements, so you just need:
http://127.0.0.1:8000/
I think.
urlpatterns = [
# ex: /polls/
to be recognised.
-- Clive
On 12 Nov 2020, at 04:35, George Olson wrote:
I don't quite follow your note there of just going to:
http://127.0.0.1:8000/
without the app name 'polls' following.
I believe you have to put the app name following that. It was
working before with htt
I have a ManyToMany model set, that on the edit uses a formset to add/
edit rows. I have this working, but the unfortunate part of it is
that the select that results from the ManyToMany relationship
populates with 16,000 records.
What I would like to do is, once the records are added, just h
Find a project on github and suggest some easy fixes. I'm no django
expert, but I've had patches accepted on at least three projects.
The last one I contributed to was updating the code from django 1.x
to 3.x, so that it would run on more recent versions. This is quite
easy to do, since the
Sorry I can't reply in French. It simply means that a template is
expected in your project/app folder at:
[project/app]/templates/registration/logout.html
-- Clive
On 26 Nov 2023, at 11:55, fabrice ayissi awono wrote:
--
You received this message because you are subscribed to the Goo
I am taking it that there is more than one "school"? If so, surely
it's is just a many-to-many relationship.
On 27 Nov 2023, at 09:33, Okkert Joubert wrote:
Good morning all,
I made a custom user model for a school, it is currently working
with djoser authentication, now what I want to add
If you want to override what the form is showing, then you can build
your own template and only include the elements that you wish to show.
Rather than use:
{{ form }}
use:
{{ form.field_name }}
or break it down further, like:
{{ form.field_name.html_name }}
etc
C
48 matches
Mail list logo