Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Melvyn Sopacua
form for admin, but your core problem is that you mix input validation (task of form) with data consistency (task of model). Keep those separated as much as possible and things will go smoother. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "

Re: How to include delete function in UpdateView instead a DeleteView

2018-08-11 Thread Melvyn Sopacua
k): But Django never will give you one. What you're looking for is self.kwargs['pk'] and the method for form_valid can only accept one argument, which is the form. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Downgrade and Upgrade Django migration

2018-08-05 Thread Melvyn Sopacua
g/grids/g/versioning/ Probably in addition to custom code. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/ref/django-admin/#migrate [2] https://docs.djangoproject.com/en/2.0/ref/migration-operations/ #django.db.migrations.operations.RunSQL [3] https://docs.django

Re: Django App plugins

2018-07-29 Thread Melvyn Sopacua
r and then run migrations. 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-users+unsubscr...@googlegroups.com. To

Re: Django Login Error

2018-07-29 Thread Melvyn Sopacua
el, but storing it as an email field that had to be unique. -- 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...@

Re: Django App plugins

2018-07-29 Thread Melvyn Sopacua
le and instantly installable plugins for a web project without dev(ops) interference isn't necessarily a good thing. -- 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 ema

Re: File-Backend or Filemanagement

2018-07-29 Thread Melvyn Sopacua
ds/g/file-managers/ -- 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

Re: [Question] Django 2 - how to sum values based on filter and group by Year-Month

2018-07-27 Thread Melvyn Sopacua
or in your requirement description. > {'date': datetime.date(2018, 1, 1), 'quantity': 60.0} (30 is *at* the last day of the month, not before it) > 2018-01-31 30 -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-26 Thread Melvyn Sopacua
lutely no way to do that and cannot, because there's no telling what 3rd party apps do (not that python has such a switch or even C). -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group a

Re: Some Doubts on Session Expiries

2018-07-25 Thread Melvyn Sopacua
, because the browser will not send the cookie, so the session is never looked for. Once the date expires, it will be garbage collected. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe f

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-25 Thread Melvyn Sopacua
On dinsdag 24 juli 2018 04:21:07 CEST Kum wrote: > Is there a way to prevent people from accidentally doing so? To prevent network access, there are firewalls. Django isn't the thing for it. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Gro

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Melvyn Sopacua
ve tests disabled or no KVKAPI configuration) def test_api_key(self): self.skip_live_tests() ... # actual tests That way you know why tests are not running. > > On Monday, July 23, 2018 at 8:22:17 AM UTC-4, Melvyn Sopacua wrote: > > On maandag 23 juli

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Melvyn Sopacua
ion numbers). As for a global setting: no there isn't one. Your tests should have a switch of their own if you're worried about that. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and s

Re: Good up-to-date Django report builder addons

2018-07-22 Thread Melvyn Sopacua
built on DRF and frontend is vue-js. So, if the API works as advertised, it's unlikely we will be using the frontend. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Re: Good up-to-date Django report builder addons

2018-07-22 Thread Melvyn Sopacua
why it's ranked all the way on the right, but this is defenitely stable and maintained and has a very good architecture: https://djangopackages.org/packages/p/django-report-builder/ -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Djang

Re: Djando 2.0.7 image handling problem on production server

2018-07-22 Thread Melvyn Sopacua
nds and the point I mentioned pyenv for is that it can read the required version for a given project from a single file in the project directory - something virtualenv cannot do. -- Melvyn Sopacua [1] https://github.com/pyenv/pyenv-virtualenvwrapper -- You received this message because

Re: Help with FilteredSelectMultiple

2018-07-21 Thread Melvyn Sopacua
he box on the right, then the scope just increased tremendously and you need to grow frontend skills. Otherwise, things just work out of the box (upon form submission, you can call form.save() in Formview.is_valid()) or the widget isn't worth it's salt. -- Melvyn Sopacua -- You received this m

Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Melvyn Sopacua
. Relying on "versioned commands" goes wrong too often. -- Melvyn Sopacua [1] https://github.com/pyenv/pyenv -- 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, s

Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-21 Thread Melvyn Sopacua
cally, it's subclass django.core.handlers.WSGIRequest in the case of WSGI. You're not writing a WSGI handler (who has environ as first argument). A view is two stops down and to give you the complete onion: WSGI Handler -> Middleware -> view -> Middleware -> WSGI Handler Anyway, the

