Re: DSasS(Data Science as Service)

2017-06-16 Thread Melvyn Sopacua
o use and do things. > > I am bit confused and not sure where I should start to do things? You do things in models. You gather things in views. You render things in templates. You make things available through urls. Pretty much. -- Melvyn Sopacua -- You received this message because you are

Re: Custom field implementing Boolean Field is having response value as None instead of False

2017-06-16 Thread Melvyn Sopacua
27;1', '\x01'): return True > > if value in ('f', 'False', 'false', '0', '\x00', None): return > False and if value is something else, nothing (aka None) is returned. You have no else clause here. -- Melvyn Sopacua

Re: DSasS(Data Science as Service)

2017-06-17 Thread Melvyn Sopacua
rough all the steps I mentioned and in addition introduces the admin, forms (connecting user input with models, views and templates) and unit tests. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/1.11/intro/tutorial01/ -- You received this message because you are subscrib

Re: DSasS(Data Science as Service)

2017-06-17 Thread Melvyn Sopacua
On Saturday 17 June 2017 13:11:17 A.S. Khangura wrote: > On Fri, Jun 16, 2017 at 8:39 PM, Melvyn Sopacua wrote: > > You do things in models. > > So that means all my ML models would be Django-Models? Yes. Models should be a representation of the data and their interaction.

Re: Custom field implementing Boolean Field is having response value as None instead of False

2017-06-19 Thread Melvyn Sopacua
ne of the libraries in between Django and the database changed it's output format. Both of which will require attention. This is one advantage of from_db_value and to_python separation. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Dja

Re: Django app to manage PHP-composer repositories

2017-06-20 Thread Melvyn Sopacua
that does this? Not that I'm aware of. -- Melvyn Sopacua -- 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...@googlegrou

Re: Fwd: [django] Excluir un ítem de un dropdown en el admin de django

2017-06-20 Thread Melvyn Sopacua
ur models, cause it's likely your setup is wrong. -- Melvyn Sopacua -- 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...@goo

Re: import different entries using filter

2017-06-20 Thread Melvyn Sopacua
; > but i cant get it to work correctly. i get 'burger-place' for the > name, prod, and service variables for some reason. You are confusing attributes and models ("fields vs tables"). Please revisit the Django tutorial. -- Melvyn Sopacua -- You received this mess

Re: url patterns question

2017-06-20 Thread Melvyn Sopacua
> The .* modifier means "match any character (.) zero or more times > (*)". Since blank/ matches the .* zero times, it is a match for your > expression. And his problem is that it does *not* match. Not that it does. -- Melvyn Sopacua -- You received this message because you a

Re: url patterns question

2017-06-21 Thread Melvyn Sopacua
urlpatterns (first match wins, no others are tried) or with the view itself (get_object_or_404). You are correct that urlpatterns are only matched against request.path. This excludes the query string. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google

Re: Non-primary auto-incrementing field with Postgres

2017-06-21 Thread Melvyn Sopacua
- Their values are smaller then your new cut-off (10) Then you can simply transform the field explicitly to primary key and then to BigAutoField. Setting the next value can be done using RunSQL[1]. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/1.11/ref/migration-operations/

Re: Model with mix of timezone aware and naive datetimes?

2017-06-22 Thread Melvyn Sopacua
hour during the autumn switch to standard time. Naive times are fine, as long as you convert to UTC before saving and treat them as in UTC when loading. Of course, Django aware does this for you, but if your input (like from an external source) is guaranteed to be UTC then save some electrons

Re: django_rq or django settings issue ?

2017-06-22 Thread Melvyn Sopacua
: { 'USE_REDIS_CACHE': 'default', }, 'q2': { 'USE_REDIS_CACHE': 'default', } } self.assertDictEqual(expect, settings.RQ_QUEUES) -- Melvyn Sopacua -- You received this message b

Re: Retrieve field values from ManyToMany field in model

2017-06-26 Thread Melvyn Sopacua
lows many metadata with name and value to be linked to a each document. I'm not entirely sure how to describe what your data design accomplishes and I'm guessing you can't either or it doesn't accomplish what you think it should. -- Melvyn Sopacua -- You received this mes

Re: Django + React: Shared Model Consistency

2017-07-06 Thread Melvyn Sopacua
scheme and sending an api version header with each response. If the version deviates, the client knows to request the OPTION header again for future use. Either way, you require at least one request to start the learning process. -- Melvyn Sopacua -- You received this message because you a

