Just as a case study, Shibboleth does this by having unscoped and
scoped usernames. The scoped username should be globally unique and
takes the form of "u...@school1.edu". Unscopped is not globally
unique, but unique for a particular scope (ie: "user").
It's temping to say "ahh... email address!"
Shibboleth 2.0 lets you setup a discovery service (or portal would
perhaps be a better term) letting the user select which ID Provider
(IdP) they will authenticate to. All you have to do on the Service
Provider (SP) side is specify the discovery URL and what IdPs you
allow. Nothing needs to be done
Could it be a character set issue? That is, perhaps the database
NLS_CHARACTERSET is not unicode friendly, your column is VARCHAR
instead of NVARCHAR2, and Django is sending unicode instead of the
native database charset (which cx_Oracle directly might use).
I'm just brainstorming on what might ca
2000 is AL16UTF16. But since there should be a non-lossy conversion
between AL32UTF8 and AL16UTF16 you'd think that Oracle would perform
it and use the index. Puzzling.
Furthermore, when you look in the Oracle db driver you can see in
base.py where it sets NLS_LANG to ".UTF8". This is an old setti
Have you checked the rendered HTML in the browser? Is the CSRF element
present? Is there any JavaScript that could be doing pre-processing on
the form? Did you open up the browser's inspector and verify that the
POST request actually included the CSRF key/value? Is it the correct
value?
On Sat, Ja
The benefit to doing stuff like this in the database is that the
database can do it smarter than you can in Python. Is that true in
this case? I think not. If we were talking raw MySQL I'd suggest
running your Website column through something like REPLACE(Website,
'://www.', '') and then the count
Do you have a default ordering on the Model object? That is, an
ordering option on newleave.Meta? Because otherwise this query
"newleave.objects.all()" is not at all guaranteed to return rows in
the order they were added.
It may, by coincidence, in your current environment behave that way.
But cha
Not all your lines have the same indent level in your profile method. Line 52.
On Tue, Jan 27, 2015 at 1:03 AM, Mosharof sabu wrote:
> my view
>
>
> def index(request):
> category_list = Status.objects.filter(comment__startswith="d")
> context_dict = {'categories': category_list}
> re
Use django.utils urlencode.
return HttpResponseRedirect(base_url + '?' + urlencode(params))
Note that a redirect is always turned into a GET request, never a
POST. If you really need POST you'll have to construct a page with the
proper form elements, and then either have the user submit it (no-js
You still could store the do_something_after_badge_awarded result in a
database table, but cache the lookups from the view for something
short, like 5 minutes. How quickly after a badge is awarded do people
need to be notified?
Also, you could use a memcached library to store/fetch the awards by
u
Sure, it's possible. But this is a really hard problem. One way is to
let the database do all the heavy lifting. But you'll have to forget
about using simple databases like SQLite or MySQL. Oracle's advanced
replication documentation talks about exactly this type of situation
w/r/t materialized vie
site map requires the sites app. Make sure:
1. 'django.contrib.sites' is in INSTALLED_APPS
2. Your site has the proper domain (look in /admin/ and fix it if needed)
3. In your settings.py make sure SITE_ID matches the site you
configured in /admin/
On Sun, Feb 1, 2015 at 12:08 PM, José Luis
wrot
It says right in the docs what to do:
https://docs.djangoproject.com/en/1.7/howto/static-files/
On Thu, Mar 19, 2015 at 7:57 PM, Fellipe Henrique wrote:
> Hi,
>
> In my template, when I made a reference to my Static folder.. what's the
> correct usage?
>
> {{STATIC_URL }} or {% static "" %}
Some questions you need to answer then:
1. Does the URL to the static resource appear properly in your rendered HTML?
2. Did you configure your web server properly so that the STATIC_ROOT
appears at the right location?
3. After running collectstatic does the STATIC_ROOT directory have the
expected
They do work. But did you check the generated page? I bet you get an
error in your browser's JavaScript console about syntax.
On Fri, Mar 20, 2015 at 4:59 PM, dk wrote:
> I am trying to create an autocomplete tag with jquery UI
> http://jqueryui.com/autocomplete/
>
>
>
> in my view I got a list o
On Wed, Mar 25, 2015 at 2:27 PM, Sven Mäurer wrote:
> backend.conf
>
> Listen 8787
>
> WSGIScriptAlias / /var/www/html/backend/API/wsgi.py
> WSGIPythonPath
> /var/www/html/backend:/var/www/html/backend/venv/lib/python2.7/site-packages
> WSGIPassAuthorization On
WSGIScriptAlias belongs in your Vir
On Fri, Mar 27, 2015 at 10:30 AM, Thomas Güttler wrote:
> You have an instance method to render one row of a search result (a custom
> paginator).
>
> One column of this row displays a link. Some users are allowed to follow the
> link,
> some are not. You need to check the (row level) permissions
On Fri, Mar 27, 2015 at 2:50 PM, Carl Meyer wrote:
> Hi Gabriel,
>
> On 03/27/2015 01:34 PM, Gabriel Pugliese wrote:
>> @Masklinn
>> That input is from jQuery's default serializer. It sends the data with
>> contentType 'application/x-www-form-urlencoded; charset=UTF-8'. I just
>> need to pass a da
For those interested, here's some code that does this in Django as
request.PARAMS:
https://github.com/sbutler/django-nestedparams
It is extremely alpha. I wouldn't use it in your code. I did it as a
proof of concept, but if other want to hack on it I'd be happy to
accept pull requests.
On Thu, M
This error doesn't appear in the Django sources for 1.6 or 1.7. I
don't think the error is being generated by Django, so ALLOWED_HOSTS
isn't the culprit. Plus, another clue is that "*.doba.com" isn't an
actual value in your ALLOWED_HOSTS.
If you search it appears related to Python SSL. Do you have
On Wed, Apr 1, 2015 at 3:43 AM, Thomas Güttler wrote:
> Headache makes the code which gets called outside the request-response
> cycle.
> For example cron jobs.
>
> Example: We create reports for users in cron jobs. Here we need a user
> object
> and have no context.
You still have a Context obje
BCC recipients don't get included in the message headers. If they were
stuffed there, then they wouldn't be "bilnd", they would appear in
every copy of the message! The code that includes them is here:
https://github.com/django/django/blob/stable/1.6.x/django/core/mail/message.py#L263
You say it
The avatar app is unmigrated and has a reference to the auth.User
model. References from umigrated apps to migrated apps (which now is
all of Django core and contrib) isn't supported:
https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies
"""Even if things appear to work with unmig
I'm looking at moving one of my projects from coffin to django-jinja
because that project has already hooked into the new 1.8 multiple
template engine support. But reading through the docs I came across
this:
"""
django-jinja does not works properly with django’s TemplateResponse
class, widely use
What happens if you disable all caching (try setting it to the dummy cache).
Also, you really shouldn't put your python code in your server's
DocumentRoot. There's absolutely no reason to do it that way. You're just
asking to have your settings.py file exposed by a misconfigured apache
instance.
How doesn't it work?
1. Does the uploaded file appear where you expect it to?
2. If you construct the URL properly in your browser, can you access
it directly?
3. What is the URL being output in your templates?
On Tue, Apr 14, 2015 at 9:44 AM, dk wrote:
> maybe I need to simplify my question.
>
https://docs.djangoproject.com/en/1.8/topics/cache/#dummy-caching-for-development
On Wed, Apr 15, 2015 at 8:47 AM, Joe wrote:
> How do you set it to the dummy cache?
>
> On Saturday, April 11, 2015 at 2:06:10 PM UTC-7, Stephen Butler wrote:
>>
>> What happens if you disable all caching (try sett
Classes (MyModel) are attributes of the module (myapp.models). No
reason to use eval. You can get the module from importlib and then the
class from using getattr() on the module.
http://stackoverflow.com/questions/10773348/get-python-class-object-from-string
On Wed, Apr 15, 2015 at 11:45 AM, He
Or, if you know all the Model classes are in the same module that
you've imported, it should be as easy as:
from myapp import models
model_class = getattr(models, tableName)
On Wed, Apr 15, 2015 at 11:50 AM, Stephen J. Butler
wrote:
> Classes (MyModel) are attributes of th
I'm not familiar with uWSGI. On gunicorn you send it SIGHUP (kill -HUP
pid) and it will reload w/o interrupting requests. Looks like uWSGI
supports something similar:
https://uwsgi-docs.readthedocs.org/en/latest/Management.html#signals-for-controlling-uwsgi
On Thu, Apr 16, 2015 at 11:32 AM, Shapa
On Fri, Apr 17, 2015 at 8:16 AM, Jyothi Naidu wrote:
>
> if 'audit_info_manage' in request.POST:
> 192 #fullname = Employee.objects.get(emp_id=request.POST['emp_id'])
> 193 audit_manage_key = request.POST.get('audit_info_getdata')
> 194 if audit_manage_key:
> 195
I wasn't suggesting that disabling caching was the fix, but just a way to
start debugging the issue. Did it go away when you completely disabled the
cache? Next step is to enable the cache again and progressively remove
caching statements from your app till you find the culprit. For example:
1. Re
On Mon, Apr 20, 2015 at 9:45 PM, Vijay Khemlani wrote:
> Overwrite the constructor of the form (__init__), pass the user or whatever
> parameters you may need and overwrite the choices of the field in the body
> of the method.
This is the same strategy I've used to filter ForeignKey fields on the
\w won't match emails addresses. It doesn't include the "." or "@" characters.
On Tue, Apr 21, 2015 at 3:41 PM, HIMANSHU RANJAN
wrote:
> Thanks for replying Bill :D
> Ooops !!
> i removed the question mark but it is till not working !!
> The problem is that i dont have a form and i think form m
>
> I don't know what's the pblm
> Plzz help !!
>
> On Apr 22, 2015 2:16 AM, "Stephen J. Butler"
> wrote:
>>
>> \w won't match emails addresses. It doesn't include the "." or "@"
>> characters.
>>
>>
You need to set Form.required_css_class
https://docs.djangoproject.com/en/1.8/ref/forms/api/#styling-required-or-erroneous-form-rows
On Fri, Apr 24, 2015 at 2:30 PM, victor menezes
wrote:
> Hi all,
>
> I'm using Django 1.8 and having trouble to because my form does not generate
> fields with req
Your HTTP Request is malformed. You have 2 spaces between the URI and
the HTTP version (rfc says only 1). Also, after your Content-Length
header you have an extra \r\n which will terminate the set of headers
and put the rest in the body.
On Fri, Apr 24, 2015 at 11:50 AM, Anand Singh wrote:
> I ne
Yes, I've done this with a schema from a vendor app I wanted to read.
Define additional database aliases, one per schema, and then when
running inspectdb use the "--database" parameter with the alias name.
On Wed, May 6, 2015 at 2:42 AM, Shekar Tippur wrote:
>
>
> Hello,
>
> Is there a way to ru
If you're using FormMixin then you can also override get_form_kwargs:
def get_form_kwargs(self):
kwargs = super(MyForm, self).get_form_kwargs()
kwargs['creator'] = self.request.user.pk
return kwargs
Then let FormMixin instantiate the form instance itself.
On Wed, May 13, 2015 at 10:1
See where it says "Django tried loading these templates, in this
order"? Move your index.html template to the appropriate place.
On Wed, May 13, 2015 at 11:12 AM, Rashmi Ranjan Kar wrote:
> Hi
>
> Please go through the attachment. It contains settings.py, urls.py and
> localhost:8080 page. kindly
Model.delete doesn't take any arguments other than "using". If you
want to pass more context, you'll have to override Model.delete in
your project, create your own signal, and then pass the extra
arguments to it. Same with QuerySet.delete if you want to override
mass deletion also.
Or, even though
The developer of coffin released v2.0 which is pretty much a simple stub.
He recommends you switch to django-jinja.
You probably want to limit your requirements.txt to coffin<2.0.
On Thu, May 14, 2015 at 1:28 AM, wrote:
> Hi, first of all i'm sorry for my bad english.
>
>
> I am installing a dj
If it's just key-value storage, adding a memcached layer sounds like a
good thing to investigate. Do the tuples frequently change?
On Thu, May 14, 2015 at 11:30 PM, Me Sulphur wrote:
> Hi Russ,
>
> Thanks! While there are some pointers that we can pick up from your answer,
> let me add some more
I think you instead want to use self.modify_settings() or
self.override_settings() to change EMAIL_BACKEND to locmem:
https://docs.djangoproject.com/en/1.8/topics/email/#in-memory-backend
Then you can inspect django.core.mail.outbox to verify recipients, message, etc.
On Tue, May 19, 2015 at 7:0
I think that looks fine. I would change the mimetype to "text/plain;
charset=UTF-16LE" just to play nice, but it probably will never matter
with your Content-Disposition. Also, HttpResponse's mimetype parameter
has been deprecated since 1.5; use content_type instead.
On Thu, May 21, 2015 at 3:04 P
I don't know if this is the problem, but...
On Fri, Jun 5, 2015 at 4:44 PM, Tim Sawyer wrote:
> class Venue(models.Model):
> """
> A venue for a contest
> """
> last_modified =
> models.DateTimeField(default=datetime.now,editable=False)
> created = models.DateTimeField(default
One of your other apps needs django.contrib.sites, so you need to put it in
your INSTALLED_APPS. That's what this means here:
Model class django.contrib.sites.models.Site doesn't declare an explicit
app_label and either *isn't in an application in INSTALLED_APPS* or else
was imported before its ap
Who sends the data_required signal? It would have to handle the return
value of "send" to look for HttpResponse subclasses.
On Wed, Jun 24, 2015 at 3:42 PM, Henry Versemann
wrote:
> Here's an abbreviated look at some code I have:
>
> @receiver(data_required)
> def StartProcessView(sender, **kwar
@transaction.atomic will only look at the default database. Since you're
using multiple ones I think you want something like:
@transaction.atomic(using=DB1)
@transaction.atomic(using=DB2)
def process_all():
#
On Fri, Jun 26, 2015 at 10:27 AM, Lene Preuss wrote:
> Hi,
>
> I want to writ
Are you saying that the entire project is already a git repo, but you want
to have a seperate repo for just one of the apps? In that case, you should
do a git submodule:
http://git-scm.com/docs/git-submodule
On Wed, Jul 22, 2015 at 9:51 AM, wrote:
> Hello, I'm trying to start a git repo that o
Your Django settings 'NAME' is neither a SID nor a service name. Try:
'NAME': 'testdb',
'USERNAME': 'C##TDBUSER',
'PASSWORD': 'testdb',
'HOST': 'localhost',
'PORT': 1521
On Fri, Jan 19, 2018 at 11:37 PM, Rishab Kumar wrote:
> https://stackoverflow.com/questions/48352888/connect-django-with-ora
@login_required doesn't take a test function. You need to use
@user_passes_test directly.
On Mon, Apr 30, 2018 at 12:26 AM, Mike Dewhirst
wrote:
> I'm pretty sure this is a not-understanding-python problem rather than a
> Django problem but here goes ...
>
> In a (FBV) view I'm trying to pass a
Apr 30, 2018 at 1:24 AM, Mike Dewhirst
wrote:
> On 30/04/2018 3:35 PM, Stephen J. Butler wrote:
>
>> @login_required doesn't take a test function. You need to use
>> @user_passes_test directly.
>>
>
> Thank you Stephen.
>
> I thought I'd start another t
Look a little closer at the error message:
Error:
>
> insert or update on table "myapp_log" violates foreign key constraint
> "myapp_log_account_id_6ea8d7a6_fk_myapp_account_id"
> DETAIL: Key (account_id)=(11) is not present in table "myapp_account".
>
> It's happening this error rather than the
Sorry, I did miss that.
I created a quick test project in 1.9 and ran your sample. It works fine
for me. The delete() returns that it deleted 4 objects: the Account, Car,
Log, and CarLog. There's something else in your project that is causing the
error.
On Sat, Apr 23, 2016 at 3:42 PM, Neto wrot
URLs have different parts or components. The different parts use different
escaping rules.
foo.com/?next=/some/folder
foo.com: uses DNS escaping rules
/: uses path escaping rules, which allows / as a path separator
next=%2Fsome%2Ffolder: uses query parameter escaping rules, which does not
allow
You mean on the standard login form? The hidden "next" form value? That
value isn't part of a URL so it isn't URL escaped. It's part of the HTML
attribute value, so it is HTML attribute escaped.
On Sat, Apr 23, 2016 at 6:19 PM, Chris Seberino wrote:
> But I still don't see why sometimes the slas
Ahh, Postgres is the problem. When your exception is thrown then Postgres
aborts the rest of the transaction. That's how its transaction handling
works. Even though you ignore the exception in the myapp code, it will
still cause the transaction to abort when Django tries to call commit().
When I wa
Look in your settings.py file for the TEMPLATES line. Do you have a
'timeout' under OPTIONS? Remove that.
On Mon, Apr 25, 2016 at 8:34 AM, Khaled Al-Ansari
wrote:
> Hello, I'm having a problem with djangorest
>
> when i runserver everything looks fine but when I open the browser I get
> this
>
>
Damn. It did work once, but now I can't reproduce it. But turning on SQL
logging it's clear that what's happening isn't what I said it was.
I get a sequence essentially like this at acct.delete():
-- Django selecting all the things it needs to cascade/update b/c of m2m
SELECT * FROM "myapp_car"
You assign to context every loop iteration. So at the end, only the last
add_product_form constructed is ever used. Try this:
def show_cart(request):
cart_id = _cart_id(request)
cart_items = CartItem.objects.filter(cart_id=cart_id)
add_product_forms = {}
for item in cart_items:
rds, "add_product_forms.quantity" and
> "add_product_forms.update"? Im missing something. . .
>
> On Sun, May 15, 2016 at 1:00 AM, Stephen J. Butler <
> stephen.but...@gmail.com> wrote:
>
>> You assign to context every loop iteration. So at the end, o
I believe that's as designed. There's this part in the documentation of
"Database transactions":
Callbacks are not run until autocommit is restored on the connection
following the commit (because otherwise any queries done in a callback
would open an implicit transaction, preventing the connection
I'm only experienced with the Oracle backend, but I believe only Postgres
stores datetimes with timezone information. Otherwise, Django assumes all
datetimes in the database are UTC. For the most portability you should
assume that database values will be in UTC.
The user's local timezone is someth
I think I'd just use format() on the regex, being careful to escape '{' and
'}':
regex_f=r'^.*(?=.*{{{MIN},{MAX}}}*)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^
&*?@#-_+=])'
regex=regex_f.format(MIN=settings.MY_RE_MIN, MAX=settings.MY_RE_MAX)
On Thu, May 19, 2016 at 12:37 AM, Arun S wrote:
> Hi,
>
You can't provide multiple regex's to the RegexField. What you were doing
before is exactly equivalent to this:
r'^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=]).*$'
So for my suggestion, just do this:
regex_f=r'^.*(?=.{{{MIN},{MAX}}})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#
What's your actual output vs. what's your desired output?
Also, the RequestContext is meant for the render() function. If you just
want to access request.GET then you can do it directly (request is passed
in as the first parameter to your view func). You also don't need to
pre-assign qList and cd,
I don't see anything in your pasted code that would cause that in the
browser. Have you provided us a complete example that exhibits that
behavior? Reduce your project down to the smallest set of code that
exhibits the problem and then upload it somewhere we can see it.
On Mon, May 30, 2016 at 8:1
Ohhh... you're looking at the server logs? Those are never going to be
sequential. Your requests operate in parallel. That's why you see
interleaved outputs. Modify your print statement like this to see what's
happening:
print " {1}".format(id(request), func)
You should see the proper results, bu
The code and output you've shown us don't make any sense. You're really
going to have to provide a complete, minimal project.
On Tue, May 31, 2016 at 9:40 AM, cr katz wrote:
> Thanks Stephen. As suggested, below is the output. 'p' is being
> overwritten before the first response is completely re
>From the template language reference:
<
https://docs.djangoproject.com/en/1.9/ref/templates/language/#accessing-method-calls
>
"""
Because Django intentionally limits the amount of logic processing
available in the template language, it is not possible to pass arguments to
method calls accessed
Add date2016 to your context:
{ 'test': test, 'date2016': date2016 }
Then it's just {{ date2016 }} in your template.
On Thu, Jun 2, 2016 at 6:36 AM, Franck wrote:
> Hello Stephen,
> Thanks for your help, ok I think it's better to used views for what I need
> to do.
> Last question, how I can d
Did you use the login_required decorator on your view? Authentication is
something you have to specify you want for a page, it is not assumed.
https://docs.djangoproject.com/en/1.9/topics/auth/default/#the-login-required-decorator
On Thu, Jun 2, 2016 at 3:54 AM, prabhat jha
wrote:
> i have cre
Another option is to do all the authentication in Apache and use the Django
RemoteUser backend. This would require writing an Apache authnz module to
talk to the c++ server, and adjusting your Apache configs to require
valid-user. Or, if not Apache, whatever server you are using.
Nothing about aut
Have you tried this?
https://docs.djangoproject.com/en/1.9/ref/unicode/#files
You probably have a system setup where ASCII is the filesystem encoding. It
tells you a way to fix that on Linux/Unix.
On Wed, Jun 8, 2016 at 2:44 AM, Luis Zárate wrote:
> Hi,
>
> I am having this issue in server pro
Whats the stack trace?
On Wed, Jun 8, 2016 at 3:01 AM, Luis Zárate wrote:
> $ python manage.py shell
>
> >>> import sys
> >>> sys.getfilesystemencoding()
> 'utf-8'
>
>
>
> 2016-06-08 1:57 GMT-06:00 Stephen J. Butler :
>
>> Have
Specifically, this style is called an Immediately Invoked Function
Expression, or IIFE.
https://en.wikipedia.org/wiki/Immediately-invoked_function_expression
On Fri, Jun 10, 2016 at 3:36 AM, ludovic coues wrote:
> > (function($) {
> > 'use strict';
> >
> > })(django.jQuery);
>
> Th
Assuming "obj" is an instance of a Model class for this table:
obj.jointime.date()
On Tue, Jun 14, 2016 at 8:52 AM, Galil wrote:
> Hi,
>
> How can I convert this SQL query into a Django query?
>
> SELECT DATE(JoinTime) FROM table
>
> Please keep in mind that JoinTime is in datetime format and I
Your json_obj is just a collection of python data structures (dictionaries,
arrays, strings, ints, etc)... it isn't JSON. You need to serialize it to a
string first using DjangoJSONEncoder.
https://docs.djangoproject.com/en/1.9/topics/serialization/
On Mon, Jun 27, 2016 at 12:41 PM, wrote:
> Gr
"::1" is the IPv6 loopback address. If you haven't seen IPv6 addresses
before, they separate the parts of an address with ":" instead of ".".
Using two together ("::") is a shorthand for "fill all these bits with
zero" and it can appear only once in an address.
You see the brackets "[]" in URLs be
You want to override get_inline_instances:
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_inline_instances
On Wed, May 3, 2017 at 12:33 AM, Mike Dewhirst
wrote:
> I want to adjust inlines based on a property of the object.
>
> class SubstanceAdmin(a
CPython uses a global interpreter lock, which means that only one thread
per process can ever be running Python code. Where threading really helps
is if your python project is mostly I/O bound (waiting on database work,
network connections, etc). If it's CPU bound then you probably won't see
much c
I think so. Haven't tested, one way should be be to have have two url.py's,
one that includes only the admin URLs and one that includes only your
project URLs. Then have two settings modules that look like this:
# main site settings
from .settings import *
ROOT_URLCONF = 'myproject.urls_main'
#
Did you recreate the virtualenv on the server, or did you copy it from your
development machine? You should recreate virtualenv's when deploying to a
different server.
On Thu, Mar 26, 2020 at 8:53 AM Fateh Budwal wrote:
> Yes python 3.8.2 is installed
>
> On Wednesday, March 25, 2020 at 8:30:35
Instead of using the model class, or string name of the model class, use
the string value 'self'.
https://docs.djangoproject.com/en/3.0/ref/models/fields/#foreignkey
On Sun, Mar 29, 2020 at 9:44 PM Mohsen Pahlevanzadeh <
m.pahlevanza...@gmail.com> wrote:
> I have table A with my following fields
This isn't a jQuery issue, it's a JavaScript/ECMAScript issue. When you use
the "arrow function" style like "() => { ...code... }" then certain
variables are not bound into the function contact, including "this".
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_func
get_queryset() isn't documented as taking any args at all, let alone the
kwargs of the request. You sometimes see people do "def get_queryset(self,
**kwargs)" to future-proof themselves in case get_queryset does, one day,
accept args. But it doesn't right now.
To get the kwargs for the request loo
If you look at the documentation for 'blank' it says:
"""
Note that this is different than null. null is purely database-related,
whereas blank is validation-related. If a field has blank=True, *form
validation* will allow entry of an empty value. If a field has blank=False,
the field will be requ
Why not use a BigIntegerField?
On Sat, Aug 1, 2015 at 12:06 AM, jordi collell wrote:
> Hi all!
>
> I have to store spreadsheet info on a db. Some kind of quotes where the
> user can store distinct prices for every zone.
>
> After modeling the data, i have a Cell like row. (related to a zone, and
These are all in the same project, right? In your app2 just do:
from app1.models import MyUserModel
Or maybe factor out the logic of app1/resources/user to a function and do
from app2:
from app1.utils import get_user_logic
There's no special communication between Django apps required. All the c
Lots of ways to do it. Maybe most efficient is:
UserProfile.objects.filter(user__in=u_dst).update(url=up_src.url,
home_address=up_src.home_address, phone_number=up_src.phone_number)
Where u_dst is a list/tuple/iterable of destination users, and up_src is
the UserProfile of the source user.
On Th
That's not going to work because all of this stuff...
On Sun, Nov 8, 2015 at 9:40 PM, tolerious feng
wrote:
> TODAY_STRING = datetime.datetime.now().strftime("%F")
> TODAY_LOG_DIR = os.path.dirname(__file__) + "/log/" + TODAY_STRING
> # TODAY_LOG_DIR = "/log/" + TODAY_STRING
> print "***"
>
What happens if you don't pass POST['f'] through unquote first? I don't
believe that should be necessary.
return QueryDict(request.POST["f"])
On Thu, Mar 24, 2016 at 2:57 PM, Paul Bormans wrote:
> I have been puzzled for some time now on a UnicodeEncodeError exception
> that i get when unicod
from __future__ import unicode_literals
On Thu, Apr 14, 2016 at 5:26 PM, Fred Stluka wrote:
> Django users,
>
> In my Django app, I want to allow users to enter Unicode
> strings. But if they do, I get UnicodeEncodeError when I call
> format() to embed their string into other strings. Is ther
GitHub has an excellent set of gitignore files. My first commit to a
project is always one of these:
https://github.com/github/gitignore
In particular:
https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
On Sat, Sep 1, 2018 at 10:52 AM Kasper Laudrup
wrote:
> Hi Sandy,
@login_required needs "request" as the first parameter.
On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew wrote:
> I have a custom function to check if a user is authorized to do
> certain functions:
>
> @login_required
> def checkpermission(request, permiss):
> username = request.user.username
>
Looking at that code for RangedFileResponse, I'm kind of skeptical that it
properly implements the Range header. Try removing that bit and see if it
works.
Have you tried the download with various browsers? I wonder if Safari or
Chrome released at the same time as the M1 chips is causing different
Unlikely. The local connection is in a high port range and the remote
connection's port is 443, which indicates your machine made an outbound
HTTPS connection to that IP. Does your code make any HTTP requests? Does it
use anything like OpenID Connect for auth? Do you have SSL certs it is
checking t
I don't think that's what the he asked for. It will return users who are
members of either test1 OR test2, but I read the question as returning
users who are members of both test1 AND test2. I think the proper query
would be:
User.objects.filter(groups__name='test1').filter(groups__name='test2')
On Sun, Jan 5, 2020 at 3:13 PM Mohamed A wrote:
> Be careful your secret key contains a #
>
> Which comment everything after
>
>
Not when it's quoted as part of a string. It should be fine in this case.
--
You received this message because you are subscribed to the Google Groups
"Django users"
1 - 100 of 106 matches
Mail list logo