Re: Django "pub_date" error

2018-07-21 Thread Melvyn Sopacua
On maandag 16 juli 2018 04:52:51 CEST Daniel Tobi Onipe wrote: > I wrote it exactly as it is in the tutorial... Maybe that part. But you didn't define the pub_date field on the Question model or made a typo in the field name. Go back into models.py and check. -- Melvyn Sopacua --

Re: Admin CSS Not Working in Opera or UC Browser

2018-07-21 Thread Melvyn Sopacua
can have a look. You do *not *have to provide a login. We should be able to see what's wrong by just loading the admin login form. Also, Opera for all intents and purposes is Chrome and if Chrome works, it's very likely to be a caching issue. -- Melvyn Sopacua -- You received this message beca

Re: How to create dynamic form field? Django 2.0

2018-07-19 Thread Melvyn Sopacua
roblem into the right components, which for a Django developer up to the task would be very simple (as shown by the replies). Walk before your run. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Is there any way to disable dispatching of signals?

2018-07-19 Thread Melvyn Sopacua
ng to shoehorn some code into a signal/observer pattern? Perhaps it's not the right fit for your problem. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/topics/signals/#preventing-duplicate-signals -- You received this message because you are subscribed to the Google Grou

Re: Django Tutorial: "NoReverseMatch" Error

2018-07-19 Thread Melvyn Sopacua
world of difference. In fact, a lot of times just composing the mail can solve a problem as you put the code into a different setting and your brain has to process it again. Especially if you paste it as plain text without all the formatting of an IDE/editor. -- Melvyn Sopacua -- You re

Re: Use an external REST API in django admin

2018-07-18 Thread Melvyn Sopacua
ing to go over a network connection. Not to mention figuring out relations... However, I don't understand your wish: what is the upside of storing data in a rest api this way? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Djang

Re: Accessing Django through ssh tunneling and error to get status

2018-07-16 Thread Melvyn Sopacua
f some sorts, like for example using nginx health checks[1]. But there are more implementations, so don't focus on the nginx part. Probably the quickest way to identify the culprit is to use sysadmin utilities like sockstat, netstat and similar. -- Melvyn Sopacua [1] https://docs.ngi

Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread Melvyn Sopacua
t your modules in a sensible way. -- 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

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 subscribed to

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
ase. 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 this message because y

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: I made my first Django app, its goal is to generate a styleguide from your scss files

2018-07-12 Thread Melvyn Sopacua
out 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 unsubscribe fr

Re: Using multiple keyword arguments with reverse()

2018-07-10 Thread Melvyn Sopacua
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 group and stop receiving emails from it

Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-10 Thread Melvyn Sopacua
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 "Django users" group. To unsub

Re: Django-Autocomplete-light Styling Input Box

2018-07-10 Thread Melvyn Sopacua
S 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.html#displa

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: Using multiple keyword arguments with reverse()

2018-07-08 Thread Melvyn Sopacua
ecorator(view_func): > @wraps(view_func, assigned=available_attrs(view_func)) > def _wrapped_view(request, *args, **kwargs): > if test_func(request.user): > return view_func(request, *args, **kwargs) And how is that relevant as well? I think

Re: ValueError: Attempted relative import in non-package

2018-07-08 Thread Melvyn Sopacua
reate 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: JSON serializable issue

2018-07-07 Thread Melvyn Sopacua
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 because you ar

Re: Django DateField

2018-07-06 Thread Melvyn Sopacua
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+unsubscr...@googlegroups.com.

Re: tests pass individually but fail together

2018-07-05 Thread Melvyn Sopacua
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 methods relate to each oth

Re: Django DateField

2018-07-05 Thread Melvyn Sopacua
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', '-start_date') Done

Re: help with learning path

2018-07-05 Thread Melvyn Sopacua
f, 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-users+unsubscr...@goog

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

2018-07-02 Thread Melvyn Sopacua
ifferent 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-database-for-save

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

2018-07-02 Thread Melvyn Sopacua
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 Goog

Re: Dynamic model fields using mysql?

2018-07-02 Thread Melvyn Sopacua
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 this mess

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

2018-07-02 Thread Melvyn Sopacua
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 -- You re

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

2018-07-01 Thread Melvyn Sopacua
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 launch

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 it. -- Me

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