Re: How do I model a 'paper object' that should have reviewers?

2017-07-06 Thread Melvyn Sopacua
rization/authentication rather then data model. -- Melvyn Sopacua [1] https://djangopackages.org/packages/p/django-guardian/ [2] https://docs.djangoproject.com/en/1.11/topics/auth/default/#django.contrib.auth.mixins.UserPass esTestMixin -- You received this message because you are subsc

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-06 Thread Melvyn Sopacua
. A developer's task to "remove field A", isn't simply to remove the field from the model and makemigrations. Her task isn't done till all querysets that reference that field by name are refactored. -- Melvyn Sopacua -- You received this message because you are subscr

Re: static files not found on development server

2017-07-06 Thread Melvyn Sopacua
w the `/static` url or failed to run `python manage.py collectstatic`. -- Melvyn Sopacua -- 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+

Re: Class Based Views : filter items by users

2017-07-06 Thread Melvyn Sopacua
{% for user in user_list %} -- Melvyn Sopacua -- 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 post to t

Re: save cropped image with PIL to database

2017-07-06 Thread Melvyn Sopacua
On Monday 03 July 2017 03:09:56 shahab emami wrote: > hello > > i have a question and i cant find answer with search. Really? https://duckduckgo.com/?q=django+resize+image&t=ffsb&ia= software -- Melvyn Sopacua -- You received this message because you are subscribed to

Re: Bizarre URL behaviour after deploying

2017-08-31 Thread Melvyn Sopacua
t; > Tom > > > -- > 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 post to th

Re: Testing file upload via a form?

2017-08-31 Thread Melvyn Sopacua
49YUz-Pa1-Uo9jkGkd1KybB5rSLnp3eAMDQ% > 40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAF1Wu3OTCbnw4o749YUz-Pa1-Uo9jkGkd1KybB5rSLnp3eAMDQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. >

Re: A lot of Problems with Migrating (conceptual)

2017-08-31 Thread Melvyn Sopacua
"Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/dj

Re: trying to create allauth SignupForm subclass for customization....

2017-08-31 Thread Melvyn Sopacua
master/ > allauth/account/forms.py > > I dont know what I'm doing wrong. Any help you can give is much appreciated > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and

Re: Is some problem in field options 'null'?

2017-08-31 Thread Melvyn Sopacua
nsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion o

Re: Weird date math bug?

2017-08-31 Thread Melvyn Sopacua
email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAGBeqiM-kY1br4bzb5yWVEOCnXhcYd3ZoV8bUey1nJoS1iNWuQ%40mail.gmail.com. > > For more options

Re: Testing file upload via a form?

2017-09-01 Thread Melvyn Sopacua
what I need) or there is some other factor at work. > > On 31 August 2017 at 16:47, Melvyn Sopacua wrote: >> >> In the documentation of the test client it is all spelled out how to test >> file uploads. >> >> On Tue, Aug 29, 2017 at 8:48 PM, Derek wrote: &g

Re: Bizarre URL behaviour after deploying

2017-09-01 Thread Melvyn Sopacua
where you think it might provide a solution. -- Melvyn Sopacua -- 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.

Re: Testing file upload via a form?

2017-09-03 Thread Melvyn Sopacua
d 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 post to this group, send email to django-users@googlegroups.com. > Visit this group at https://g

Re: from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-03 Thread Melvyn Sopacua
/groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAAzyz%2BG0MTUNd8xm8ajNby38eoi7Xmj6RgXBZwp2WfAS-n9s2g%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua

Re: Python 2 versus 3

2017-09-03 Thread Melvyn Sopacua
ps.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/df3849b9-1b6a-4a68-b0b4-edbf816d5213%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- You received this message be

Re: Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread Melvyn Sopacua
mod = importlib.import_module(self.SETTINGS_MODULE) > File "/usr/lib/python3.5/importlib/__init__.py", line 126, in > import_module > return _bootstrap._gcd_import(name[level:], package, level) > ImportError: No module named 'weather_station.settings' >

Re: from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-04 Thread Melvyn Sopacua
..@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAAzyz%2BG2MjxRv001kjq%3DpkpzReVAHw03Jv9FW6Ry7sHPwKMsSQ%

Re: Tests broken when I have two database in settings

2017-09-04 Thread Melvyn Sopacua
s@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/d279447c-021b-4af4-b8e6-f7f4bac7f92d%40googlegroups.com. > For more options, visit https://groups.google.com

