Hello,
after a quick read I cannot find any essential differences between the two,
in regards of authentication. JWT, however, is much more fine grained and
has a bunch of token manipulation options.
Best,
Gergely
On 24 Jul 2015 03:01, "Ankit Agrawal" wrote:
>
>Hi everyone,
>
>
> I am b
Use a combination of order_by('-age') and first() on your query set.
MyModel.objects.order_by('-age').first()
https://docs.djangoproject.com/en/1.8/ref/models/querysets/#order-by
Obviously that only pulls the "first" object even if multiple objects have
that same age, so you may need additional
There are options, but here's what I'd do:
class Stop(models.Model):
name = models.TextField() #use CharField if not using Postgres
latitude = models.DecimalField()
longitude = models.DecimalField()
route = models.ForeignKey('Route')
sequence = models.IntegerField()
class Meta:
u
I have a `Route` model which should store an ordered list of stops along
that route. How should I go about modeling this relation?
class Stop(models.Model):
name = ..
latitude = ..
longitude = ..
class Route(models.Model):
stops_list = # Ordered list o
My Python code started working after I changed on line.
Changing:
files_dct = {filename:fobj}
to:
files_dct = {('photo',(filename, fobj,'image/jpg'))}
Now it works. My conjecture about the need for different HTTP-headers was
wrong. The working code has not changed the headers receive
Say I have a model
class MyModel(models.Model)
name = models.CharField(max_length=20)
age = models.IntergerField()
How can I find the maximum based on the 'Age' field number and retrieve
that whole object? I understand aggregates allows me to find and retrieve
the maximum number when gi
Hi everyone,
I am building a real world application where users will access the app
primarily from Android, iOS devices as well as Desktops.
>From my elementary research, I have realized that token based
authentication mechanism is more better and elegant for client-server
models as
I am developing a django application that primarily uses web browsers to
upload scientific data that includes some image files. Currently, the
application works fine when Firefox or Chrome are used. Both images and
other data are correctly uploaded.
Occasionally users need to upload larger am
On Wednesday, July 22, 2015 at 3:12:47 AM UTC+5:30, Robin Lery wrote:
>
> Yes. I would like to add easy-thumbnails too. Both are great!
>
I used easy-thumbnails. But it doesn't store the thumnails in my database.
I want three fields to get populated on loading the image : image,
thumbnail_larg
Hi Gergely,
On 07/23/2015 02:27 PM, Gergely Polonkai wrote:
> Yes, you are right, my attempt is not the solution to your problem; it
> seems that this m2m field really cannot be modified like this. With some
> slight modifications, though, it may be.
>
> 1) create the through table
> 2) migrate d
Hello,
I'm sorry, I was not around my mailbox lately.
Yes, you are right, my attempt is not the solution to your problem; it
seems that this m2m field really cannot be modified like this. With some
slight modifications, though, it may be.
1) create the through table
2) migrate data with RunPytho
On 07/23/2015 01:32 PM, Nkansah Rexford wrote:
> You can save the datetime of the last form submission and check
> whether its oneday or not in the view. If its one day then show pass
> the form or else dont.
>
> Hope this helps.
>
>
> I do know I have to save the date stamp, but
>
> You can save the datetime of the last form submission and check whether
> its oneday or not in the view. If its one day then show pass the form or
> else dont.
>
> Hope this helps.
>
I do know I have to save the date stamp, but the question is Where? On the
model class, the user class, or
Hi Carsten,
On 07/23/2015 11:41 AM, Carsten Fuchs wrote:
> Am 23.07.2015 um 18:49 schrieb Tim Graham:
>> The admin login only allows staff users to login so it makes sense to
>> me that if you
>> wanted to add regular user login to your site, it should have separate
>> URLs.
>
> I think what conf
I have a model - Registrations. 97% of the time a user wants to see
'todays' registrations when viewing this model in admin. Is there a way to
set the initial display of records, but allow full access thereafter?
The example in admin.get_queryset assumes I want to manage each query. In
my case, I
Thank you for your response! I am trying to follow AJAX tutorials, and I
keep running into an issue with the URLConfs. My current admin and index
page use something like this:
urlpatterns = [
url(r''^admin/', include(admin.site.urls)),
]
But the when implementing AJAX, everything has said
Hi Tim,
many thanks for your reply!
Am 23.07.2015 um 18:49 schrieb Tim Graham:
The admin login only allows staff users to login so it makes sense to me that
if you
wanted to add regular user login to your site, it should have separate URLs.
I think what confuses me is the fact that (in the A
On 07/23/2015 10:49 AM, Tim Graham wrote:
> The admin login only allows staff users to login so it makes sense to me
> that if you wanted to add regular user login to your site, it should
> have separate URLs.
>
> As for the template issue, it seems to me the
> admin/template/registration template
Hi Carl,
Am 23.07.2015 um 18:28 schrieb Carl Meyer:
Overall I think it might be simpler to go with your initial approach. I'd first
rename
the old field to some other temporary name (you don't have to update any other
code to
use this name, as you'll commit all of these migrations in one commi
The admin login only allows staff users to login so it makes sense to me
that if you wanted to add regular user login to your site, it should have
separate URLs.
As for the template issue, it seems to me the admin/template/registration
templates should be more like admin/login.html and namespac
Hi Carsten,
On Thursday, July 16, 2015 at 12:44:55 PM UTC-6, Carsten Fuchs wrote:
>
> Am 2015-07-16 um 18:15 schrieb Gergely Polonkai:
> > 1) create the "through" model, add it to the migration file
> > 2) migrate all m2m instances (e.g. iterate over all Bereich objects then
> > iterate through
Am 16.07.2015 um 16:05 schrieb Carsten Fuchs:
Alas... are there any viable alternatives to this?
I'd be very grateful for any hint! :-)
Anyone please?
Best regards,
Carsten
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe fr
You can check how django rest framework solves it:
http://www.django-rest-framework.org/api-guide/throttling/
--
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 dja
You can save the datetime of the last form submission and check whether its
oneday or not in the view. If its one day then show pass the form or else
dont.
Hope this helps.
On 23 Jul 2015 20:38, "Nkansah Rexford" wrote:
> I want to allow users to submit a django form once, and only once
> everyd
I want to allow users to submit a django form once, and only once everyday.
After submitting the form, the form wouldn't even show (server-side
checkings, I don't want to use JS or client side thing; easily
'tamper-able')
What is the best way to do so in Django?
--
You received this message b
Dear Django fellows,
using Django 1.8.3, I see that the Admin contrib uses the Auth contrib's views (in
contrib/admin/sites.py). The implementation overrides the auth views' defaults only if
explicitly specified in the AdminSite object.
For example, changing the user password is implemented i
I know this is an old thread, but I bumped on it while cleaning my inbox.
In any case if it still relevant I recommend looking at treee.io, the
website is down but you can take a look at the code at github (
https://github.com/treeio/treeio)
On Sat, Jun 6, 2015 at 6:55 PM, Luis Zárate wrote:
>
I can access to django-console app with:
127.0.0.1:8000/admin/console.
How to link this with href = "url " in template
--
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
I refer to a new project (in all the possible meanings). When I use
*startapp* to create an app, I want to only git (as you would do for any
other thing) that app, nothing more:
django-admin startproject myproject
cd myproject
python3 manage.py startapp myapp
cd myapp
git init
It's very simple:
My model have a field called 'city', it's a foreign key to City model.
The user have the option to select a city in a dropdown menu (Select
widget), or click in a button and write the name of a new (not present in
the database) city.
Using a ModelForm, I added an extra field called 'new_city' t
30 matches
Mail list logo