2018-06-24 Thread Melvyn Sopacua
/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...@googlegroups.com. To

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 subscrib

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

2018-06-23 Thread Melvyn Sopacua
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 s

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

2018-06-23 Thread Melvyn Sopacua
; > > 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 dotted path. Or you can use apps.get_model() to get a model class for a a

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

2018-06-23 Thread Melvyn Sopacua
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 message because you are s

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. -- M

Re: Invalid URLs passing validation by URLValidator

2018-06-22 Thread Melvyn Sopacua
;/", "?", ":", "@", "=" 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 does not have

Re: prevent AppConfig.ready() from running twice

2018-06-22 Thread Melvyn Sopacua
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 recei

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
e 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 and stop receivin

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

Re: saving django session data for anonymous user

2018-06-21 Thread Melvyn Sopacua
e 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 receiving emails from it,

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

2018-06-21 Thread Melvyn Sopacua
ate 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 this group and stop

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

2018-06-21 Thread Melvyn Sopacua
l 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 [1] https://docs.djangoproject.com/en/2.0/ref/mo

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: Is it possible to construct reversible url names in urls.py using , regex etc

2018-06-21 Thread Melvyn Sopacua
ed '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 unsubscribe from this group and stop receiving ema

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

2018-06-21 Thread Melvyn Sopacua
ction 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 are subscribed to th

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: 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 recei

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
ple 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 unsubscr

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
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: bootstrap to the login template

2018-06-07 Thread Melvyn Sopacua
tbox, 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 message because

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

2018-06-06 Thread Melvyn Sopacua
ot;. 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 from this group an

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Melvyn Sopacua
On maandag 4 juni 2018 20:40:03 CEST Richard Brockie wrote: > On Mon, Jun 4, 2018 at 9:01 PM Melvyn Sopacua wrote: > > This isn't a problem. Neither url nor reverse is capable of returning URLs > > with hostnames, at least not that I'm aware of. Only django.contrib.

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Melvyn Sopacua
thing I enter after > the ./manage.py (i.e. runserver, dbshell, etc) You most likely switched to Python 3. But a backtrace would help a lot to understand the cause. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Melvyn Sopacua
mistakes in our code", then you should already know the answer - test, test, test :). -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/ref/contrib/sites/#getting-the-current-domain-for-display -- You received this message because you are subscribed to the Google Groups &

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

2018-06-04 Thread Melvyn Sopacua
ed information (like logged in user). The cheaper method is something like this code[2], but this only renders the template and you'd have to provide a context so view code is bypassed. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/topics/testing/tools/#the-test-client [

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-03 Thread Melvyn Sopacua
think anything breaks at all. -- 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 g

Re: Updating django database

2018-06-02 Thread Melvyn Sopacua
anager operation. The first cannot. -- 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 po

Re: Implementing a 'please wait' page

2018-06-01 Thread Melvyn Sopacua
way to do this and this tutorial shows all things required to provide user feedback: https://buildwithdjango.com/blog/post/celery-progress-bars/ -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Call to method that takes in a request

2018-06-01 Thread Melvyn Sopacua
o test a view, use the TestClient[1]. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/topics/testing/tools/#the-test-client -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop re

Re: URL Concatenation Issue

2018-06-01 Thread Melvyn Sopacua
. You are missing a few fundamentals the tutorial touches upon, such as the basics of URLs and URL paths[2]. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/intro/tutorial03/#removing-hardcoded-urls-in-templates [2] https://stackoverflow.com/a/904066/1600649 -- You receiv

Re: dumpdata fails with crytpic error

2018-06-01 Thread Melvyn Sopacua
On vrijdag 1 juni 2018 06:22:43 CEST Bernd Wechner wrote: > Anyone seen this before. How does one diagnose this given the vague nature > of the message? Using the --traceback flag. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "D

Re: href not working

2018-05-31 Thread Melvyn Sopacua
^admin/', admin.site.urls), > > url(r'^', include( 'hybridair.urls')), This matches anything that has a beginning. So that always matches, anything after it, is ignored (Django works on first match base). > url(r'^', views.index, name='index'), And again. So anything that is

Re: href not working

2018-05-31 Thread Melvyn Sopacua
oth views. -- 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 em

Re: ValueError at /polls/1/vote/

2018-05-29 Thread Melvyn Sopacua
On dinsdag 29 mei 2018 14:07:59 CEST Caleb Bryson wrote: > def vote(request, question_id): > ... # same as above, no changes needed. You fell into the cut-and-paste-without-reading trap. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups &

Re: money field question

2018-05-29 Thread Melvyn Sopacua
print('{:.55f}'.format(23.45)) So decimal.Decimal's constructor converts strings to decimal numbers with as much precision as given. It also applies to floats, except that floats have more precision then typed. -- Melvyn Sopacua -- You received this message because you are subscribed to the Googl

Re: Multisite strategy

2018-05-24 Thread Melvyn Sopacua
ght place. > > > > Is `contrib.site` suitable for that scenario? > > I was thinking at 3 different sites. > > If so, how can I use them locally while in development? > > > > Any other suggestions? > > > > Best, > > Carlo -- Melvyn Sopacu

Re: help me out

2018-05-24 Thread Melvyn Sopacua
On donderdag 24 mei 2018 17:28:53 CEST Umar Kambala wrote: > It is located in mysite/polls/template/polls/ It should be in mysite/polls/templates/polls/ Note: templates with an s, not template. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Gro

Re: Issue with Django migrate - fine with 2.7x python, but error with 3.6.4?

2018-05-24 Thread Melvyn Sopacua
protocol for your developers to communicate with eachother when adding and removing migrations. -- 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

Re: Starting your first app

2018-05-23 Thread Melvyn Sopacua
with Django 1.8 (and we're now on 1.11LTS / 2.0 and 2.1 is around the corner). https://docs.djangoproject.com/en/2.0/#first-steps -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and s

Re: Issue with Django migrate - fine with 2.7x python, but error with 3.6.4?

2018-05-23 Thread Melvyn Sopacua
e different from the py2 version. >From the backtrace it isn't clear though which app is causing this. If it really is a py2 versus py3 issue, then I suspect that some migrations are done only for py3, though that is really bad practice. -- Melvyn Sopacua -- You received this message

Re: django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-21 Thread Melvyn Sopacua
this setting. It's you. Cause you filled in "polls" as the application name (not the project name). -- 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 f

Re: Django login() function works in production but not in development

2018-05-19 Thread Melvyn Sopacua
t get logged in? -- 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

Re: New to Python

2018-05-19 Thread Melvyn Sopacua
page to view or use using python as well. Since you're in the Django user group, you would use Django and it's template engine: https://docs.djangoproject.com/en/2.0/topics/templates/ -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Djang

Re: Standard approach

2018-05-19 Thread Melvyn Sopacua
r/faqs/smart-questions.html -- 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 g

Re: Public Django administrative database

2018-05-19 Thread Melvyn Sopacua
format. Therefore it sometimes pays off to go with alternative proprietary services, purchase databases that have information linked properly or go with Open Street Map. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To un

Re: getting error while reloading the url"http://localhost:8000/polls/".The error is given below.Please tell my why i am seeing this error?

2018-05-19 Thread Melvyn Sopacua
are hard to read or do not have the answer in an obvious way. But so far, you haven't encountered those at all. -- 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 e

Re: Adding to all templates context via Middleware

2018-05-14 Thread Melvyn Sopacua
't deemed authoritative and Django just fills in what it thinks it's missing 2) If you want to "edit defaults in project settings" you are bound to run into circular imports as the Django settings needs to load your settings and you want to import the Django settings. -- Melvyn Sopacu

Re: SQL select statements to Django ORM

2018-05-14 Thread Melvyn Sopacua
uld do in the database, but you'd still not use annotate, cause you can simply filter on the dob using standard __gte/__lte etc. lookups. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: SQL select statements to Django ORM

2018-05-14 Thread Melvyn Sopacua
not to shoehorn the ORM into your notion of SQL, but to think in models, model fields, object properties and model relations. There will be times where the ORM needs help from SQL, but pick your battles. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups

Re: SQL select statements to Django ORM

2018-05-14 Thread Melvyn Sopacua
or person in people: print(people.name, people.dob, people.age) -- 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-u

Re: Unit testing models.py

2018-05-14 Thread Melvyn Sopacua
er downstream, by verifying form labels and their translated version if it applies. And I'd say the exact wording of a form label may not be at all important, so you could skip this. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django u

  1   2   3   4   5   6   7   >