How do I create a Django web application with an HTML/CSS/JS frontend and a Django and Flask backend?
I have never made a web application using the combination of Django, Python, and Flask. I am not sure how to even get the directory sorted out. I was going to just write the front end in HTML/CSS/JS and then figure out how to connect everything to it, but I don't even know where to begin. Here is the prompt:
Build a Django application that will connect with 3 external weather
services and provide an average temperature for a given zip lat/lon.
The Django application should have a single url route that takes in a
latitude, longitude, and a list of external services to filter on.
The acceptable filters will be ‘noaa’, ‘weather.com’, and
‘accuweather’.
For example: if the user sends in ‘noaa’ and ‘accuweather’ in the
filter list, then only those two services will be used to calculate
the average temperature for the given lat/lon.
In order to connect with the 3 external APIs, we have created a simple
Flask application that you will run and connect to. This will prevent
you from having to actually integrate with three external providers.
Please access this application and view the readme
here: https://github.com/otterlogic/mock-weather-api
Although this is a simple application, please use architecture and
design patterns as you would for a larger and more complex project.
Guidelines:
Use Django
Create a url route that accepts: latitude, longitude, and filters
Filter the external providers depending on the user input filters
The response to the request will be a json response with the average
current temperature
I always have trouble getting started when there's already existing code. I do so much better when I am the one creating everything from scratch. Does anyone else usually have this problem?
python django api web flask
add a comment |
I have never made a web application using the combination of Django, Python, and Flask. I am not sure how to even get the directory sorted out. I was going to just write the front end in HTML/CSS/JS and then figure out how to connect everything to it, but I don't even know where to begin. Here is the prompt:
Build a Django application that will connect with 3 external weather
services and provide an average temperature for a given zip lat/lon.
The Django application should have a single url route that takes in a
latitude, longitude, and a list of external services to filter on.
The acceptable filters will be ‘noaa’, ‘weather.com’, and
‘accuweather’.
For example: if the user sends in ‘noaa’ and ‘accuweather’ in the
filter list, then only those two services will be used to calculate
the average temperature for the given lat/lon.
In order to connect with the 3 external APIs, we have created a simple
Flask application that you will run and connect to. This will prevent
you from having to actually integrate with three external providers.
Please access this application and view the readme
here: https://github.com/otterlogic/mock-weather-api
Although this is a simple application, please use architecture and
design patterns as you would for a larger and more complex project.
Guidelines:
Use Django
Create a url route that accepts: latitude, longitude, and filters
Filter the external providers depending on the user input filters
The response to the request will be a json response with the average
current temperature
I always have trouble getting started when there's already existing code. I do so much better when I am the one creating everything from scratch. Does anyone else usually have this problem?
python django api web flask
I would argue that the vast majority of programming is about using code you didn't write. Mastering that is of utmost importance. That said, have you gone through any of the Django tutorials on the web? There are plenty of them, many of which are real nice (the official documentation is a great place to start).
– Jonah Bishop
Nov 13 '18 at 0:35
I spent all day yesterday going through Django tutorials. I just wasn't sure how the flask portion fit into my directory or the Django portion and how the web form fit into all those. I just need some clarification
– Radical Edward
Nov 13 '18 at 2:00
add a comment |
I have never made a web application using the combination of Django, Python, and Flask. I am not sure how to even get the directory sorted out. I was going to just write the front end in HTML/CSS/JS and then figure out how to connect everything to it, but I don't even know where to begin. Here is the prompt:
Build a Django application that will connect with 3 external weather
services and provide an average temperature for a given zip lat/lon.
The Django application should have a single url route that takes in a
latitude, longitude, and a list of external services to filter on.
The acceptable filters will be ‘noaa’, ‘weather.com’, and
‘accuweather’.
For example: if the user sends in ‘noaa’ and ‘accuweather’ in the
filter list, then only those two services will be used to calculate
the average temperature for the given lat/lon.
In order to connect with the 3 external APIs, we have created a simple
Flask application that you will run and connect to. This will prevent
you from having to actually integrate with three external providers.
Please access this application and view the readme
here: https://github.com/otterlogic/mock-weather-api
Although this is a simple application, please use architecture and
design patterns as you would for a larger and more complex project.
Guidelines:
Use Django
Create a url route that accepts: latitude, longitude, and filters
Filter the external providers depending on the user input filters
The response to the request will be a json response with the average
current temperature
I always have trouble getting started when there's already existing code. I do so much better when I am the one creating everything from scratch. Does anyone else usually have this problem?
python django api web flask
I have never made a web application using the combination of Django, Python, and Flask. I am not sure how to even get the directory sorted out. I was going to just write the front end in HTML/CSS/JS and then figure out how to connect everything to it, but I don't even know where to begin. Here is the prompt:
Build a Django application that will connect with 3 external weather
services and provide an average temperature for a given zip lat/lon.
The Django application should have a single url route that takes in a
latitude, longitude, and a list of external services to filter on.
The acceptable filters will be ‘noaa’, ‘weather.com’, and
‘accuweather’.
For example: if the user sends in ‘noaa’ and ‘accuweather’ in the
filter list, then only those two services will be used to calculate
the average temperature for the given lat/lon.
In order to connect with the 3 external APIs, we have created a simple
Flask application that you will run and connect to. This will prevent
you from having to actually integrate with three external providers.
Please access this application and view the readme
here: https://github.com/otterlogic/mock-weather-api
Although this is a simple application, please use architecture and
design patterns as you would for a larger and more complex project.
Guidelines:
Use Django
Create a url route that accepts: latitude, longitude, and filters
Filter the external providers depending on the user input filters
The response to the request will be a json response with the average
current temperature
I always have trouble getting started when there's already existing code. I do so much better when I am the one creating everything from scratch. Does anyone else usually have this problem?
python django api web flask
python django api web flask
asked Nov 13 '18 at 0:32
Radical EdwardRadical Edward
106
106
I would argue that the vast majority of programming is about using code you didn't write. Mastering that is of utmost importance. That said, have you gone through any of the Django tutorials on the web? There are plenty of them, many of which are real nice (the official documentation is a great place to start).
– Jonah Bishop
Nov 13 '18 at 0:35
I spent all day yesterday going through Django tutorials. I just wasn't sure how the flask portion fit into my directory or the Django portion and how the web form fit into all those. I just need some clarification
– Radical Edward
Nov 13 '18 at 2:00
add a comment |
I would argue that the vast majority of programming is about using code you didn't write. Mastering that is of utmost importance. That said, have you gone through any of the Django tutorials on the web? There are plenty of them, many of which are real nice (the official documentation is a great place to start).
– Jonah Bishop
Nov 13 '18 at 0:35
I spent all day yesterday going through Django tutorials. I just wasn't sure how the flask portion fit into my directory or the Django portion and how the web form fit into all those. I just need some clarification
– Radical Edward
Nov 13 '18 at 2:00
I would argue that the vast majority of programming is about using code you didn't write. Mastering that is of utmost importance. That said, have you gone through any of the Django tutorials on the web? There are plenty of them, many of which are real nice (the official documentation is a great place to start).
– Jonah Bishop
Nov 13 '18 at 0:35
I would argue that the vast majority of programming is about using code you didn't write. Mastering that is of utmost importance. That said, have you gone through any of the Django tutorials on the web? There are plenty of them, many of which are real nice (the official documentation is a great place to start).
– Jonah Bishop
Nov 13 '18 at 0:35
I spent all day yesterday going through Django tutorials. I just wasn't sure how the flask portion fit into my directory or the Django portion and how the web form fit into all those. I just need some clarification
– Radical Edward
Nov 13 '18 at 2:00
I spent all day yesterday going through Django tutorials. I just wasn't sure how the flask portion fit into my directory or the Django portion and how the web form fit into all those. I just need some clarification
– Radical Edward
Nov 13 '18 at 2:00
add a comment |
1 Answer
1
active
oldest
votes
Just follow the instructions:
virtualenv env
source env/bin/activate
pip install -r requirements.txt
FLASK_APP=app.py
flask run
You can do without a virtualenv but you're gonna need Python and pip installed. Assuming you got Python installed, you also need to be able to run pip so that you can install the dependencies. If you still cannot start Flask after doing that, you should check that the python scripts are in your system PATH variable.
Then you just follow the Flask routing scheme and use Django as a backend for your weather service. The application logic is not that large.
I was able to get the flask app running without any problems whatsoever. It was super easy. I just hit a wall after that
– Radical Edward
Nov 13 '18 at 1:59
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53272093%2fhow-do-i-create-a-django-web-application-with-an-html-css-js-frontend-and-a-djan%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just follow the instructions:
virtualenv env
source env/bin/activate
pip install -r requirements.txt
FLASK_APP=app.py
flask run
You can do without a virtualenv but you're gonna need Python and pip installed. Assuming you got Python installed, you also need to be able to run pip so that you can install the dependencies. If you still cannot start Flask after doing that, you should check that the python scripts are in your system PATH variable.
Then you just follow the Flask routing scheme and use Django as a backend for your weather service. The application logic is not that large.
I was able to get the flask app running without any problems whatsoever. It was super easy. I just hit a wall after that
– Radical Edward
Nov 13 '18 at 1:59
add a comment |
Just follow the instructions:
virtualenv env
source env/bin/activate
pip install -r requirements.txt
FLASK_APP=app.py
flask run
You can do without a virtualenv but you're gonna need Python and pip installed. Assuming you got Python installed, you also need to be able to run pip so that you can install the dependencies. If you still cannot start Flask after doing that, you should check that the python scripts are in your system PATH variable.
Then you just follow the Flask routing scheme and use Django as a backend for your weather service. The application logic is not that large.
I was able to get the flask app running without any problems whatsoever. It was super easy. I just hit a wall after that
– Radical Edward
Nov 13 '18 at 1:59
add a comment |
Just follow the instructions:
virtualenv env
source env/bin/activate
pip install -r requirements.txt
FLASK_APP=app.py
flask run
You can do without a virtualenv but you're gonna need Python and pip installed. Assuming you got Python installed, you also need to be able to run pip so that you can install the dependencies. If you still cannot start Flask after doing that, you should check that the python scripts are in your system PATH variable.
Then you just follow the Flask routing scheme and use Django as a backend for your weather service. The application logic is not that large.
Just follow the instructions:
virtualenv env
source env/bin/activate
pip install -r requirements.txt
FLASK_APP=app.py
flask run
You can do without a virtualenv but you're gonna need Python and pip installed. Assuming you got Python installed, you also need to be able to run pip so that you can install the dependencies. If you still cannot start Flask after doing that, you should check that the python scripts are in your system PATH variable.
Then you just follow the Flask routing scheme and use Django as a backend for your weather service. The application logic is not that large.
answered Nov 13 '18 at 0:40
Niklas RosencrantzNiklas Rosencrantz
7,19249151322
7,19249151322
I was able to get the flask app running without any problems whatsoever. It was super easy. I just hit a wall after that
– Radical Edward
Nov 13 '18 at 1:59
add a comment |
I was able to get the flask app running without any problems whatsoever. It was super easy. I just hit a wall after that
– Radical Edward
Nov 13 '18 at 1:59
I was able to get the flask app running without any problems whatsoever. It was super easy. I just hit a wall after that
– Radical Edward
Nov 13 '18 at 1:59
I was able to get the flask app running without any problems whatsoever. It was super easy. I just hit a wall after that
– Radical Edward
Nov 13 '18 at 1:59
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53272093%2fhow-do-i-create-a-django-web-application-with-an-html-css-js-frontend-and-a-djan%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I would argue that the vast majority of programming is about using code you didn't write. Mastering that is of utmost importance. That said, have you gone through any of the Django tutorials on the web? There are plenty of them, many of which are real nice (the official documentation is a great place to start).
– Jonah Bishop
Nov 13 '18 at 0:35
I spent all day yesterday going through Django tutorials. I just wasn't sure how the flask portion fit into my directory or the Django portion and how the web form fit into all those. I just need some clarification
– Radical Edward
Nov 13 '18 at 2:00