Re: from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-04 Thread Melvyn Sopacua
> > --- > > I tried to comment out the code you quoted. But that has no effects. > > > On Mon, Sep 4, 2017 at 12:37 PM, Melvyn Sopacua > wrote: >> >> Rename MIDDLEWARE_CLASSES to >> MIDDLEWARE in settings to see if that changes anything. >> If not,

Re: Using data migration to create initial users errors

2017-09-05 Thread Melvyn Sopacua
829f%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- 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, sen

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Melvyn Sopacua
9e3-a85a-88482541c1d8%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Melvyn Sopacua
On Wed, Sep 6, 2017 at 10:19 AM, Xavier Ordoquy wrote: > >> Le 6 sept. 2017 à 10:00, Melvyn Sopacua a écrit : >> >> One of the core design issues with DRF is that everything >> is based around a queryset. Even if the set is just one item. > > This sounds like an

Re: Need advice on writing very specific custom user roles

2017-09-12 Thread Melvyn Sopacua
e 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 post to this group, send email to django-users@googlegroups.com. > V

Re: More bizarre URL behaviour after deploying

2017-09-13 Thread Melvyn Sopacua
Humor me and call it list_view in the pattern and template references. -- Melvyn Sopacua -- 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 dj

Re: Email validation in form

2017-09-13 Thread Melvyn Sopacua
s element out of that if block. >>> -- >>> DR. >> >> >> Sorry, that should have been `{{ field.errors }}`. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from th

Re: Am a new Django User and am finding difficulties making a query to my database

2017-09-13 Thread Melvyn Sopacua
go-users/7b86f648-798a-4cb5-8fb9-cf2a7db83dd5%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and st

Re: The view blog.views.create didn't return an HttpResponse object. It returned None instead.can any one help me this issue please nooob here

2017-09-13 Thread Melvyn Sopacua
; > -- > 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 post to this group, send email

Re: SystemCheckError: (admin.E111)

2017-09-13 Thread Melvyn Sopacua
w this discussion on the web visit > https://groups.google.com/d/msgid/django-users/a14ca186-079a-4cf3-808f-f8442b6353bf%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google

Re: Migration Woes: TypeError: int() argument must be a string... on ForeignKeys

2017-09-13 Thread Melvyn Sopacua
send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-u

Re: More bizarre URL behaviour after deploying

2017-09-13 Thread Melvyn Sopacua
is Christofides > http://djangodeployment.com > > > On 2017-09-13 15:35, Bernd Wechner wrote: > > Well, not a lot of insight from the broader community on this one, but a > warm thank you to Melvyn Sopacua who took the time to think about it a bit > and apply his experience which

Re: Dynamically adding a field to a model - via contribute_to_class

2017-09-13 Thread Melvyn Sopacua
the field, and include this additional flag. > That way, auto-detected migrations will include the extra argument to > the field instance, and there shouldn't be any duplication of the > extension field on the resulting models reconstructed by migrations. > > Good luck, > > Mi

Re: Autocomplete in Django

2017-09-17 Thread Melvyn Sopacua
django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAHn91odu2EUFBMSUX0CfX2f6in%2BHOUMDnAwkT8-nKPUaOGCnxw%40mail.gmail.com. > > For more options, visit https://gr

Re: Autocomplete in Django

2017-09-18 Thread Melvyn Sopacua
eiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.co

Re: django newb, python newb. HELP! URL link worked for days, now has stopped working. Have I found a bug?

2017-09-21 Thread Melvyn Sopacua
o 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 post to this group, send email to django-users@googlegroups.com. > Visit this group at https://g

Re: collectstatic fails

2017-09-21 Thread Melvyn Sopacua
. >> >> Mike >> >> > > -- > 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

Re: submit form as superuser vs regular user

2017-09-21 Thread Melvyn Sopacua
gt; Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/570196c4-7fd8-45ec-a33f-0713f0639228%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout.

Re: Autocomplete

2017-09-21 Thread Melvyn Sopacua
gt; To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/c34ed3e5-2817-4dc6-8d5b-1007e66f988e%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- You received this message because you are subscrib

Re: django select related select field in template form

2017-09-21 Thread Melvyn Sopacua
to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/b2d37648-b6cb-4cac-97cc-4fad30bf2b0a%40googlegroups.com. > For more option

Re: cors headers in django

