Re: Channels/Daphne offloading SSL Certs to AWS ELB fails to establish socket

2020-04-21 Thread Andrew C.
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

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-11 Thread Andrew C.
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.

Re: How to Setup DjangoRestFrameWork with Mongo DB

2020-03-28 Thread Andrew C.
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

Re: Online money transfer

2020-03-27 Thread Andrew C.
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

Re: AWS API or EC2 for chat?

2020-03-24 Thread Andrew C.
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

Re: AWS API or EC2 for chat?

2020-03-24 Thread Andrew C.
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

Re: write a new app

2020-03-19 Thread Andrew C.
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

Re: Django channel and gunicorn

2020-03-19 Thread Andrew C.
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

Re: is there a WYSIWYG for Django

2020-02-08 Thread Andrew C.
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

Re: JSONField() ordering and removing latest

2020-02-04 Thread Andrew C.
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”,

Re: DjangoEveryDay. My practice website!

2020-01-29 Thread Andrew C.
n > 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

Re: DjangoEveryDay. My practice website!

2020-01-29 Thread Andrew C.
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) 寫下: > >

Re: open source advice needed

2020-01-29 Thread Andrew C.
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

Re: open source advice needed

2020-01-28 Thread Andrew C.
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

Re: DjangoEveryDay. My practice website!

2020-01-20 Thread Andrew C.
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

Re: Correct Design: one app depending on another app

2019-11-20 Thread Andrew C.
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

Re:

2019-08-10 Thread Andrew C.
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 =

Re: How to build users tagging system in my comment textarea.

2019-08-10 Thread Andrew C.
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

Re: Django models and json integration

2019-08-10 Thread Andrew C.
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

Re: Only for specific region

2019-07-29 Thread Andrew C.
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

Re: Django User model

2019-06-24 Thread Andrew C.
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

Re: Internal Ranking System Application

2019-06-24 Thread Andrew C.
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.

Re: Internal Ranking System Application

2019-06-24 Thread Andrew C.
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

Re: Can we create a Rest Api in Django which can able to communicate with multiple databases(Relational, Non relational) dynamically. If yes please recommend me a way to do that

2019-06-23 Thread Andrew C.
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,

Re: How to use permissions on a CreateView class?

2019-05-30 Thread Andrew C.
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 yo

Re: How to use permissions on a CreateView class?

2019-05-30 Thread Andrew C.
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

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread Andrew C.
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

Re: AutoField

2019-05-26 Thread Andrew C.
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

Selecting date formats for aggregate calculations from database with Django

2009-04-09 Thread Andrew C
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