Best place to host my local django project
I've created a small django project on my local computer. It is basically a portfolio website with a landing page and a few links to my projects. I am new to django and web dev in general so forgive me for any dumb questions.
A while ago, I purchased a domain from Hostgator. After doing some research, it appears Hostgator is neither optimal or easy to use for Django. I'm now deciding between pythonanywhere, heroku and digitalocean.
Here are some conditions I hope can be met for my website:
1. I would like my site to be primarily based in Django, python and html/css. However, I wouldn't mind the flexibility for adding other tools/languages in the future. I plan to expand my site in an open-ended way but, at the end of the day, I want my site to look akin to this: [https://danielmiessler.com/](https://danielmiessler.com/).
2. I would like an email in my domain - the same domain as my website. Does either heroku or digitalocean provide easy-to-use and affordable email hosting services? I know hostgator does and pythonanywhere does not. If I go with pythonanywhere, can I just create an email domain using flaskmail, fastmail or protonmail? Would there be any
/r/django
https://redd.it/c9l6cy
I've created a small django project on my local computer. It is basically a portfolio website with a landing page and a few links to my projects. I am new to django and web dev in general so forgive me for any dumb questions.
A while ago, I purchased a domain from Hostgator. After doing some research, it appears Hostgator is neither optimal or easy to use for Django. I'm now deciding between pythonanywhere, heroku and digitalocean.
Here are some conditions I hope can be met for my website:
1. I would like my site to be primarily based in Django, python and html/css. However, I wouldn't mind the flexibility for adding other tools/languages in the future. I plan to expand my site in an open-ended way but, at the end of the day, I want my site to look akin to this: [https://danielmiessler.com/](https://danielmiessler.com/).
2. I would like an email in my domain - the same domain as my website. Does either heroku or digitalocean provide easy-to-use and affordable email hosting services? I know hostgator does and pythonanywhere does not. If I go with pythonanywhere, can I just create an email domain using flaskmail, fastmail or protonmail? Would there be any
/r/django
https://redd.it/c9l6cy
Danielmiessler
Daniel Miessler
SECURITY | AI | PURPOSE :: Building AI that upgrades humans. Cybersecurity and AI engineer, founder, writer, and creator based in San Francisco.
[R] mat2vec: Unsupervised word embeddings capture latent knowledge from materials science literature
From the abstract:
>Without any explicit insertion of chemical knowledge, these embeddings capture complex materials science concepts such as the underlying structure of the periodic table and structure– property relationships in materials. Furthermore, **we demonstrate that an unsupervised method can recommend materials for functional applications several years before their discovery.** This suggests that latent knowledge regarding future discoveries is to a large extent embedded in past publications. Our findings highlight the possibility of extracting knowledge and relationships from the massive body of scientific literature in a collective manner, and point towards a generalized approach to the mining of scientific literature.
​
Paper: [https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8](https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8)
Source Code: [https://github.com/materialsintelligence/mat2vec](https://github.com/materialsintelligence/mat2vec)
/r/MachineLearning
https://redd.it/c9nomk
From the abstract:
>Without any explicit insertion of chemical knowledge, these embeddings capture complex materials science concepts such as the underlying structure of the periodic table and structure– property relationships in materials. Furthermore, **we demonstrate that an unsupervised method can recommend materials for functional applications several years before their discovery.** This suggests that latent knowledge regarding future discoveries is to a large extent embedded in past publications. Our findings highlight the possibility of extracting knowledge and relationships from the massive body of scientific literature in a collective manner, and point towards a generalized approach to the mining of scientific literature.
​
Paper: [https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8](https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8)
Source Code: [https://github.com/materialsintelligence/mat2vec](https://github.com/materialsintelligence/mat2vec)
/r/MachineLearning
https://redd.it/c9nomk
GitHub
GitHub - materialsintelligence/mat2vec: Supplementary Materials for Tshitoyan et al. "Unsupervised word embeddings capture latent…
Supplementary Materials for Tshitoyan et al. "Unsupervised word embeddings capture latent knowledge from materials science literature", Nature (2019). - materialsintelligence/mat2vec
settings.AUTH_USER_MODEL returning null
I have a form uploading a file via CreateView and I'm trying to assign the id of the currently logged in user to a field in the model of the uploaded file.
No matter what method I try whether it be get\_user\_model() or anything else, it's just returning null.
producer = models.ForeignKey("users.CustomUser", on\_delete=models.CASCADE,)
​
I can select from a list of users, and the correct ID is assigned the value in the database, but this is obviously not the way it should work.
Here is my code with what's supposed to be the "best way"
​
I do have " AUTH\_USER\_MODEL = 'users.CustomUser' " in my [settings.py](https://settings.py)
​
[https://pastebin.com/XhM98fAy](https://pastebin.com/XhM98fAy)
​
​
Let me know what else you need. I just don't understand why it's so hard to get the value of the currently logged in user.
/r/django
https://redd.it/c9p66g
I have a form uploading a file via CreateView and I'm trying to assign the id of the currently logged in user to a field in the model of the uploaded file.
No matter what method I try whether it be get\_user\_model() or anything else, it's just returning null.
producer = models.ForeignKey("users.CustomUser", on\_delete=models.CASCADE,)
​
I can select from a list of users, and the correct ID is assigned the value in the database, but this is obviously not the way it should work.
Here is my code with what's supposed to be the "best way"
​
I do have " AUTH\_USER\_MODEL = 'users.CustomUser' " in my [settings.py](https://settings.py)
​
[https://pastebin.com/XhM98fAy](https://pastebin.com/XhM98fAy)
​
​
Let me know what else you need. I just don't understand why it's so hard to get the value of the currently logged in user.
/r/django
https://redd.it/c9p66g
[D] How do you think about use face embeddings in conjunction with Elasticsearch for face matching / face similarity application that same as Microsoft's celebslikeme.me ?
Now, my team is developing a application quite similarity as https://www.celebslike.me of Microsoft Corp before (2016).
We seperate the asual canonical pipeline of face recognition system into 3 phrase:
- Phase 1: Face Detection + Face Aligment
- Phase 2: Face Embedding
- Phase 3: Face matching / Face recognion or something like face similarity.
At (3) we use the technical that is the embedded vectors got from a given model that ours is from Facenet in this case to conjunct with Elasticsearch for similarity search.
We are still implementing above solution for now but personally I want to research some nice solutions (if any) for my knowledge also help to improve our product better.
How do you think about another solution(s) for this phase (3) ?
Any ideas are welcome !
/r/MachineLearning
https://redd.it/c9pci1
Now, my team is developing a application quite similarity as https://www.celebslike.me of Microsoft Corp before (2016).
We seperate the asual canonical pipeline of face recognition system into 3 phrase:
- Phase 1: Face Detection + Face Aligment
- Phase 2: Face Embedding
- Phase 3: Face matching / Face recognion or something like face similarity.
At (3) we use the technical that is the embedded vectors got from a given model that ours is from Facenet in this case to conjunct with Elasticsearch for similarity search.
We are still implementing above solution for now but personally I want to research some nice solutions (if any) for my knowledge also help to improve our product better.
How do you think about another solution(s) for this phase (3) ?
Any ideas are welcome !
/r/MachineLearning
https://redd.it/c9pci1
I present my first (bigger) program/app: A PyQt based app with a sqlite DB for a Raspberry Pi to create and control a Cocktail machine.
Hello everyone,
I proudly present my first 'real' app that I've created over the past months: A custom Cocktailmaker control interface for a self-designed Cocktail machine. It was quite a lot to learn (and failing at the beginning), since my background is less programming and more mechanical engineering. But it was quite fun to figure everything out and grow with it. Here is the link:
[https://github.com/AndreWohnsland/Cocktailmaker\_AW](https://github.com/AndreWohnsland/Cocktailmaker_AW)
And some pictures (also in the Github readme):
[Machine and preparing a Cocktail](https://imgur.com/a/Z4tfISx), [pictures of the UI](https://imgur.com/a/fbZ0WuS)
​
Now i am looking forward to learn more and more Python. Currently I am working a lot with Pandas and Matplotlib at my job as a scientific researcher in the renewable energies sector. For the long therm, I want to get a job in Programming (preferably Python). Can anyone recommend what are good next steps to learn/or improve? Currently I am reading and doing a lot of intermediate general Python Books/exercises to improve my overall knowledge of the language and Programming but I don't know if this is the best next step. Any advice would be highly appreciated.
Have a nice day :)
/r/Python
https://redd.it/c9shzs
Hello everyone,
I proudly present my first 'real' app that I've created over the past months: A custom Cocktailmaker control interface for a self-designed Cocktail machine. It was quite a lot to learn (and failing at the beginning), since my background is less programming and more mechanical engineering. But it was quite fun to figure everything out and grow with it. Here is the link:
[https://github.com/AndreWohnsland/Cocktailmaker\_AW](https://github.com/AndreWohnsland/Cocktailmaker_AW)
And some pictures (also in the Github readme):
[Machine and preparing a Cocktail](https://imgur.com/a/Z4tfISx), [pictures of the UI](https://imgur.com/a/fbZ0WuS)
​
Now i am looking forward to learn more and more Python. Currently I am working a lot with Pandas and Matplotlib at my job as a scientific researcher in the renewable energies sector. For the long therm, I want to get a job in Programming (preferably Python). Can anyone recommend what are good next steps to learn/or improve? Currently I am reading and doing a lot of intermediate general Python Books/exercises to improve my overall knowledge of the language and Programming but I don't know if this is the best next step. Any advice would be highly appreciated.
Have a nice day :)
/r/Python
https://redd.it/c9shzs
Python Flask REST API MongoDB CRUD Example - Roy Tutorials
https://www.roytuts.com/python-flask-rest-api-mongodb-crud-example/
/r/flask
https://redd.it/c9rr4y
https://www.roytuts.com/python-flask-rest-api-mongodb-crud-example/
/r/flask
https://redd.it/c9rr4y
Roytuts
Flask REST API MongoDB CRUD Example - Roy Tutorials
Flast REST API Mongo CRUD In this post I will implement Python flask REST API MongoDB CRUD example, where CRUD means Create, Read, Update, and Delete
ShouldnI store TZ information in a session or the User object?
I am working on a project that will have users in several different global time zones and time representation is important. I have defined my own user model by extending AbstractBaseUser. I’m using time zone aware datetime objects and would like to present these times to the users in their own selected time zone.
Reading through Django’s documentation, they provide an example of using middleware to activate the time zone based on data stored in the user’s session.
My question is, does it make a difference whether this data is stored in the session or simply read from the user object? The user object is already available in the request that the middleware has access to right? Or is this one of those situations where the user object will be queried multiple times as a result?
/r/django
https://redd.it/c9ntd7
I am working on a project that will have users in several different global time zones and time representation is important. I have defined my own user model by extending AbstractBaseUser. I’m using time zone aware datetime objects and would like to present these times to the users in their own selected time zone.
Reading through Django’s documentation, they provide an example of using middleware to activate the time zone based on data stored in the user’s session.
My question is, does it make a difference whether this data is stored in the session or simply read from the user object? The user object is already available in the request that the middleware has access to right? Or is this one of those situations where the user object will be queried multiple times as a result?
/r/django
https://redd.it/c9ntd7
reddit
r/django - ShouldnI store TZ information in a session or the User object?
2 votes and 2 comments so far on Reddit
This media is not supported in your browser
VIEW IN TELEGRAM
Simulating a source of light and a lens using Maxwell's Equations in Finite-difference time-domain method
/r/Python
https://redd.it/c9wetp
/r/Python
https://redd.it/c9wetp
PyCon 2019 | Introduction to Data Science with Python
https://liwaiwai.com/2019/07/07/pycon-2019-introduction-to-data-science-with-python/
/r/Python
https://redd.it/c9w5hi
https://liwaiwai.com/2019/07/07/pycon-2019-introduction-to-data-science-with-python/
/r/Python
https://redd.it/c9w5hi
Liwaiwai
PyCon 2019 | Introduction to Data Science with Python - Liwaiwai
PyCon 2019 | Introduction to Data Science with Python Speaker: Grishma Jena Wish to perform Data Science but don’t know how to? Have a dataset that you really want to analyze but not sure how to start? This hands-on session teaches how to explore datasets…
Deploying django app
Hey I am new to Django I have developed a simple Django web app and now I want to deploy it. Which platform is better to deploy a django website. Any suggestions ?
/r/djangolearning
https://redd.it/c9t1zk
Hey I am new to Django I have developed a simple Django web app and now I want to deploy it. Which platform is better to deploy a django website. Any suggestions ?
/r/djangolearning
https://redd.it/c9t1zk
reddit
r/djangolearning - Deploying django app
2 votes and 6 comments so far on Reddit
[Ask Flask] UUIDs or IDs for the primary key?
I've been developing an application and decided I would use UUIDs as the primary key instead of integers. I figured it can be helpful for doing lookups on objects you might not know the type of and also it reveals less information about the underlying data (no URLs that hint how many users or how old a user is).
It mostly works fine but there have been times where I've had to work around stuff. Especially when it comes to using plugins. Also, nearly all the tutorials I see online assume integer IDs.
I was thinking it might be better to use integer IDs internally, but have a UUID field for every model anyway. Then when you want to look something up, the URL just takes a UUID and the integer is used for plugins or internal lookups.
Any thoughts on the best approach? Should I just go with traditional integer, UUIDs or both? Are there any possible gotchas that might come up later I didn't think of?
https://github.com/theocranmore/bloodbike/blob/master/app/models.py
This is what my models file looks like at the moment.
Thank you!
/r/flask
https://redd.it/c9txos
I've been developing an application and decided I would use UUIDs as the primary key instead of integers. I figured it can be helpful for doing lookups on objects you might not know the type of and also it reveals less information about the underlying data (no URLs that hint how many users or how old a user is).
It mostly works fine but there have been times where I've had to work around stuff. Especially when it comes to using plugins. Also, nearly all the tutorials I see online assume integer IDs.
I was thinking it might be better to use integer IDs internally, but have a UUID field for every model anyway. Then when you want to look something up, the URL just takes a UUID and the integer is used for plugins or internal lookups.
Any thoughts on the best approach? Should I just go with traditional integer, UUIDs or both? Are there any possible gotchas that might come up later I didn't think of?
https://github.com/theocranmore/bloodbike/blob/master/app/models.py
This is what my models file looks like at the moment.
Thank you!
/r/flask
https://redd.it/c9txos
GitHub
theocranmore/bloodbike
Dispatch service for blood bikes charity. Contribute to theocranmore/bloodbike development by creating an account on GitHub.
From the Netflix series "Family Business". I rate it 10/10 for realism
/r/Python
https://redd.it/c9xxes
/r/Python
https://redd.it/c9xxes
This media is not supported in your browser
VIEW IN TELEGRAM
Massive update for the 3D renderer I made from scratch in Python. There is now a small, custom programming language for animating properties. Here is a short animation made with the frames rendered by the renderer:
/r/Python
https://redd.it/c9yf0f
/r/Python
https://redd.it/c9yf0f
Using SQLAlchemy JSON object type vs creating an extra relation for storing a list of URLs?
I am considering which option would be better, I basically want to store a list of URLs, which I can modify at will and delete if I need to.
Store a regular list in the table as a db.JSON? or create a separate table and relate it back to the original table (it'll only have one parameter, the URL)
/r/flask
https://redd.it/c9tsu4
I am considering which option would be better, I basically want to store a list of URLs, which I can modify at will and delete if I need to.
Store a regular list in the table as a db.JSON? or create a separate table and relate it back to the original table (it'll only have one parameter, the URL)
/r/flask
https://redd.it/c9tsu4
reddit
r/flask - Using SQLAlchemy JSON object type vs creating an extra relation for storing a list of URLs?
6 votes and 7 comments so far on Reddit
Django Beginner
Hi everyone! I am sort of new to Django, I have sucessfully used it a couple times for large/small projects. Right now I just want to get my project started and I am having a ton of trouble. I start off by creating a python environment. I then activate the environment. After that I use pip to install Django to the environment. After that I try to create my project with [django-admin.py](https://django-admin.py) startproject mysite. When I type this command, it always says "bad interpreter no such file or directory". However, it does start a new project if I do django-admin (without .py). But it seems to create a project using amn older version of Django. I just want to get past this barrier so I can start my project.
/r/django
https://redd.it/ca1h8o
Hi everyone! I am sort of new to Django, I have sucessfully used it a couple times for large/small projects. Right now I just want to get my project started and I am having a ton of trouble. I start off by creating a python environment. I then activate the environment. After that I use pip to install Django to the environment. After that I try to create my project with [django-admin.py](https://django-admin.py) startproject mysite. When I type this command, it always says "bad interpreter no such file or directory". However, it does start a new project if I do django-admin (without .py). But it seems to create a project using amn older version of Django. I just want to get past this barrier so I can start my project.
/r/django
https://redd.it/ca1h8o
Trouble with SQLite
Hey all,
This is my first web app project and I am having issues using SQLite for my database. I’m having trouble finding tutorials or documentation that describes how to implement this into my flask project easily for a complete beginner. I’ve gone through a few and was wondering if anyone had a good recommendation. The database I need is very simple and only has one table for right now.
Thanks!
/r/flask
https://redd.it/c9srir
Hey all,
This is my first web app project and I am having issues using SQLite for my database. I’m having trouble finding tutorials or documentation that describes how to implement this into my flask project easily for a complete beginner. I’ve gone through a few and was wondering if anyone had a good recommendation. The database I need is very simple and only has one table for right now.
Thanks!
/r/flask
https://redd.it/c9srir
reddit
r/flask - Trouble with SQLite
0 votes and 1 comment so far on Reddit
Excited to finally release the first version of my game made entirely with Python and pygame! This sub helped alot btw.
https://bobus-smith.itch.io/transporticular
/r/Python
https://redd.it/c9ygrh
https://bobus-smith.itch.io/transporticular
/r/Python
https://redd.it/c9ygrh
itch.io
Transporticular by Bobus Smith
A 2D Transport Tycoon game, where you must create a great transport empire. Available for Windows
What is the best way to refresh a token using the old token?
I'm using Djoser and it provides several endpoints, but I do not know how to update an X token in X minutes. There seems to be no endpoint for this.
​
Basically, I want to refresh the access token every 5 minutes by making api calls on my front end. But as for the back, I do not know what to do about it.
/r/djangolearning
https://redd.it/c9zm30
I'm using Djoser and it provides several endpoints, but I do not know how to update an X token in X minutes. There seems to be no endpoint for this.
​
Basically, I want to refresh the access token every 5 minutes by making api calls on my front end. But as for the back, I do not know what to do about it.
/r/djangolearning
https://redd.it/c9zm30
reddit
r/djangolearning - What is the best way to refresh a token using the old token?
2 votes and 1 comment so far on Reddit
How much should a django freelance developer charge hourly
I am confused about how much amount I should charge. Also wanted to know whether doing django freelancing is worth it or not.
/r/django
https://redd.it/ca576e
I am confused about how much amount I should charge. Also wanted to know whether doing django freelancing is worth it or not.
/r/django
https://redd.it/ca576e
reddit
r/django - How much should a django freelance developer charge hourly
2 votes and 12 comments so far on Reddit
Flask vs NodeJS for API that delegates calls to Python scripts: What are benefits/downsides for either case?
I'm about to build a Flask API that runs python scripts on requests.
Using Flask seems more logical and beautiful since then all code in my web-app will be in Python.
On the other hand, the front-end is Javascript/React, so for convenience-sake maybe it doesn't matter that much? Also, I've read that NodeJS can be faster. The biggest concern is that it needs to be scalable and fast.
What's your opinion on this?
Thanks!
/r/flask
https://redd.it/ca6m45
I'm about to build a Flask API that runs python scripts on requests.
Using Flask seems more logical and beautiful since then all code in my web-app will be in Python.
On the other hand, the front-end is Javascript/React, so for convenience-sake maybe it doesn't matter that much? Also, I've read that NodeJS can be faster. The biggest concern is that it needs to be scalable and fast.
What's your opinion on this?
Thanks!
/r/flask
https://redd.it/ca6m45
reddit
r/flask - Flask vs NodeJS for API that delegates calls to Python scripts: What are benefits/downsides for either case?
4 votes and 8 comments so far on Reddit