Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Can anyone explain me, how migration will happened in django?
Actually I want full backend procedure of "./manage.py migrate" command
It was explained once at the "django under the hood" conference by the author. I have a summary of that: http://reinout.vanrees.org/weblog/2014/11/14/2migrations.html
The way it works is by chopping all operations into tiny dependencies. Every individual field that has to be created is turned into a tiny dependency step. After the list of steps is sorted (via the dependency-resolving loop) into the correct list of steps, an optimiser goes through the list and optimises it. If a model gets created and deleted, nothing needs to be done, for instance.
The final part of the puzzle is the graph. It builds a directed graph of all basic migrations in memory. It needs to read all the models on disk for that. It also looks in the database. There’s a table in there that marks which migrations (or rather: nodes in the migration graph) have been applied.
If you want to look at the code, here are some pointers:
django/db/migrations/autodetector.py, start at _detect_changes()
django/db/migrations/optimizer.py, start at reduce()
django/db/migrations/graph.py
django/db/migrations/loader.py
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm working on a development road map for a django project. My choosen IDE is pycharm pro and mock up tool is bootstrap studio. One of my criteria is a calendar and I have discovered that none of the existing public projects will meet my needs so I will have to create one from scratch (no problem). My typical approach would have been that the UI and the django project would be done in near parallel periodically merging and diverging the two. However, given the ability of the two software tools, I'm starting to think that that a better approach may be to do the UI first in BSS, next import the templates into the django project and finally perform the django dev to meet the needs of the UI.
The specific calendar functionality is not the issue here, this is a methodology question. While I know that there is a subjective answer to this question (which is not the "answer" I'm looking for here), there also has to be an objective answer as to why this would not work, or be the incorrect approach.
Doing the UI first is fine if you already know exactly what you want it to do and can specify that. Doing the Django first lets you play around with a working rough version and get a better feel for what works best before fine tuning the look and feel. Like you suggest, working on them both together will let each inform the other.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
OVERVIEW
I'd like to test some Django websites using random data on a production server using real domain names, but these websites will be simple tests with possible duplicated data (quite probable not following Google rules). I know usually for this you use a development/staging/virtual box for such a task, but I do want to use directly the production box with the real DNS.
Now, I'm kind of new on website development and SEO, and I wouldn't like to mess with SEO and Google.
What'd be the right way to proceed here? Should I try to avoid being indexed/crawled by Google somehow? Any other advices?
You can disallow the complete indexing of your page and then later (when you're done with coding) activate it again.
Thats probably the best way because google is not going to crawl "bad pages" (for example when your website still is in development) and thus you will not get a Ranking so far (called Page Ranking if you want to look it up).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
After creating reusable Django apps do one make an app that glue them together to create a website? Also is it correct to make each menu item and section an app itself in Django? The source code of https://www.djangoproject.com/ is probably the best example of how to correctly structure Django websites if it is available.
How you organise your project is up to you and mostly depends on the project's specific needs, but yes using a "main" app to glue the pieces together is a common and working pattern. Also you don't have to try and make your project's apps reusable - start with just what your project requires and if you find out some parts solve recurring problems it will be time to factor them out as more generic apps.
Wrt/ your menus they have to match the site features not it's implementation so the "one app one menu" thing very seldom makes sense. And since it's a "glue" part it really belongs to the project's main app (even if it usually delegates parts of the job to other apps).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I was searching for product recommendation system in shopping carts and saw, How does the Amazon Recommendation feature work?
and in many other sites there are several complex solutions were given and each method has some disadvantage in adoptation. Instead of using complex methods, is it not very easy to get user feedback like giving options for the users to choose why they ordered a particular product. Example, if a user purchases a book, he will be given options, 1)author 2) genre 3)price 4)publisher. By this system, one can get the exact reason for the sale of the product. Are there any disadvantages in implementing this method? Thanks
Users do no want extra interactions.
There is a reason why "one click shopping" is successful.
https://en.wikipedia.org/wiki/1-Click
Most likely, they will be annoyed and not come to your site anymore, and prefer an online retailer that doesn't ask them this extra question. They may also just click random buttons to make the window go away, without caring. What is the incentive for them to answer correctly?
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would like to modify the tutorial poll that Django provided. I'm interested in varying the question displayed each time the user selects an answer. Specifically, pull questions randomly out from a .txt file, but keep the answer selection the same.
Can I use the model from the tutorial or do I have to create a new one?
Hi, welcome to SO. You may wish to check this page... How to ask
questions on SO - its best to ask a specific rather than general question here and show what you have tried to date.
Having said that this doesn't really sound like a job for django's model classes which are designed so that
Each attribute of the model represents a database field.
Source
You are best to use the existing poll tutorial model, but build a view which takes a text file and loads it into the database. For instance something like this SO post, and this one may get you started.