2017-09-21 Thread Melvyn Sopacua
iew this discussion on the web visit > https://groups.google.com/d/msgid/django-users/87177918-1c8d-4a42-bceb-61de109a9dfa%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- You received this message because you are subscribed

Re: utf-8' codec can't decode byte 0x93 in position 31 even though i use read().decode('utf-8') when i read a UploadedFile i get from a file selector in a View in django

2017-09-21 Thread Melvyn Sopacua
7M8VrjOzJA%2BDGQBQ49490SzDbV7Fz7fnY7R6TxxZmNw%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop r

Re: Django - Best option to check file types, even fake or without extensions

2017-09-22 Thread Melvyn Sopacua
ups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/b5280e1b-ef5c-4749-a243-c75b3275c897%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Melvyn Sopacua -- You received this m

Re: Generating server-side off-line HTML of Django pages ...

2018-06-06 Thread Melvyn Sopacua
ts for views". Selenium is in the realm of integration tests, or acceptance tests if you will. It validates the end result, not a unit of code. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fro

Re: bootstrap to the login template

2018-06-07 Thread Melvyn Sopacua
extbox, so I'm at a loss being a beginner with Django (my first week). I find this difficult to answer, because you mention "apply" and "integrate" bootstrap. You have a certain expectation there. What is that expectation? -- Melvyn Sopacua -- You received this messag

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
clue where the > "example.com" address comes from - that string is not in my codebase. It is the default hostname for django.contrib.sites[1] with SITE_ID = 1. -- Melvyn Sopacua [1] https://github.com/django/django/blob/master/django/contrib/sites/ management.py#L28 --

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
sites with a single admin, it generates fully qualified URLs for the "view on site" functionality, if django.contrib.sites is in INSTALLED_APPS. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To uns

Re: Passing Django Template Vars to JS

2018-06-11 Thread Melvyn Sopacua
On maandag 11 juni 2018 20:11:36 CEST Simon Connah wrote: > I like the idea of the custom attribute. I'll do that then. The common way is to use a data- attribute[1]. -- Melvyn Sopacua [1] https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/ Use_data_attributes -- You

Re: saving django session data for anonymous user

2018-06-12 Thread Melvyn Sopacua
asy possible solution as i am bit new to django:) Well, the easy solution is to follow the documentation[1]: Note that any data set during the anonymous session is retained in the session after a user logs in. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0

Re: python inspectdb got "The error was: function unnest(smallint[]) does not exist"

2018-06-21 Thread Melvyn Sopacua
y, try to write a function for it, but in this case it may be better to refactor the table. Do you know the function of the table and why it would need an array of small ints stored? Can it be refactored to use another table? -- Melvyn Sopacua -- You received this message because you

Re: Is it possible to construct reversible url names in urls.py using , regex etc

2018-06-21 Thread Melvyn Sopacua
for is an iterable that is named 'urlpatterns' in a urls module. https://github.com/yourlabs/crudlfap/blob/master/src/crudlfap/router.py#L274 -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

Re: Why some Django fields are not saved in database?

2018-06-21 Thread Melvyn Sopacua
database. So why are you asking why? -- Melvyn Sopacua -- 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

Re: Why some Django fields are not saved in database?

2018-06-21 Thread Melvyn Sopacua
torial and in your case it'll be helpful to go through the GIS tutorial[3] as well. Cause then you'd discover that other then support for Mapbox and Google maps, Django already has built in most of what the DJango Location Field package is offering you. -- Melvyn Sopacua ---

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Melvyn Sopacua
r cooperate on the project with you. Naturally, you should offer some incentive to people as this isn't a simple Question & Answer problem. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: saving django session data for anonymous user

2018-06-21 Thread Melvyn Sopacua
cally copies the data in the session from anonymous user to logged in user. It's what sessions are made for. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop recei

Re: Forms in Bootstrap 4 Modals?

2018-06-21 Thread Melvyn Sopacua
I have a lot of this stuff worked out, but for Bootstrap 3. I've done this in a UX library I've used for various projects, so it's kinda of a need-driven collection of widgets, CBV's and form components - not exactly something for general use. I've made it available on Gitlab, so you can see h

Re: Django says a modification was made to Auth user when I didn't, and migration has a timestamp from the future. Help?

2018-06-22 Thread Melvyn Sopacua
see the timestamp on this post and here's the migration it thinks > > it needs to make: Do you have a custom user model? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: prevent AppConfig.ready() from running twice

2018-06-22 Thread Melvyn Sopacua
ting up. I recall the python-daemon package being capable of this (and lots of other good stuff). https://pagure.io/python-daemon/ -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Invalid URLs passing validation by URLValidator

2018-06-22 Thread Melvyn Sopacua
quot;, "/", "?", ":", "@", "=" and "&" are the characters which may be reserved for special meaning within a scheme. No other characters may be reserved within a scheme. Which means, that in http scheme, @ is not reserved and as such doe

Re: prevent AppConfig.ready() from running twice

2018-06-23 Thread Melvyn Sopacua
such as file locks or shared memory. In the case of one-off launchers, it's usually easier to implement the restrictions on the client side (the program being launched). Long running launchers (like inetd, systemd) can prevent double launch in other ways as they can keep their own state.

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Melvyn Sopacua
gnals[2], which it can't do if the database is doing the deletion. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/ref/models/fields/#django.db.models.CASCADE [2] https://github.com/django/django/blob/master/django/db/models/deletion.py#L276 -- You received this messa

Re: Is it possible to construct reversible url names in urls.py using , regex etc

2018-06-23 Thread Melvyn Sopacua
x27; object has no attribute '_default_manager' > > > So it certainly seems that using model=i will not pass the model name. > Is this because the argument for model= expects not a string but an object? Yes. You can use import_module from django.functional to pass a dott

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Melvyn Sopacua
model relations with database representation. Knowing this means you have to handle things through Django exclusively where it matters. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: ValueError at /feedback/by/feedback/new Cannot assign "": "Feedback.user" must be a "User" instance.

2018-06-23 Thread Melvyn Sopacua
ot;": "Feedback.user" must be a "User" instance. You're using a custom user model, but have not set AUTH_USER_MODEL[1]. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/ref/settings/#auth-user-model -- You received this message because you are sub

Re: ValueError at /feedback/by/feedback/new Cannot assign "": "Feedback.user" must be a "User" instance.

2018-06-24 Thread Melvyn Sopacua
ct.com/en/2.0/topics/auth/customizing/#auth-custom-user -- Melvyn Sopacua -- 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...@g

Re: post_save signal is not dispatched

2018-06-24 Thread Melvyn Sopacua
On zondag 24 juni 2018 15:45:47 CEST Dejan Spasić wrote: > def post_save_user(**kwargs: Dict[str, Any]) -> None: > if kwargs['created']: > return None So for new users, you bail out and do nothing. Your code works exactly as you wrote i

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-01 Thread Melvyn Sopacua
will not execute `/usr/bin/python` but `your-virtualenv/bin/python`. Handing apache a sanitized PATH with the virtualenv bin dir as first directory, will effectively do the same as "activation". (To be complete: activate also alters your shell prompt, this has no effect in one-off application

Re: Invalid HTTP_HOST header when website being accessed by public IP

2018-07-02 Thread Melvyn Sopacua
ts to the actual Django server with correct hostname, then all you need is 2 server blocks: 1 default, 1 with correct `server_name`. See Request Processing[1] for more background information and tricks. -- Melvyn Sopacua [1] http://nginx.org/en/docs/http/request_processing.html -- Y

Re: Dynamic model fields using mysql?

2018-07-02 Thread Melvyn Sopacua
s is because at 1000 columns = 1000 fields, you will most certainly hit MySQL's maximum row size[2]. -- Melvyn Sopacua [1] https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model [2] https://dev.mysql.com/doc/refman/5.7/en/column-count-limit.html -- You received thi

Re: Invalid HTTP_HOST header when website being accessed by public IP

2018-07-02 Thread Melvyn Sopacua
443 default_server ssl http2; server_name localhost; return 301 https://djangoserver.example.com$request_uri } server { listen 443; server_name djangoserver.example.com; # ... django setup } -- Melvyn Sopacua -- You received this message because you are subscribed to the

Re: Newbie : Object copy - weird error :-)

2018-07-02 Thread Melvyn Sopacua
ly using 2 different databases, a model's save() operation supports a `using` keyword that allows you to select the database connection[1]. Archiving becomes really easy that way. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/topics/db/multi-db/#selecting-a-da

Re: help with learning path

2018-07-05 Thread Melvyn Sopacua
bugs in Django itself, by regularly visiting the bug tracker. Good luck! -- Melvyn Sopacua -- 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-us

