django application field loaded from already created database and not initialized from the django codedjango - inlineformset_factory with more than one ForeignKeydjango admin crashes when trying to update record but not when inserting a new oneDjango max_length value for a character verying rowCreate a new model which have all fields of currently existing modelMigration of Django field with default value to PostgreSQL databaseError in django poll tutorialwhat does run the command dt mean?Using Tag model to create ManytoMany relationshipHow to set dynamic initial values to django modelform fielddjango-tables doesn't display foreign-key as link in gcbv ListView
Word ending in "-ine" for rat-like
Is this house-rule removing the increased effect of cantrips at higher character levels balanced?
Tricolour nonogram
Should Catholics in a state of grace call themselves sinners?
Active wildlife outside the window- Good or Bad for Cat psychology?
What are the children of two Muggle-borns called?
Is it possible to alias a column based on the result of a select+where?
Why doesn't SpaceX land boosters in Africa?
Can I take Amul cottage cheese from India to Netherlands?
Why should I allow multiple IPs on a website for a single session?
How to find out who created an event?
Fully submerged water bath for stove top baking?
Grid: different background color (of row) based on values
A quine of sorts
Can dual citizens open crypto exchange accounts where U.S. citizens are prohibited?
A* pathfinding algorithm too slow
Is it OK to throw pebbles and stones in streams, waterfalls, ponds, etc.?
Does a lens with a bigger max. aperture focus faster than a lens with a smaller max. aperture?
Copy group of files (Filename*) to backup (Filename*.bak)
Perform mirror symmetry transformation of 3D model (in OBJ)
How do I present a future free of gender stereotypes without being jarring or overpowering the narrative?
Would skyscrapers tip over if people fell sideways?
Hard for me to understand one tip written in "The as-if rule" of cppreference
I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again
django application field loaded from already created database and not initialized from the django code
django - inlineformset_factory with more than one ForeignKeydjango admin crashes when trying to update record but not when inserting a new oneDjango max_length value for a character verying rowCreate a new model which have all fields of currently existing modelMigration of Django field with default value to PostgreSQL databaseError in django poll tutorialwhat does run the command dt mean?Using Tag model to create ManytoMany relationshipHow to set dynamic initial values to django modelform fielddjango-tables doesn't display foreign-key as link in gcbv ListView
I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.
Something like this:
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns
coolerless_print boolean not null
print_color varchar(20)
id bigserial not null
How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?
https://docs.djangoproject.com/en/2.1/intro/tutorial02/
python django
add a comment |
I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.
Something like this:
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns
coolerless_print boolean not null
print_color varchar(20)
id bigserial not null
How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?
https://docs.djangoproject.com/en/2.1/intro/tutorial02/
python django
When you runpython manage.py makemigrations and python manage.py migrate
Django would automatically create the models for you. In your case, it would automatically create aYOURAPPNAME_question
table in your database.
– Paolo
Mar 25 at 15:49
i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo
– Oscalation
Mar 25 at 15:50
1
If that's the case, you'll make use of Django'sinspectdb
.
– Paolo
Mar 25 at 15:54
add a comment |
I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.
Something like this:
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns
coolerless_print boolean not null
print_color varchar(20)
id bigserial not null
How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?
https://docs.djangoproject.com/en/2.1/intro/tutorial02/
python django
I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.
Something like this:
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns
coolerless_print boolean not null
print_color varchar(20)
id bigserial not null
How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?
https://docs.djangoproject.com/en/2.1/intro/tutorial02/
python django
python django
asked Mar 25 at 15:45
OscalationOscalation
2361 silver badge10 bronze badges
2361 silver badge10 bronze badges
When you runpython manage.py makemigrations and python manage.py migrate
Django would automatically create the models for you. In your case, it would automatically create aYOURAPPNAME_question
table in your database.
– Paolo
Mar 25 at 15:49
i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo
– Oscalation
Mar 25 at 15:50
1
If that's the case, you'll make use of Django'sinspectdb
.
– Paolo
Mar 25 at 15:54
add a comment |
When you runpython manage.py makemigrations and python manage.py migrate
Django would automatically create the models for you. In your case, it would automatically create aYOURAPPNAME_question
table in your database.
– Paolo
Mar 25 at 15:49
i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo
– Oscalation
Mar 25 at 15:50
1
If that's the case, you'll make use of Django'sinspectdb
.
– Paolo
Mar 25 at 15:54
When you run
python manage.py makemigrations and python manage.py migrate
Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question
table in your database.– Paolo
Mar 25 at 15:49
When you run
python manage.py makemigrations and python manage.py migrate
Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question
table in your database.– Paolo
Mar 25 at 15:49
i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo
– Oscalation
Mar 25 at 15:50
i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo
– Oscalation
Mar 25 at 15:50
1
1
If that's the case, you'll make use of Django's
inspectdb
.– Paolo
Mar 25 at 15:54
If that's the case, you'll make use of Django's
inspectdb
.– Paolo
Mar 25 at 15:54
add a comment |
1 Answer
1
active
oldest
votes
If you're planning to connect your Django app to an existing database, then you're probably going to use
python manage.py inspectdb
Full explanation can be found here. Integrating Django with a legacy database.
this answer my question - thank you!
– Oscalation
Mar 25 at 15:56
1
Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.
– Paolo
Mar 25 at 15:57
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%2f55341567%2fdjango-application-field-loaded-from-already-created-database-and-not-initialize%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
If you're planning to connect your Django app to an existing database, then you're probably going to use
python manage.py inspectdb
Full explanation can be found here. Integrating Django with a legacy database.
this answer my question - thank you!
– Oscalation
Mar 25 at 15:56
1
Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.
– Paolo
Mar 25 at 15:57
add a comment |
If you're planning to connect your Django app to an existing database, then you're probably going to use
python manage.py inspectdb
Full explanation can be found here. Integrating Django with a legacy database.
this answer my question - thank you!
– Oscalation
Mar 25 at 15:56
1
Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.
– Paolo
Mar 25 at 15:57
add a comment |
If you're planning to connect your Django app to an existing database, then you're probably going to use
python manage.py inspectdb
Full explanation can be found here. Integrating Django with a legacy database.
If you're planning to connect your Django app to an existing database, then you're probably going to use
python manage.py inspectdb
Full explanation can be found here. Integrating Django with a legacy database.
answered Mar 25 at 15:54
PaoloPaolo
2631 silver badge12 bronze badges
2631 silver badge12 bronze badges
this answer my question - thank you!
– Oscalation
Mar 25 at 15:56
1
Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.
– Paolo
Mar 25 at 15:57
add a comment |
this answer my question - thank you!
– Oscalation
Mar 25 at 15:56
1
Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.
– Paolo
Mar 25 at 15:57
this answer my question - thank you!
– Oscalation
Mar 25 at 15:56
this answer my question - thank you!
– Oscalation
Mar 25 at 15:56
1
1
Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.
– Paolo
Mar 25 at 15:57
Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.
– Paolo
Mar 25 at 15:57
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
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%2f55341567%2fdjango-application-field-loaded-from-already-created-database-and-not-initialize%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
When you run
python manage.py makemigrations and python manage.py migrate
Django would automatically create the models for you. In your case, it would automatically create aYOURAPPNAME_question
table in your database.– Paolo
Mar 25 at 15:49
i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo
– Oscalation
Mar 25 at 15:50
1
If that's the case, you'll make use of Django's
inspectdb
.– Paolo
Mar 25 at 15:54