I would like to do aggregate calculations based on month for a
datetime field.
I am currently using the extra() function to format the date like:
...extra(select="strftime('column', '%m/%Y') as t").values
('t').annotate(SUM(foo))
and it works great for sqlite3.
In sqlite3 I can use strftime(),
Probably because you have two AutoFields. You can’t have two in the same
model. Set this to eid=models.AutoField(primary_key=True)
This is because Django models automatically makes an id autofield primary
key if nothing else is set as pk.
On Sun, May 26, 2019 at 9:05 PM Bob Gailer wrote:
> On M
Follow a tutorial.
1) Hide your secret key and everything secretive in an environment
variable. Or use Django-environ
2) Try python manage.py check —deploy
3) Debug is set to True... it should not be True if you’re publishing
(deploying)
On Mon, May 27, 2019 at 3:46 PM omar ahmed wrote:
> i can'
Try clearing your browser history and info. Should also test in Incognito
or Private browser so info is saved. I have a suspicion that your browser
is saving login info and you’re just not realizing this.
On Tue, May 28, 2019 at 5:54 PM Fellipe Henrique wrote:
> Hi Jim,
>
> Tried that, as you ca
Sorry. Info ISN’T saved on private browser
On Thu, May 30, 2019 at 7:25 PM Andrew C. wrote:
> Try clearing your browser history and info. Should also test in Incognito
> or Private browser so info is saved. I have a suspicion that your browser
> is saving login info and you’re
There really isn’t any point in doing that. 1) You should just use one of
the two. Django officially supports Postgres. 2) You’d want to keep your
users all jumbled in one database. If you have a foreign key to the
username field, and the db can’t find a specific user because it’s in the
other db,
Gotcha. I’ll try my best to explain what you could try. And if this looks
sloppy, then I’ll make a public gist.
So, firstly, let’s set some things straight. A database is a collection of
tables. Models in Django represent one table with multiple columns. Tables
do not need to have the same columns
Np!
https://docs.djangoproject.com/en/2.2/ref/models/fields/#floatfield
Just refer to the docs. There’s FloatField and DecimalField for models.
When you show the numbers in views, just use python to round the numbers.
There are plenty of tutorials and SO (stackoverflow) questions that’ll
help. Pe
Like a profile? Try this:
https://simpleisbetterthancomplex.com/tutorial/2016/11/23/how-to-add-user-profile-to-django-admin.html
On Mon, Jun 24, 2019 at 9:13 AM AMOUSSOU Kenneth
wrote:
> Hi everyone,
>
> Is it possible to create different class that will extend the `User` base
> class with diffe
Install uvicorn. Easy integration with gunicorn. There’s a good article
about how to setup your Djsngo 3.0 async websocket app online too now.
On Thu, Mar 19, 2020 at 3:32 AM Suraj Thapa FC
wrote:
> You can't use gunicorn with django channels...
> Use Daphne or uwsgi etc
>
> On Wed, 18 Mar 2020,
If you want to avoid web frontend, then stick to mobile app development.
DRF as someone else mentioned helps. I recommend front end development
because they have guidelines and make thing easier to implement (iOS is
much much easier). You can’t make a usable app without doing both frontend
and back
The only hint I can freely provide is to use celery tasks. They let you do
taskname.delay(pk_user1, for_chat_pk). You can look online for an article
with the url dev.to to setup your asgi.py file. That’s all I can freely
give out, though. Good luck!
On Tue, Mar 24, 2020 at 10:40 PM Motaz Hejaze
Hejaze wrote:
> That was unexpected , i thaught about using python module socketio
>
> On Wed, 25 Mar 2020, 5:08 am Andrew C., wrote:
>
>> The only hint I can freely provide is to use celery tasks. They let you
>> do taskname.delay(pk_user1, for_chat_pk). You can look onlin
Stripe is the best imo
On Fri, Mar 27, 2020 at 12:49 PM Motaz Hejaze wrote:
> Any ideas guys
>
> On Fri, 27 Mar 2020, 3:07 pm Motaz Hejaze, wrote:
>
>> Hi friends ,
>> What is the best and easiest way to implement money transfer from visa to
>> visa and from visa to bank account ??
>> And how t
I highly recommend not using MongoDB. Sure, they can plaster a banner
saying “Google supports us” but many industry leaders have tried and failed
using it. It can’t store data that easily once you grow, making it unlikely
for usage in the future for employment by any startup or corporation and
for
What’s the HTTP status code? Does the nginx page even show anything? Try:
sudo systemctl stop nginx && sudo systemctl disable nginx && sudo systemctl
enable nginx && sudo systemctl start nginx
This command could also be in the wrong order... it’s been awhile.
It could be a symbolic link error. I
I’m about to create a PR (or not, not sure) with an AWS ALB setup for
cookiecutter django. The gist of it really is that there’s an article my
msaizar that has a good nginx configuration setup. Remove traefik and add
nginx. Your target group in AWS should have all machines registered on port
80 and
https://pypi.org/project/django-ip-restriction/
Try just searching up “Django ip restrict” or “django ip restriction” or
“django ip block”
There are plenty of options out there. As for why this might be needed, you
can blame China with all these bot attacks on websites :P It can also be
for other
Two options:
1) Save the JSON files and link it with a FileField
2) Use PostgreSQL’s Django-specific JSONField.
On Sat, Aug 10, 2019 at 9:46 AM Suraj Thapa FC
wrote:
> How can I linked a JSON file with my db... Json files contains the key
> value pair of the user data..
> If the id in the db a
You would probably need AJAX calls. I think there’s a package called
Django-autocompletelite which can help you with this. So, in your HTML, you
can use use AJAX to see when a user types the @ character with a single
letter and then show a box with some usernames with that.
On Sat, Aug 10, 2019 at
I suppose in a view, you can write something along these lines:
import json
from os import path
from django.conf import settings
def index(request):
if request.method == ‘POST’:
form = YourForm(request.POST)
if form.is_valid():
field1 = form.cleaned_data.get(‘fi
I’m not sure what you mean by content management, so I’m gonna take a
guess: website builder like Weebly or Wix. You need a NoSQL database,
completely unstructured data. Kind of like a crime file drawer with folders
dedicated to each case and all its evidence. Some folders only have one
piece of ev
What is your major? Usually tying in what you know, how you behave, and
importantly how you think contributes to a certain type — or even workflow
or stack — of learning in CS.
On Mon, Jan 20, 2020 at 1:52 AM Jack Lin wrote:
> I’m not sure what this gonna be in the future. I think I’m just exlpo
Hi Kimberly,
Django is mostly for website development. If you can tell us a little bit
about your model and some plans, that would be great. I’d love to help
another Harvard student in their endeavors since many give up after
graduating grad school (especially those undergrads...). Again, let us k
Hi Kimberly,
I’ve taken a look at your preschool and school program, SNACS. Early in my
teen years, I helped set up [certain state in US] for an educational
bounce-back from zero funding to minimal, but the kid’s passions returned.
Django is a website framework, and I don’t think that’s what you'r
ow you think contributes to a certain type — or even
> workflow or stack — of learning in CS. “
> "tying in what you know, how you behave," You mean like do some projects
> for my own area?
>
>
> 在 2020年1月21日 於 上午12:47:09, Andrew C. (andreke12...@gmail.com) 寫下:
>
>
gt; workflow or stack — of learning in CS. “
> "tying in what you know, how you behave," You mean like do some projects
> for my own area?
>
>
> 在 2020年1月21日 於 上午12:47:09, Andrew C. (andreke12...@gmail.com) 寫下:
>
> What is your major? Usually tying in what you know, h
Usually, something that has multiple versions could be in an autoincrement
field as the primary key. Then, in a JSONB field with GIN index (since
you’re using PostgreSQL), you would have a dict of each version, like this:
{
“1”: { # beginning of article 1
“versions”: {
“1”: {
“title”: “Blah1”,
“t
Try Quill.js. If you google Quill.js and Quill.js Django, I believe
you'll find the Django package that goes along with that text editor.
Really, you only need the Quill.js code for your template. WYSIWYG is
just a user typing in HTML without realizing it. Just save the HTML
(because the rest is es
29 matches
Mail list logo