Re: Django DateField

2018-07-05 Thread Melvyn Sopacua
hen those with a start date coming in descending order. > > I am at a loss as to how to achieve this so would welcome any pointers or > ideas. Asap field is a boolean. Date field needs to be able to be blank and null. Then: tasks = Task.objects.order_by('asap', &

Re: tests pass individually but fail together

2018-07-05 Thread Melvyn Sopacua
ed--some records are created and some aren't. But the test > results are always consistent for the way the test was run. My first instinct is to run the suite with `--parallel 1` and see if that changes anything. Also, it really helps to have some code - if only to see how the method

Re: Django DateField

2018-07-06 Thread Melvyn Sopacua
possible" %} {% else %} Start Date: {{job.start_date}} {% endif %} -- Melvyn Sopacua -- 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

Re: JSON serializable issue

2018-07-07 Thread Melvyn Sopacua
json doesn't know how to serialize an exception object, it bails out. The underlying problem is that you're trying to store more then 80 chars into a field with max lenght 80. Without code, it is impossible to tell how the two relate. -- Melvyn Sopacua -- You received this message be

Re: ValueError: Attempted relative import in non-package

2018-07-08 Thread Melvyn Sopacua
your "movies app" with: `python manage.py startapp movies` That will create the correct boilerplate. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Re: Using multiple keyword arguments with reverse()

2018-07-08 Thread Melvyn Sopacua
(even > though it has a valid integer value); examining the > contrib/auth/decorators.py file in debug mode: > > def decorator(view_func): > @wraps(view_func, assigned=available_attrs(view_func)) > def _wrapped_view(request, *args, **kwargs): >

Re: Caching JSON in Django

2018-07-09 Thread Melvyn Sopacua
On maandag 9 juli 2018 09:19:59 CEST Ravi Bhushan wrote: > plzz help me to solve this problem Ask more times. It really helps getting you quality auto ignores. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Django-Autocomplete-light Styling Input Box

2018-07-10 Thread Melvyn Sopacua
and CSS created by > the framework and change some styling attribute like width, of height ? Yes you can: - Override html[1] - Pass options to Select2[2] P.S. Excellently formulated question. -- Melvyn Sopacua [1] http://django-autocomplete-light.readthedocs.io/en/master/tutorial.h

Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-10 Thread Melvyn Sopacua
g I need to check, please let me know. Do you know how cookies work? Specifically, that on the first request to a server by a new browser (or command line), there never are cookies? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Djan

Re: Using multiple keyword arguments with reverse()

2018-07-10 Thread Melvyn Sopacua
else and I still don't get how the decorator ties in. Try to reduce it to an mcve[1]. -- Melvyn Sopacua [1] https://stackoverflow.com/help/mcve -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this gro

Re: I made my first Django app, its goal is to generate a styleguide from your scss files

2018-07-12 Thread Melvyn Sopacua
ry about scaling: it's rather large in setup, so if for instance I would load bootstrap 4's scss, would this be a gigantic long page and menu? Keep at it! -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: I made my first Django app, its goal is to generate a styleguide from your scss files

2018-07-12 Thread Melvyn Sopacua
On donderdag 12 juli 2018 17:13:52 CEST Carlo Ascani wrote: > Il giorno gio 12 lug 2018 alle ore 16:44 Melvyn Sopacua > > ha scritto: > > First and foremost: awesome job. > > Thank you! > > > On donderdag 12 juli 2018 14:38:16 CEST Carlo Ascani wrote: >

Re: 3719: 'utf8' is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 - When using MySQL sakila and world DB examples

2018-07-12 Thread Melvyn Sopacua
n a future > release. Please consider using UTF8MB4 in order to be unambiguous.", None)* > > Any suggestion here please? I seem to be stuck here. Downgrade to MySQL 5.x or patch PyMySQL. More info: https://github.com/PyMySQL/PyMySQL/issues/690 -- Melvyn Sopacua -- You received th

Re: how to solve it view app.views.register didn't return an HttpResponse object. It returned None instead.

2018-07-13 Thread Melvyn Sopacua
On vrijdag 13 juli 2018 21:40:48 CEST Hambali Idrees Ibrahim wrote: > i think you can use > forms.is_valid(): > not > form.is_valid(): > > it may work No, it won't. Jason diagnosed it correctly. -- Melvyn Sopacua -- You received this message because you are subscrib

<    1   2   3   4   5   6   7   >