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













0















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/










share|improve this question






















  • 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







  • 1





    If that's the case, you'll make use of Django's inspectdb.

    – Paolo
    Mar 25 at 15:54















0















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/










share|improve this question






















  • 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







  • 1





    If that's the case, you'll make use of Django's inspectdb.

    – Paolo
    Mar 25 at 15:54













0












0








0








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/










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 15:45









OscalationOscalation

2361 silver badge10 bronze badges




2361 silver badge10 bronze badges












  • 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







  • 1





    If that's the case, you'll make use of Django's inspectdb.

    – 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











  • 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
















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










1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer























  • 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











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
);



);













draft saved

draft discarded


















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









1














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.






share|improve this answer























  • 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
















1














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.






share|improve this answer























  • 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














1












1








1







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










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


















  • 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







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.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript