Google est ton ami : "django mongodb" fournit un tas de réponses à cette
question, y compris des références à des packages d'extension de Django.
Eric
From: django-users@googlegroups.com on behalf
of Djamiyou CHITOU
Sent: Thursday, July 4, 2019 11:48
To: Djang
generation.
Eric
From: django-users@googlegroups.com on behalf
of PASCUAL Eric
Sent: Monday, July 1, 2019 17:06
To: django-users@googlegroups.com
Subject: Re: Accessing data from a 30 GB file in json format
Hi,
To be able to traverse the JSON structure you
Hi,
To be able to traverse the JSON structure you'd normally need the entire
structure in memory.
Not mandatory, depending whats is to be done with the data.
The same problem exists with XML, and this is the reason why SAX parsers have
been created in addition to DOM ones.
If the data process c
Hi Sabuhi,
I wrote something similar a couple years ago, not involving Arduinos but using
MQTT anyway.
The selected approach consisted in having a MQTT listener, based on paho-mqtt
lib (https://pypi.org/project/paho-mqtt/), acting as a gateway to a REST API on
the Django side, based on Django
Hi,
You can avoid dealing with IPs directly, considering that mDNS is available by
default on Debian based distros (hence Ubuntu). Thanks to this, the server is
published as ".local".
mDNS is not installed by default in Windows, but it seems that it changed with
Windows 10.
Best
Eric
___
ements.txt
COPY . /code/
On Tue, Apr 9, 2019 at 1:30 PM PASCUAL Eric
mailto:eric.pasc...@cstb.fr>> wrote:
Hi,
Working in contenerized context does not change anything from other modes.
You just need to include the appropriate pip install command in the Dockerfile,
so that all the dependenci
Hi,
Working in contenerized context does not change anything from other modes.
You just need to include the appropriate pip install command in the Dockerfile,
so that all the dependencies are installed in the image. They will then
available to your app the same way they are on you dev machine.
Hi Mohit,
The only situations where I have used strings are forward declarations or
potential reference loops.
Intuitively I'd say that referencing models by their name adds a slight
overhead for class lookup. But since this is supposed to happen only when the
model definition is loaded (field
Hi,
Chances are that you're thinking about "runserver", which is a management
command. On Unix based systems (i.e. Linux or MacOS) you start it with :
./manage.py runserver
I'm not exactly sure about Windows, but it should be something as :
python manage.py runserver
Warning : as stressed in
Hi,
pyenv (https://github.com/pyenv/pyenv) offers a simpler way for
activating/deactivating venvs, by managing this automatically for you based on
where you are located in the file tree.
Before focusing on this feature, you must know that pyenv does far more than
managing virtualenvs, since it
Hi Cameron,
the reason why I wanted to use django is that I had used it before and I didn't
want to have to learn a new framework if possible.
Makes sense.
However, light FWs such as Tornado (which I like a lot, and prefers over Flask
BTW) have a really small learning curve for a basic usage (i
Hi,
Not sure Django is the right choice in your case since one of its main purposes
is to hide the SQL stuff by putting the ORM in front.
You'd better use Flask, Tornado or any other Web framework which does not come
with any special feature WRT data access.
Best
Eric
___
Hi,
Templates are nothing more than HTML files with special tags inside. In their
simplest form, they can be plain HTML without any templating tags and they will
thus be rendered without any change.
In conclusion, to keep it simple and still let you the opportunity to benefit
from templating f
Hi Scott,
100% agree with all your points about stock Django. This is BTW the way I use
it in all my projects. The stripping experiment I mentioned has been done for
curiosity's sake, for diving a bit into customization if ever I would need it
some day.
Knowing this, my suggestion about provid
Hi,
There has been quite a lot PyCon talks about this topic, including introduction
ones for people not used to Python async extensions.
You can find them on YouTube by asking for "pycon asyncio" for instance.
Best
Eric
From: django-users@googlegroups.com on
Hi Derek,
but I have never seen anyone refer to it as a "lightweight" project (before
you, that is).
I didn't meant "Django is lightweight" but "Django can be lightweight", implied
you configure it accordingly.
Of course, leaving in place the ORM, the session management, the authentication
syst
Hi,
I never know what people mean by "Django is overkill for...". Django is
lightweight and starts up very quickly
You're right WRT the Django technical part.
My feeling is that people implicitly refer to the learning curve, because it's
the visible part. Django is a very capable framework with
Hi,
Start by studying the iintroduction and the tutorial directly available on the
Django official website. Th will learn you step by step the fundamental
concepts and how to write a fully working application using a significant share
of Django features.
Once you'll have assimilated the basic
Hi,
Since you'll need to update the files on the server, you must have a write
access to it.
Usually, FTP is no more activated on servers, because not secure at all. This
can be the reason why the access is denied. There should be an ssh access
available, so that you can connect on the server
Hi,
How is configured your Docker stack exactly ? You should have several
containers in it, at least one for the Redis server, another one for the Django
app.
Do you use docker-compose to run the stack ? If yes, could you provide the YAML
descriptor of the stack ?
Best
Eric
___
Hi,
The Django official website includes an extensive reference documentation and a
detailed tutorial. This is the preferred start point.
Afterwards, you can grab complements from resources such as :
* Django Girls site
* Two Scoops of Django book
These are those which came out of
Hi,
It depends on the type of deployment you use.
The options I use are :
* for deployment on a "bare server", I create a standard user which id is
used for running the application, and the application code is stored under the
home dir of this user. This solves the security problem of r
Hi,
That way you don't have to deal with rotating log files (not sure if
djangos file logger handles that though) and permission problems.
There is no "Django logger". Django uses the Python native logging module. This
module defines several handler types, including the RotatingFileHandler one
The simplest way to do this is implementing a custom admin command, which will
be invoked then with :
./manage.py my_awesome_command
It will take care for you of setting the Django environment (i.e. updating the
Python path so that the apps are included in it, applying settings and making
your
Bonjour,
pip install django
et un petit tour dans la documentation de Django ne ferait pas de mal, car ce
point est couvert ici :
https://docs.djangoproject.com/en/2.1/intro/install/
Eric
From: django-users@googlegroups.com on behalf
of Moise Sacko
Sent
Hi Chris,
The problem you describe does not require Django at all to be solved.
WRT process parameter input, what you need here is a simple Web based UI with a
basic form. Of course Django can do it, but if you don't need features such as
the ORM, admin... you can implement it with a couple o
thanks for confirming. I've written my share of logrotate.d files, but I
may push to do something else, like send them directly to Elasticsearch with a
delay of some sort.
On Fri, Dec 21, 2018 at 2:00 PM PASCUAL Eric
mailto:eric.pasc...@cstb.fr>> wrote:
Hi,
If you are running on
Hi,
If you are running on a Linux system, you'd better using the standard stream
logs and logrotate to manage file rotating.
The later is the blessed tool for this kind of task, since it manages for free
the compression of rotated files and removal of oldest ones if you want to.
Regards
E
Hi,
What do you mean exactly by "opencv app" ?
If you are referring to some kind of interactive app popping up windows to
display results of processing, or using the associated event loop, there are
great chances you cannot for obvious reasons (number one being that there is no
graphical desk
Hi,
Which server are you using ? Is is runserver ?
When running in debug mode, it serves statics, but not when debug mode is
turned off.
If you Google with "django runserver static debug" you'll get this hit in the
very first ones :
https://stackoverflow.com/questions/5836674/why-does-debug-
Hi,
What are you looking for exactly ? Computing the distance on ground between two
points, based on their geographical coordinates ?
If yes, this is not related to Django, nor to Python in any way. Google with
keywords such as "geographic coordinates distance computation" and you'll get
ton
> hey, you need to pay for that.
Seen quite frequently : some of the visitors of community groups such as this
one confuse them with "do_my_job_for_free.com" or "do_my_homework.com" 😊
Eric
From: django-users@googlegroups.com on behalf
of amit pant
Sent: Tue
370 assembler
So I'm not the last dinosaur still alive and having written 370 ASM stuff in
his former life 😃
Sure Django and Python are a big step from there, and welcome aboard ;) Which
kind of project do you plan to work on, and what are your questions ?
Eric
ng to understand my vague question.
Lance
On 11/12/18 10:04 AM, PASCUAL Eric wrote:
Hi Lance,
but I need for people who are admins for a particular cloud to add their cloud
details to the app and then store their credentials securely.
I'm not sure to understand the need for adding cloud deta
redentials
securely.
Unfortunately this will need a dynamic storage mechanism which i don't know how
to do yet
Regards
Lance
On 11/12/18 12:03 AM, PASCUAL Eric wrote:
Hi,
It can depend on which deployment option you plan to use for the application.
For instance, a Docker deployment orchestrate
akurthy swamy
mailto:veeraswam...@gmail.com> wrote:
hi sir thank u for giving reply and the real time means what the present
projects are going on company based on python and django,,,
And i have a two years gap in my academic period based on that project i want
to fill-up that gap so
Hi,
Is the directory where your template file resides included in the list of paths
configured in the settings of your application ?
Regards
Eric
From: django-users@googlegroups.com on behalf
of Mohammad Shareef M
Sent: Monday, November 12, 2018 6:48:14 A
Hi,
It can depend on which deployment option you plan to use for the application.
For instance, a Docker deployment orchestrated by Kubernetes gives the option
of using secrets for sensitive information, which a hoster such as GCP manages
conveniently. In this kind of deployment, configuratio
Hi,
What do you mean exactly by "real time" ? Can you describe the project you are
thinking about ?
"Real time" relates to a very specific class of software, which one of the
characteristics is to react to external events in a (most often) short and,
deterministic time. For sure, neither Pyt
Hi,
Have a look at the "migrate.py inspectdb" command documentation
(https://docs.djangoproject.com/fr/2.1/ref/django-admin/#inspectdb).
This command generates the models for tables in an existing DB. To avoid
messing with the existing data, these models are declared as non managed, which
me
My opinion is that Minikube is the easiest way, since it is quite simple to set
up and run. Behind the curtains it uses a VirtualBox machine BTW if I'm not
mistaken (at least under Linux).
You can of course set up a multi-node stack using several VMs (after all, this
is exactly what hosters do
Hi,
IMHO the simplest way is to use cron.
Since you are working with Docker, one option is to add a container to your
stack, sharing the same image as your Django app so that it can run the
management command implementing your periodic process. Configure this container
so that the command it
I'm not even sure those are the same as Docker containers even though
Kubernetes can run Docker images.
Kubernetes is an orchestrator for Docker containers, not a container engine.
You can run the same images in K8S managed containers or on your local Docker
engine, using docker-compose for in
but I am a bit afraid that the memory usage for example might change over time?
It will of course, but apart if you have some memory leak somewhere, it will
tend to stabilize over time.
Ah well - I will have to monitor this for an extended period of time and see
what happens then :-)
For su
Hi,
Django is not really the key factor here, and the amount of consumed resources
depends mainly on what your business logic does on top of Django.
IMHO the only way to properly estimate the limits is observing the metrics and
trends of the related pods for a significant period and with an a
Hi Charley,
You should not regret this choice.
Sometimes Django seems a bit overkill at the first glance. But most of the
times, once the project has made some progress you'll quickly appreciate the
fact it is like Python : batteries included. No need to hunt for external
add-ons which will i
Hi,
Do you think there's any reason to use DRF despite not needing an
externally-consumable API?
None that I can think about. But I don't pretend to be an expert on the topic ;)
IMHO it is just a matter of planing for the future. If you are certain that
nothing else but your current app will
Hi,
If the JSON is related to a data model, and if this model is elaborated and
subject to evolution in the furure, Django can help a lot. Add Django
RESTFramework to the combo to take care of the REST stuff.
If not, I'd suggest Falcon (https://falconframework.org/), which is a light and
ver
Hi,
You mention that adding DRF can actually make you lose some potential benefits
from caching?
Django does a lot of job WRT caching data at the ORM level and there is a
"direct path" from the UI and the ORM. I've the feeling that putting a REST API
in the middle have chances to defeat some
Hi,
Using DRF can help when there is a need for decoupling the presentation layer
from the logic one, for instance if the logic is planned to be used in other
scenarios that the interactive Web app.
One can argue that structuring the logic as a Python package can do it, but
this will not wor
Hi,
Did you study the documentation about the media and how to handle them ? It is
quite explicit and if I remember well there are a couple of code examples.
Eric
From: django-users@googlegroups.com on behalf
of kheinrichdja...@gmail.com
Sent: Thursday, Oct
Well... it only depends on you and your skills, plus what you want your app to
do exactly.
How do you want people other than you answer such a question ?
Eric
From: django-users@googlegroups.com on behalf
of Md.iftequar iqbal
Sent: Tuesday, October 9, 2018
Hi,
Just my $0.02, but human resources management is a quite broad topic, and the
kind of project you're planning is not a toy (i.e. "Hello world" style)
application :)
In addition, since you are a Django newbie, I'm afraid that it could be out of
reach with your actual skills. It would thus
Hi,
Which error(s) did you get exactly ? It is not clear in you message whether
your problem is at the CSV data processing level or at the Django one.
In case this could help, using the standard csv module you can obtain a reader
wich takes care of parsing and decoding thanks to the reader()
Hi,
Didn't you find material in the documentation I pointed you towards ? Which
point do you miss exactly ?
Best
Eric
From: django-users@googlegroups.com on behalf
of BBG
Sent: Thursday, September 27, 2018 8:40:12 PM
To: Django users
Subject: store CSV co
Hi,
Have you studied the documentation of the CSV module included in Python
standard library ?
You'll find there all the needed information for reading and interpreting CSV
files without having to implement the raw parsing, and have there rows in a
form ready to use for inserting objects in
Hi,
Not 100% sure, but I think that the 'p' should be a "P" (capital).
I've always used the capital version, since it's was is shown in the docs and
examples, so I can't say if lowercase 'p' works too.
Eric
From: django-users@googlegroups.com on behalf
of s
Hi,
It depends if the structure of the data you want to post is the same as the one
your retrieve with a GET, and if it fits with the underlying model. In this
case, the same serializer can be used for both operations. Pay attention
however that things can be more complex if the involved model
Hi Phil,
As suggested by other posters, creating a virtualenv is the safest way to work
with Python, since it avoids tampering with the system level installation (f.i.
several Linux distros use Python for a lot of their system tools in nowadays
versions) and it lets you have customized environ
As already requested earlier by other posters, please STOP this totally useless
and sterile discussion.
As Gerald Brown wrote, the best editor is the one you feel the most productive
and comfortable with. Full stop. Everybody has his own background, habits and
tastes, hence there is nothing su
Hi Kamal,
Of course you can. It's just a matter of defining virtual hosts in Nginx
configuration and route them to the different Gunicorns serving your apps,
based on the host found in the requests URLs.
Best regards
Eric
From: django-users@googlegroups.com
IMHO, some of (a lot of ?) the "classical" GOF patterns do not really apply to
Python (or at least are not necessary, when not making things more confuse).
They are often a consequence of constraints and limitations of statically
compiled languages such as C++, Java and alike used at the time th
Templates contain standard HTML code (or any other text based content) and
template directives, delimited by '{% %}'. They can also contain placeholders,
delimited by '{{ }}', which content is processed and replaced with the
resulting value. The resulting values are basically the ones you pass
Hi,
The content of the context dict can be anything, including of course values
read from the database thanks to the sqlite3 lib. What Django generic views
working with templates do is transfering for you the object field values to
context entries and also automating the creation of form field
ectly in django
It depends.
If tables have always the same schema and only their data is
different, you can use `manage.py inspectdb` [0] to create models and
develop your views.
[0] https://docs.djangoproject.com/en/2.0/ref/django-admin/#inspectdb
On 22 May 2018 at 11:01, PASCUAL Eric wrote:
Re,
But you'll not be able to access the sqlite DB through Django models, since it
will not have the proper schema.
Eric
From: PASCUAL Eric
Sent: Tuesday, May 22, 2018 3:59:35 PM
To: Django users
Subject: Re: Open Sqlite database file directly in django
Hi Jaiswal,
You can use the Python sqlite3 standard lib for opening this database and
manipulate it, and then display data using views written with Django.
Eric
From: django-users@googlegroups.com on behalf
of Sourabh Jaiswal
Sent: Tuesday, May 22, 2018 8:0
Hi Mikkel,
When facing this type of situation, I tend to use one of these two options,
depending on the number of model classes:
* if the number of classes is reasonable, I use a single app, but implement
the models in a model package, distributing the classes into modules inside
this pa
How is github "security" going to help you keep your passwords safe
IMHO, it does not.
As you wrote, env vars configured on the target system (be it a bare server or
a Dockerized environment in the cloud) seem to be safer on this point since not
stored anywhere but on the target.
Eric
You're perfectly right about the "500 Error + DEBUG" case.
One solution is to set DEBUG to off by default, and turn it on by code in the
setting module if detecting that the app is executing in a dev or Q&A
environment. Depending on your context, this can be done with rules based on
the host
encrypted) in
https://www.crowdcast.io/e/deploying-django, from 38m10s to 46m30s.
Regards,
Antonis
Antonis Christofides
http://djangodeployment.com
On 2018-03-30 13:06, PASCUAL Eric wrote:
Hi,
Environment variables are the best option for not embedding sensitive
information in files whic
Hi,
Environment variables are the best option for not embedding sensitive
information in files which have chances to be stored in places such as external
source repositories (GitHub et al.).
If you are working with orchestrators such as Kubernetes, you can use the
"secrets", which are specia
Hello,
I recently ran into a problem with a custom migration containing code
manipulating the data.
The simplified scenario is:
* a given model has been defined with its set of fields. So far so good.
* later on, a new field has been added, intended to contain a required
read-only va
Office oriented editors tend to take initiatives for making the text prettier
(at least, according to their "standards" 😊).
For programming tasks, you'd better use real programming editors. There are a
lot of very good ones which are free, and even full IDEs. I'd strongly suggest
PyCharm Commu
hon36/DLLs;
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of PASCUAL Eric
Sent: Wednesday, February 14, 2018 8:52 AM
To: Django users
Subject: Re: AttributeError: 'module' object has no attribute 'lru_cache' with
python 3.6.4 and Djan
Hi,
Normally you shouldn't have to add site-packages in the PYTHONPATH since it is
supposed to be already. If not, packages installed via "sudo pip install" would
not be found.
I've packaged a lot of applications in Docker containers, and never had to
modify PYTHONPATH.
Your problem is may
: PASCUAL Eric
Cc: django-users@googlegroups.com
Subject: Re: importError: Count Not import Django inside Virtualenv
Hi Eric,
Le 2018-02-14 à 03:44, PASCUAL Eric a écrit :
Hi,
Hard to say without knowing the exact context, but my gut feeling is that
you've modified a system wide library
d first in
virtualenv. Maybe when I updated my system? Btw, I have some projects which are
not yet in github, can I just copy and paste them in a new folder with new
virtualenv?
On Wed, Feb 14, 2018 at 4:44 PM, PASCUAL Eric
mailto:eric.pasc...@cstb.fr>> wrote:
Hi,
Hard to say without knowing t
ango there. It seems that even though virtualenv is activated, the
packages I installed inside it are not recognized by the system.
On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric
mailto:eric.pasc...@cstb.fr>> wrote:
Hi Jarvis,
Can you provide the error messages trace ? It can greatly help
Hi Jarvis,
Can you provide the error messages trace ? It can greatly help understanding
what's happening.
If you haven't already done this, try to restart from a fresh new virtualenv
inside which you'll install Django and the additional packages you've added (if
any). Then restore a copy of
Hi,
> You may want to check out sqlalchemy they provide a pretty good documentation
> on what you are aftering
For my understanding, why are you suggesting to use SQLAlchemy while Django
provides an ORM out of the box ?
SQLAlchemy is required for frameworks such as Flask, which do nothing w
Hi Amit,
There is no "Django Web page" as you write in your message, but Web pages of
the application built on top of the Django framework. Hence how to display data
depends on how the Web pages of *your* application are designed.
Second point, one of the roles of Django is to isolate the app
Hi,
As a satisfied user, without any connection with JetBrain corp., and after
having worked for several years before with Eclipse/PyDev, my feeling is that
PyCharm is the best IDE of the moment for "non-toys" Python + framework
projects.
Beware that if you want to benefit from the Web or sc
Hi,
If virtualenv is to be avoided (which I do not recommend anyway, especially for
a newbie, since it protects him from breaking his Python system installation),
my advice would be to go with:
$ python setup.py install --user
This way only the user's private environment is modified, and if
Hi,
Since it is static (i.e. never modified), the CSS classes dictionary (statemap)
could be extracted from the function and promoted as a module global variable,
to avoid it being reconstructed each time the filter is invoked.
This will not cut the processing time in half, but small streams
Hello
Sorry or I misunderstood your problem but what about using the required field
attribute ? It will make such controls and messages be handled directly on the
client side.
Best regards.
Eric PASCUAL
Centre Scientifique et Technique du Bâtiment
290 route des Lucioles
06560 SOPHIA ANTIPOLIS
86 matches
Mail list logo